From cda0d3aed881018c4a39273613f7644742705ece Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 14 Feb 2012 11:44:48 -0300 Subject: [PATCH] tsdemux: Add AAC latm support --- gst/mpegtsdemux/gstmpegdefs.h | 3 ++- gst/mpegtsdemux/tsdemux.c | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gst/mpegtsdemux/gstmpegdefs.h b/gst/mpegtsdemux/gstmpegdefs.h index be6209aaf7..66f922b715 100644 --- a/gst/mpegtsdemux/gstmpegdefs.h +++ b/gst/mpegtsdemux/gstmpegdefs.h @@ -151,8 +151,9 @@ #define ST_DSMCC_D 0x0d /* later extensions */ -#define ST_AUDIO_AAC 0x0f +#define ST_AUDIO_AAC_ADTS 0x0f #define ST_VIDEO_MPEG4 0x10 +#define ST_AUDIO_AAC_LATM 0x11 #define ST_VIDEO_H264 0x1b /* Un-official Dirac extension */ diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 03814b6d46..7049c816ed 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -149,7 +149,7 @@ struct _TSDemuxStream "mpegversion = (int) 1;" \ "audio/mpeg, " \ "mpegversion = (int) 4, " \ - "stream-format = (string) adts; " \ + "stream-format = (string) {adts, loas}; " \ "audio/x-lpcm, " \ "width = (int) { 16, 20, 24 }, " \ "rate = (int) { 48000, 96000 }, " \ @@ -256,14 +256,11 @@ gst_ts_demux_base_init (gpointer klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - gst_element_class_add_static_pad_template (element_class, - &video_template); - gst_element_class_add_static_pad_template (element_class, - &audio_template); + gst_element_class_add_static_pad_template (element_class, &video_template); + gst_element_class_add_static_pad_template (element_class, &audio_template); gst_element_class_add_static_pad_template (element_class, &subpicture_template); - gst_element_class_add_static_pad_template (element_class, - &private_template); + gst_element_class_add_static_pad_template (element_class, &private_template); gst_element_class_set_details_simple (element_class, "MPEG transport stream demuxer", @@ -1080,13 +1077,20 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, case ST_DSMCC_D: MPEGTS_BIT_UNSET (base->is_pes, bstream->pid); break; - case ST_AUDIO_AAC: /* ADTS */ + case ST_AUDIO_AAC_ADTS: template = gst_static_pad_template_get (&audio_template); name = g_strdup_printf ("audio_%04x", bstream->pid); caps = gst_caps_new_simple ("audio/mpeg", "mpegversion", G_TYPE_INT, 4, "stream-format", G_TYPE_STRING, "adts", NULL); break; + case ST_AUDIO_AAC_LATM: + template = gst_static_pad_template_get (&audio_template); + name = g_strdup_printf ("audio_%04x", bstream->pid); + caps = gst_caps_new_simple ("audio/mpeg", + "mpegversion", G_TYPE_INT, 4, + "stream-format", G_TYPE_STRING, "loas", NULL); + break; case ST_VIDEO_MPEG4: template = gst_static_pad_template_get (&video_template); name = g_strdup_printf ("video_%04x", bstream->pid);