From: Mathieu Duponchelle Date: Mon, 5 Apr 2021 22:26:50 +0000 (+0200) Subject: mpegtsbase: expose vmethod to let subclass handle sections X-Git-Tag: 1.19.3~467 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2718ed6cfb92a392778a02327a499ceba0b8f27;p=platform%2Fupstream%2Fgstreamer.git mpegtsbase: expose vmethod to let subclass handle sections This can be used by tsdemux to handle and forward SCTE 35 sections. Part-of: --- diff --git a/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c b/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c index cc567f0..1e48cbb 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c @@ -162,6 +162,7 @@ mpegts_base_class_init (MpegTSBaseClass * klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); klass->sink_query = GST_DEBUG_FUNCPTR (mpegts_base_default_sink_query); + klass->handle_psi = NULL; gst_type_mark_as_plugin_api (GST_TYPE_MPEGTS_BASE, 0); } @@ -1238,6 +1239,10 @@ mpegts_base_handle_psi (MpegTSBase * base, GstMpegtsSection * section) break; } + /* Give the subclass a chance to look at the section */ + if (GST_MPEGTS_BASE_GET_CLASS (base)->handle_psi) + GST_MPEGTS_BASE_GET_CLASS (base)->handle_psi (base, section); + /* Finally post message (if it wasn't corrupted) */ if (post_message) gst_element_post_message (GST_ELEMENT_CAST (base), diff --git a/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.h b/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.h index 6b24128..65144c0 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.h +++ b/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.h @@ -181,6 +181,7 @@ struct _MpegTSBaseClass { void (*inspect_packet) (MpegTSBase *base, MpegTSPacketizerPacket *packet); /* takes ownership of @event */ gboolean (*push_event) (MpegTSBase *base, GstEvent * event); + void (*handle_psi) (MpegTSBase *base, GstMpegtsSection * section); /* program_started gets called when program's pmt arrives for first time */ void (*program_started) (MpegTSBase *base, MpegTSBaseProgram *program);