From: yychao Date: Mon, 9 Mar 2020 09:00:01 +0000 (+0800) Subject: tsdemux: Add support for AC4 X-Git-Tag: 1.19.3~507^2~2205 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=adc3d127414ca56e50b440a71dc9e95daf76a94e;p=platform%2Fupstream%2Fgstreamer.git tsdemux: Add support for AC4 According to following two specs, add support for AC4 in tsdemux. 1. ETSI TS 103 190-2 V1.2.1 (2018-02) : Annex D (normative): AC-4 in MPEG-2 transport streams 2. ETSI EN 300 468 V1.16.1 (2019-08) : Annex D (normative):Service information implementation of AC-3, EnhancedAC-3, and AC-4 audio in DVB systems --- diff --git a/gst-libs/gst/mpegts/gst-dvb-descriptor.h b/gst-libs/gst/mpegts/gst-dvb-descriptor.h index 931681a..c68046b 100644 --- a/gst-libs/gst/mpegts/gst-dvb-descriptor.h +++ b/gst-libs/gst/mpegts/gst-dvb-descriptor.h @@ -151,6 +151,7 @@ typedef enum { GST_MTS_DESC_EXT_DVB_VIDEO_DEPTH_RANGE = 0x10, GST_MTS_DESC_EXT_DVB_T2MI = 0x11, GST_MTS_DESC_EXT_DVB_URI_LINKAGE = 0x13, + GST_MTS_DESC_EXT_DVB_AC4 = 0x15, } GstMpegtsDVBExtendedDescriptorType; /* GST_MTS_DESC_DVB_CAROUSEL_IDENTIFIER (0x13) */ diff --git a/gst/mpegtsdemux/gstmpegdefs.h b/gst/mpegtsdemux/gstmpegdefs.h index 5336286..c0debcd 100644 --- a/gst/mpegtsdemux/gstmpegdefs.h +++ b/gst/mpegtsdemux/gstmpegdefs.h @@ -46,6 +46,7 @@ #define ST_VIDEO_DIRAC 0xd1 /* private stream types */ +#define ST_PS_AUDIO_AC4 0x06 #define ST_PS_VIDEO_MPEG2_DCII 0x80 #define ST_PS_AUDIO_AC3 0x81 #define ST_PS_AUDIO_EAC3 0x87 @@ -55,6 +56,7 @@ #define ST_PS_DVD_SUBPICTURE 0xff /* Blu-ray related (registration: 'HDMV'*/ +#define ST_BD_AUDIO_AC4 0x06 #define ST_BD_AUDIO_LPCM 0x80 #define ST_BD_AUDIO_AC3 0x81 #define ST_BD_AUDIO_DTS 0x82 diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 822100b..5db3f54 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -252,6 +252,7 @@ struct _TSDemuxStream "emphasis = (boolean) { FALSE, TRUE }, " \ "mute = (boolean) { FALSE, TRUE }; " \ "audio/x-ac3; audio/x-eac3;" \ + "audio/x-ac4;" \ "audio/x-dts;" \ "audio/x-opus;" \ "audio/x-private-ts-lpcm" \ @@ -1189,6 +1190,10 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, is_audio = TRUE; caps = gst_caps_new_empty_simple ("audio/x-eac3"); break; + case ST_BD_AUDIO_AC4: + is_audio = TRUE; + caps = gst_caps_new_empty_simple ("audio/x-ac4"); + break; case ST_BD_AUDIO_AC3_TRUE_HD: is_audio = TRUE; caps = gst_caps_new_empty_simple ("audio/x-true-hd"); @@ -1250,6 +1255,17 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, /* FIXME: Move all of this into a common method (there might be other * types also, depending on registratino descriptors also */ + + desc = + mpegts_get_descriptor_from_stream (bstream, + GST_MTS_DESC_DVB_EXTENSION); + if (desc != NULL && desc->tag_extension == GST_MTS_DESC_EXT_DVB_AC4) { + GST_LOG ("ac4 audio"); + is_audio = TRUE; + caps = gst_caps_new_empty_simple ("audio/x-ac4"); + break; + } + desc = mpegts_get_descriptor_from_stream (bstream, GST_MTS_DESC_DVB_AC3); if (desc) { GST_LOG ("ac3 audio");