From a03c3955822814f159c0367580dae2da567d2356 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Tue, 6 Apr 2021 00:23:09 +0200 Subject: [PATCH] mpegtssection: expose event constructor This allows the demuxer to forward sections of interest downstream, for example SCTE 35 splice information. These can then be reinjected appropriately by a muxer for example. Part-of: --- .../gst-libs/gst/mpegts/gstmpegtssection.c | 11 ++++++++--- .../gst-libs/gst/mpegts/gstmpegtssection.h | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c index cb15d2013f..04e85bce45 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c @@ -99,6 +99,7 @@ static GQuark QUARK_SDT; static GQuark QUARK_EIT; static GQuark QUARK_TDT; static GQuark QUARK_TOT; +static GQuark QUARK_SCTE_SIT; static GQuark QUARK_SECTION; static GType _gst_mpegts_section_type = 0; @@ -318,6 +319,9 @@ _mpegts_section_get_structure (GstMpegtsSection * section) case GST_MPEGTS_SECTION_TOT: quark = QUARK_TOT; break; + case GST_MPEGTS_SECTION_SCTE_SIT: + quark = QUARK_SCTE_SIT; + break; default: GST_DEBUG ("Creating structure for unknown GstMpegtsSection"); quark = QUARK_SECTION; @@ -353,8 +357,8 @@ gst_message_new_mpegts_section (GstObject * parent, GstMpegtsSection * section) return msg; } -static GstEvent * -_mpegts_section_get_event (GstMpegtsSection * section) +GstEvent * +gst_event_new_mpegts_section (GstMpegtsSection * section) { GstStructure *structure; GstEvent *event; @@ -411,7 +415,7 @@ gst_mpegts_section_send_event (GstMpegtsSection * section, GstElement * element) g_return_val_if_fail (section != NULL, FALSE); g_return_val_if_fail (element != NULL, FALSE); - event = _mpegts_section_get_event (section); + event = gst_event_new_mpegts_section (section); if (!gst_element_send_event (element, event)) { gst_event_unref (event); @@ -1329,5 +1333,6 @@ __initialize_sections (void) QUARK_EIT = g_quark_from_string ("eit"); QUARK_TDT = g_quark_from_string ("tdt"); QUARK_TOT = g_quark_from_string ("tot"); + QUARK_SCTE_SIT = g_quark_from_string ("scte-sit"); QUARK_SECTION = g_quark_from_string ("section"); } diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.h b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.h index 18f0e7ffba..b40c84f13b 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.h @@ -483,6 +483,9 @@ GPtrArray *gst_mpegts_section_get_tsdt (GstMpegtsSection *section); GST_MPEGTS_API GstMessage *gst_message_new_mpegts_section (GstObject *parent, GstMpegtsSection *section); +GST_MPEGTS_API +GstEvent *gst_event_new_mpegts_section (GstMpegtsSection * section); + GST_MPEGTS_API gboolean gst_mpegts_section_send_event (GstMpegtsSection * section, GstElement * element);