diff --git a/girs/GstMpegts-1.0.gir b/girs/GstMpegts-1.0.gir index f268c28858..c34b5f0d65 100644 --- a/girs/GstMpegts-1.0.gir +++ b/girs/GstMpegts-1.0.gir @@ -1294,7 +1294,7 @@ and other specifications mentioned in the documentation.</doc> <type name="guint8" c:type="guint8"/> </field> <field name="tag_extension" writable="1"> - <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.h">the extended type (if @descriptor_tag is 0x7f)</doc> + <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.h">the extended type (if @tag is 0x7f (for DVB) or 0x3f (for H.222.0))</doc> <type name="guint8" c:type="guint8"/> </field> <field name="length" writable="1"> @@ -2497,6 +2497,9 @@ Consult the relevant specifications for more details.</doc> </member> <member name="stereoscopic_video_info" value="54" c:identifier="GST_MTS_DESC_STEREOSCOPIC_VIDEO_INFO"> </member> + <member name="extension" value="63" c:identifier="GST_MTS_DESC_EXTENSION" version="1.26"> + <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.h">Extension Descriptor.</doc> + </member> </enumeration> <record name="DvbMultilingualBouquetNameItem" c:type="GstMpegtsDvbMultilingualBouquetNameItem" glib:type-name="GstMpegtsDvbMultilingualBouquetNameItem" glib:get-type="gst_mpegts_dvb_multilingual_bouquet_name_item_get_type" c:symbol-prefix="dvb_multilingual_bouquet_name_item"> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gst-dvb-descriptor.h">a multilingual bouquet name entry</doc> @@ -2602,6 +2605,17 @@ Consult the relevant specifications for more details.</doc> </array> </field> </record> + <enumeration name="ExtendedDescriptorType" version="1.26" c:type="GstMpegtsExtendedDescriptorType"> + <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.h">The type of an extended descriptor + +The values correpond to the registered extended descriptor types from the +base ISO 13818 / ITU H.222.0 specifications + +Consult the specification for more details</doc> + <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.h"/> + <member name="mts_desc_ext_jxs_video" value="20" c:identifier="GST_MTS_DESC_EXT_JXS_VIDEO"> + </member> + </enumeration> <record name="ExtendedEventDescriptor" c:type="GstMpegtsExtendedEventDescriptor" glib:type-name="GstMpegtsExtendedEventDescriptor" glib:get-type="gst_mpegts_extended_event_descriptor_get_type" c:symbol-prefix="extended_event_descriptor"> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gst-dvb-descriptor.h">Extended Event Descriptor (EN 300 468 v.1.13.1)</doc> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gst-dvb-descriptor.h"/> diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegts-private.h b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegts-private.h index 3f5b09891a..ae1cd54601 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegts-private.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegts-private.h @@ -80,14 +80,14 @@ G_GNUC_INTERNAL gpointer __common_section_checks (GstMpegtsSection *section, GST_WARNING ("Descriptor is empty (data field == NULL)"); \ return retval; \ } \ - if (G_UNLIKELY ((desc)->tag != 0x7f) || \ + if (G_UNLIKELY (((desc)->tag != 0x7f) && ((desc)->tag != 0x3f)) || \ ((desc)->tag_extension != (tagexttype))) { \ GST_WARNING ("Wrong descriptor type (Got 0x%02x, expected 0x%02x)", \ (desc)->tag_extension, tagexttype); \ return retval; \ } #define __common_desc_ext_checks(desc, tagexttype, minlen, retval) \ - __common_desc_ext_check_base(desc, tagexttype, retval); \ + __common_desc_ext_check_base(desc, tagexttype, retval); \ if (G_UNLIKELY ((desc)->length < (minlen))) { \ GST_WARNING ("Descriptor too small (Got %d, expected at least %d)", \ (desc)->length, minlen); \ diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.c b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.c index f65abf778e..8b6bcf2c8d 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.c @@ -794,7 +794,8 @@ gst_mpegts_parse_descriptors (guint8 * buffer, gsize buf_len) GST_LOG ("descriptor 0x%02x length:%d", desc->tag, desc->length); GST_MEMDUMP ("descriptor", desc->data + 2, desc->length); /* extended descriptors */ - if (G_UNLIKELY (desc->tag == 0x7f)) + if (G_UNLIKELY (desc->tag == GST_MTS_DESC_DVB_EXTENSION + || desc->tag == GST_MTS_DESC_EXTENSION)) desc->tag_extension = *data; data += desc->length; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.h b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.h index d3f673aec8..400189e691 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtsdescriptor.h @@ -135,9 +135,33 @@ typedef enum { GST_MTS_DESC_STEREOSCOPIC_PROGRAM_INFO = 0x35, GST_MTS_DESC_STEREOSCOPIC_VIDEO_INFO = 0x36, + /** + * GST_MTS_DESC_EXTENSION: + * + * Extension Descriptor. + * + * Since: 1.26 + */ + GST_MTS_DESC_EXTENSION = 0x3f /* 55-63 ITU-T Rec. H.222.0 | ISO/IEC 13818-1 Reserved */ } GstMpegtsDescriptorType; +/** + * GstMpegtsExtendedDescriptorType: + * + * The type of an extended descriptor + * + * The values correpond to the registered extended descriptor types from the + * base ISO 13818 / ITU H.222.0 specifications + * + * Consult the specification for more details + * + * Since: 1.26 + */ +typedef enum { + GST_MTS_DESC_EXT_JXS_VIDEO = 0x14, +} GstMpegtsExtendedDescriptorType; + /** * GstMpegtsMiscDescriptorType: * @@ -180,7 +204,7 @@ GType gst_mpegts_descriptor_get_type (void); /** * GstMpegtsDescriptor: * @tag: the type of descriptor - * @tag_extension: the extended type (if @descriptor_tag is 0x7f) + * @tag_extension: the extended type (if @tag is 0x7f (for DVB) or 0x3f (for H.222.0)) * @length: the length of the descriptor content (excluding tag/length field) * @data: the full descriptor data (including tag, extension, length). The first * two bytes are the @tag and @length. diff --git a/subprojects/gst-plugins-bad/tests/examples/mpegts/ts-parser.c b/subprojects/gst-plugins-bad/tests/examples/mpegts/ts-parser.c index c65059c19e..ebe555b44b 100644 --- a/subprojects/gst-plugins-bad/tests/examples/mpegts/ts-parser.c +++ b/subprojects/gst-plugins-bad/tests/examples/mpegts/ts-parser.c @@ -87,7 +87,11 @@ descriptor_name (GstMpegtsDescriptor * desc) gint val = desc->tag; /* Treat extended descriptors */ - if (val == 0x7f) { + if (val == 0x3f) { + en = g_enum_get_value (G_ENUM_CLASS (g_type_class_peek + (GST_TYPE_MPEGTS_EXTENDED_DESCRIPTOR_TYPE)), desc->tag_extension); + } + if (en == NULL && val == 0x7f) { en = g_enum_get_value (G_ENUM_CLASS (g_type_class_peek (GST_TYPE_MPEGTS_DVB_EXTENDED_DESCRIPTOR_TYPE)), desc->tag_extension);