faac: Add format to output caps
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Mon, 11 Jan 2010 12:48:34 +0000 (09:48 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Mon, 11 Jan 2010 14:01:09 +0000 (11:01 -0300)
Adds 'stream-format' to output caps to inform if the stream is
adts or raw. This makes it possible for muxers to reject
input streams on caps if they don't support adts instead of
generating a invalid file.

Fixes #604925

ext/faac/gstfaac.c

index 2a6838d..70d6894 100644 (file)
@@ -77,7 +77,8 @@
     "audio/mpeg, "                     \
     "mpegversion = (int) { 4, 2 }, "   \
     "channels = (int) [ 1, 6 ], "      \
-    "rate = (int) [ 8000, 96000 ]"
+    "rate = (int) [ 8000, 96000 ], "   \
+    "stream-format = (string) { adts, none } "
 static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
@@ -497,7 +498,9 @@ gst_faac_configure_source_pad (GstFaac * faac)
   srccaps = gst_caps_new_simple ("audio/mpeg",
       "mpegversion", G_TYPE_INT, mpegversion,
       "channels", G_TYPE_INT, faac->channels,
-      "rate", G_TYPE_INT, faac->samplerate, NULL);
+      "rate", G_TYPE_INT, faac->samplerate,
+      "stream-format", G_TYPE_STRING, (faac->outputformat ? "adts" : "none"),
+      NULL);
 
   if (!faac->outputformat) {
     GstBuffer *codec_data;