Skip to content

examples: webrtc: mp-sendrecv: fixes to have proper pipeline cleanup

Sam Van Den Berge requested to merge sam.van.den.berge/gstreamer:main into main

With these commits, webrtcbin elements are now properly cleaned up when a peer has left.

This is the output I see in the trace log when I run the command GST_DEBUG_FILE=./trace GST_DEBUG_NO_COLOR=1 GST_TRACERS="leaks(filters=GstWebRTCBin)" GST_LEAKS_TRACER_SIG=1 GST_DEBUG=1,GST_TRACER:7 ./mp-webrtc-sendrecv --server=wss://localhost:8443 --room-id=123:

0:00:12.975138264 56247 0x559bbb56af00 TRACE             GST_TRACER :0:: object-added, type-name=(string)GstWebRTCBin, address=(gpointer)0x559bbbe80110;
0:00:15.108042869 56247 0x559bbb56af00 TRACE             GST_TRACER :0:: object-removed, type-name=(string)GstWebRTCBin, address=(gpointer)0x559bbbe80110;
0:00:16.834741366 56247 0x559bbb56af00 TRACE             GST_TRACER :0:: object-added, type-name=(string)GstWebRTCBin, address=(gpointer)0x559bbbe803f0;
0:00:19.069071226 56247 0x559bbb56af00 TRACE             GST_TRACER :0:: object-removed, type-name=(string)GstWebRTCBin, address=(gpointer)0x559bbbe803f0;
0:00:20.489314179 56247 0x559bbb56af00 TRACE             GST_TRACER :0:: object-added, type-name=(string)GstWebRTCBin, address=(gpointer)0x559bbbe806d0;
0:00:22.317300779 56247 0x559bbb56af00 TRACE             GST_TRACER :0:: object-removed, type-name=(string)GstWebRTCBin, address=(gpointer)0x559bbbe806d0;
0:00:23.230723369 56247 0x559bbb56af00 TRACE             GST_TRACER :0:: object-added, type-name=(string)GstWebRTCBin, address=(gpointer)0x559bbbe809b0;
0:00:24.755017272 56247 0x559bbb56af00 TRACE             GST_TRACER :0:: object-removed, type-name=(string)GstWebRTCBin, address=(gpointer)0x559bbbe809b0;

Note: in another terminal I used while true; do kill -s SIGUSR2 $GSTPID; sleep 0.1; done to make the tracer print created/removed objects.

Any feedback welcome :)

Edited by Sam Van Den Berge

Merge request reports