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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5045>
This commit is contained in:
Nirbheek Chauhan 2023-07-17 15:56:37 +05:30 committed by GStreamer Marge Bot
parent 6af8b3dd80
commit fb406b7a56

View file

@ -218,9 +218,12 @@ stream_change (gpointer data)
g_print ("Removing extra stream\n"); g_print ("Removing extra stream\n");
pad = gst_element_get_static_pad (extra_src, "src"); pad = gst_element_get_static_pad (extra_src, "src");
peer = gst_pad_get_peer (pad); peer = gst_pad_get_peer (pad);
gst_element_send_event (extra_src, gst_event_new_eos ());
g_object_get (peer, "transceiver", &transceiver, NULL); 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", g_object_set (transceiver, "direction",
GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE, NULL); GST_WEBRTC_RTP_TRANSCEIVER_DIRECTION_INACTIVE, NULL);