Closed Wkkkkk closed 1 year ago
Hi @sdroege, wish you are doing well.
I'm writing to you in hope to get some help/advice about how to monitor connection-state
change in the WebRTC bin. This is necessary for a pipeline to remove a WebRTC bin when the client disconnects.
There are two problems:
connection-state
signal of webrtcbin element and handle the state changes in the callback. However, for elements like whipsink (which wraps a webrtcbin itself), this approach seems not to work.connection-state
of TransportSendbin
in GstWebRTCBin
becomes 'closed' (from 'connected'). However, the same property in GstWebRTCBin
is still 'connected', which can be observed in this figure. This seems to be a bit confusing and tricky to handle.Hope it does not bother you too much if I reach out like this. Any suggestion would be appreciated.
Based on the answer from Mathieu Duponchelle, as I quote here:
Hey, whipsink from webrtchttp has now been deprecated, you should use the whip element from net/webrtc (based on webrtcsink). There, you would access webrtcbin for a given consumer through the consumer-added signal, then connect to the relevant signal. As for your second question I am not sure, I think you would want to wait for at least 30 seconds for an ice timeout perhaps?
It is not recommended to use Whipsink and we shall replace it with WhipWebRTCSink instead so that we can monitor connections. As for disconnections, a periodical check on the state might be worth a try.
After replacing Whipsink with WhipWebRTCSink, this problem is solved. Therefore we close this issue.
When the user disconnects, we need to remove that branch from the pipeline (instead of solely relying on users sending DELETE). This can be observed from the
connection-state
change in the WebRTC bin.