diff options
author | yychao <yychao@gmail.com> | 2020-03-09 17:00:01 +0800 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-03-09 21:54:09 +0000 |
commit | adc3d127414ca56e50b440a71dc9e95daf76a94e (patch) | |
tree | f3f53bea3ead05ff707aa1c6d793fe58242130f2 /gst/mpegtsdemux | |
parent | 5a2053e0af60705107d9b236e8dfd99920a1e09b (diff) | |
download | gstreamer-plugins-bad-adc3d127414ca56e50b440a71dc9e95daf76a94e.tar.gz |
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
Diffstat (limited to 'gst/mpegtsdemux')
-rw-r--r-- | gst/mpegtsdemux/gstmpegdefs.h | 2 | ||||
-rw-r--r-- | gst/mpegtsdemux/tsdemux.c | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gst/mpegtsdemux/gstmpegdefs.h b/gst/mpegtsdemux/gstmpegdefs.h index 5336286ef..c0debcd7d 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 822100b07..5db3f54b5 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"); |