GST_STATIC_CAPS ("audio/mpeg, "
"mpegversion = (int) 1, "
"layer = (int) [ 1, 3 ], "
+ "stream-format = (string) { none }, "
COMMON_AUDIO_CAPS "; "
"audio/mpeg, "
"mpegversion = (int) { 2, 4 }, "
GstStructure *structure;
const GValue *codec_data = NULL;
const GstBuffer *buf = NULL;
+ const gchar *stream_format = NULL;
mux = GST_MATROSKA_MUX (GST_PAD_PARENT (pad));
break;
}
case 2:
- if (buf) {
- context->codec_id =
- g_strdup_printf (GST_MATROSKA_CODEC_ID_AUDIO_AAC_MPEG2 "%s",
- aac_codec_data_to_codec_id (buf));
+ case 4:
+ stream_format = gst_structure_get_string (structure, "stream-format");
+ /* check this is raw aac */
+ if (stream_format) {
+ if (strcmp (stream_format, "none") != 0) {
+ GST_WARNING_OBJECT (mux, "AAC stream-format must be 'none', not %s",
+ stream_format);
+ }
} else {
- GST_DEBUG_OBJECT (mux, "no AAC codec_data; not packetized");
- return FALSE;
+ GST_WARNING_OBJECT (mux, "AAC stream-format not specified, "
+ "assuming 'none'");
}
- break;
- case 4:
+
if (buf) {
- context->codec_id =
- g_strdup_printf (GST_MATROSKA_CODEC_ID_AUDIO_AAC_MPEG4 "%s",
- aac_codec_data_to_codec_id (buf));
+ if (mpegversion == 2)
+ context->codec_id =
+ g_strdup_printf (GST_MATROSKA_CODEC_ID_AUDIO_AAC_MPEG2 "%s",
+ aac_codec_data_to_codec_id (buf));
+ else if (mpegversion == 4)
+ context->codec_id =
+ g_strdup_printf (GST_MATROSKA_CODEC_ID_AUDIO_AAC_MPEG4 "%s",
+ aac_codec_data_to_codec_id (buf));
+ else
+ g_assert_not_reached ();
} else {
GST_DEBUG_OBJECT (mux, "no AAC codec_data; not packetized");
return FALSE;