[0.11] gst-plugins-good: speex: Update for the new raw audio caps

Sebastian Dröge slomo at kemper.freedesktop.org
Thu Jan 5 01:37:30 PST 2012


Module: gst-plugins-good
Branch: 0.11
Commit: 4b6a410be093faff9527504e03cf6d1a91df6cdf
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=4b6a410be093faff9527504e03cf6d1a91df6cdf

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Wed Jan  4 15:05:41 2012 +0100

speex: Update for the new raw audio caps

---

 ext/speex/gstspeexdec.c |    8 ++++++++
 ext/speex/gstspeexenc.c |    9 ++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c
index 1936820..4ba4d28 100644
--- a/ext/speex/gstspeexdec.c
+++ b/ext/speex/gstspeexdec.c
@@ -67,6 +67,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS ("audio/x-raw, "
         "format = (string) " FORMAT_STR ", "
+        "layout = (string) interleaved, "
         "rate = (int) [ 6000, 48000 ], " "channels = (int) [ 1, 2 ]")
     );
 
@@ -231,9 +232,16 @@ gst_speex_dec_parse_header (GstSpeexDec * dec, GstBuffer * buf)
   /* set caps */
   caps = gst_caps_new_simple ("audio/x-raw",
       "format", G_TYPE_STRING, FORMAT_STR,
+      "layout", G_TYPE_STRING, "interleaved",
       "rate", G_TYPE_INT, dec->header->rate,
       "channels", G_TYPE_INT, dec->header->nb_channels, NULL);
 
+  if (dec->header->nb_channels == 2) {
+    gst_caps_set_simple (caps, "channel-mask", GST_TYPE_BITMASK,
+        GST_AUDIO_CHANNEL_POSITION_MASK (FRONT_LEFT) |
+        GST_AUDIO_CHANNEL_POSITION_MASK (FRONT_RIGHT), NULL);
+  }
+
   if (!gst_pad_set_caps (GST_AUDIO_DECODER_SRC_PAD (dec), caps))
     goto nego_failed;
 
diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c
index 01202ea..3bf2bbc 100644
--- a/ext/speex/gstspeexenc.c
+++ b/ext/speex/gstspeexenc.c
@@ -59,7 +59,14 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS ("audio/x-raw, "
         "format = (string) " FORMAT_STR ", "
-        "rate = (int) [ 6000, 48000 ], " "channels = (int) [ 1, 2 ]")
+        "layout = (string) interleaved, "
+        "rate = (int) [ 6000, 48000 ], "
+        "channels = (int) 1; "
+        "audio/x-raw, "
+        "format = (string) " FORMAT_STR ", "
+        "layout = (string) interleaved, "
+        "rate = (int) [ 6000, 48000 ], "
+        "channels = (int) 2, " "channel-mask = (bitmask) 0x3")
     );
 
 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",



More information about the gstreamer-commits mailing list