From 4099fd064b70b8de5f9bb74dd479c5e9afafe9bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 14 Nov 2022 19:10:05 +0200 Subject: [PATCH] rtspsrc: Intercept and handle events when using no manager too Part-of: --- subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c b/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c index 75103f8..b3fd986 100644 --- a/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c +++ b/subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c @@ -4931,6 +4931,8 @@ gst_rtspsrc_stream_configure_transport (GstRTSPStream * stream, add_backchannel_fakesink (src, stream, outpad); gst_object_unref (outpad); } else if (outpad) { + GstPad *internal_src; + GST_DEBUG_OBJECT (src, "creating ghostpad for stream %p", stream); gst_pad_use_fixed_caps (outpad); @@ -4945,6 +4947,17 @@ gst_rtspsrc_stream_configure_transport (GstRTSPStream * stream, gst_object_unref (template); g_free (name); + /* We intercept and modify the stream start event */ + internal_src = + GST_PAD (gst_proxy_pad_get_internal (GST_PROXY_PAD (stream->srcpad))); + gst_pad_set_element_private (internal_src, stream); + gst_pad_set_event_function (internal_src, + gst_rtspsrc_handle_src_sink_event); + gst_object_unref (internal_src); + + gst_pad_set_event_function (stream->srcpad, gst_rtspsrc_handle_src_event); + gst_pad_set_query_function (stream->srcpad, gst_rtspsrc_handle_src_query); + gst_object_unref (outpad); } /* mark pad as ok */ -- 2.7.4