mpegtsbase: expose vmethod to let subclass handle sections

This can be used by tsdemux to handle and forward SCTE 35
sections.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
This commit is contained in:
Mathieu Duponchelle 2021-04-06 00:26:50 +02:00 committed by GStreamer Marge Bot
parent a03c395582
commit b2718ed6cf
2 changed files with 6 additions and 0 deletions

View file

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

View file

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