mad: Update for the new raw audio caps
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 4 Jan 2012 14:49:38 +0000 (15:49 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 5 Jan 2012 09:37:04 +0000 (10:37 +0100)
ext/mad/gstmad.c

index aa42e69fc8c4b4a58954eacb33b8a4fc0b1b7536..c5a2ccc65a41c400c3e55fe37261f09c29ea3c22 100644 (file)
@@ -56,6 +56,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS ("audio/x-raw, "
         "format = (string) " GST_AUDIO_NE (S32) ", "
+        "layout = (string) interleaved, "
         "rate = (int) { 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 }, "
         "channels = (int) [ 1, 2 ]")
     );
@@ -247,11 +248,17 @@ gst_mad_check_caps_reset (GstMad * mad)
      * can be gotten for streaminfo */
     caps = gst_caps_new_simple ("audio/x-raw",
         "format", G_TYPE_STRING, GST_AUDIO_NE (S32),
+        "layout", G_TYPE_STRING, "interleaved",
         "signed", G_TYPE_BOOLEAN, TRUE,
         "width", G_TYPE_INT, 32,
         "depth", G_TYPE_INT, 32,
         "rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, nchannels, NULL);
 
+    if (nchannels > 1)
+      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);
+
     gst_audio_decoder_set_outcaps (GST_AUDIO_DECODER (mad), caps);
     gst_caps_unref (caps);