From fb406b7a568e388698341b3758fda88f77ab5f57 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 17 Jul 2023 15:56:37 +0530 Subject: [PATCH] webrtcrenego: Port to updated mechanism for doing renegotiation Sending an EOS event is actually really bad because rtpbin doesn't handle that very well. It was only being used as a way to notify webrtcbin to check if re-negotiation is needed. We don't need that anymore, since changing the direction is enough to notify webrtcbin to check for re-negotiation. Part-of: --- .../gst-plugins-bad/tests/examples/webrtc/webrtcrenego.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/tests/examples/webrtc/webrtcrenego.c b/subprojects/gst-plugins-bad/tests/examples/webrtc/webrtcrenego.c index 115f3513f6..d42f008636 100644 --- a/subprojects/gst-plugins-bad/tests/examples/webrtc/webrtcrenego.c +++ b/subprojects/gst-plugins-bad/tests/examples/webrtc/webrtcrenego.c @@ -218,9 +218,12 @@ stream_change (gpointer data) g_print ("Removing extra stream\n"); pad = gst_element_get_static_pad (extra_src, "src"); peer = gst_pad_get_peer (pad); - gst_element_send_event (extra_src, gst_event_new_eos ()); g_object_get (peer, "transceiver", &transceiver, NULL); + /* Instead of removing the source, you can add a pad probe to block data + * flow, and you can set this to SENDONLY later to switch this track from + * inactive to sendonly, but this only works with non-gstreamer receivers + * at present. */ g_object_set (transceiver, "direction", GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE, NULL);