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
This commit is contained in:
yychao 2020-03-09 17:00:01 +08:00 committed by GStreamer Merge Bot
parent 5a2053e0af
commit adc3d12741
3 changed files with 19 additions and 0 deletions

View file

@ -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) */

View file

@ -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

View file

@ -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");