Merge branch 'proxy-reuse' into 'main'

proxy: Allow to reuse proxysrc with a different proxysink

See merge request gstreamer/gstreamer!6164
This commit is contained in:
Yury Shatz 2024-05-14 23:19:18 +00:00
commit 6decb25eaa
2 changed files with 12 additions and 0 deletions

View file

@ -385,4 +385,11 @@ gst_proxy_sink_set_proxysrc (GstProxySink * self, GstProxySrc * src)
{
g_return_if_fail (self);
g_weak_ref_set (&self->proxysrc, src);
if (src) {
GstPad *srcpad = gst_proxy_src_get_internal_srcpad (src);
gst_pad_send_event (srcpad, gst_event_new_flush_stop (TRUE));
gst_object_unref (srcpad);
self->pending_sticky_events = TRUE;
}
}

View file

@ -151,9 +151,14 @@ gst_proxy_src_set_property (GObject * object, guint prop_id,
}
g_weak_ref_set (&self->proxysink, NULL);
} else {
GstPad *sinkpad;
/* Set proxysrc property on the new proxysink to point to us */
gst_proxy_sink_set_proxysrc (sink, self);
g_weak_ref_set (&self->proxysink, sink);
/* tell sink to stop flushing, allow it to reconnect to new source */
sinkpad = gst_element_get_static_pad (self->queue, "sink");
gst_pad_send_event (sinkpad, gst_event_new_flush_stop (TRUE));
g_object_unref (sinkpad);
g_object_unref (sink);
}
break;