webrtcbin: dtls close not firing connection-state signal
I'm doing some testing with a webrtcbin pipeline and have encountered an issue where the connection-state
signal does not get fired when the underlying DTLS connection is closed. Possibly related to #758 (closed). I am using a single sendonly
VP8 video stream from webrtcbin
to Chrome.
"webrtcbin bundle-policy=max-bundle name=sendonly "
"videotestsrc is-live=true pattern=ball ! videoconvert ! queue ! vp8enc deadline=1 ! rtpvp8pay ! "
"queue ! application/x-rtp,media=video,encoding-name=VP8,payload=96 ! sendonly. "
The code I use to hook up the signals is:
g_signal_connect (webrtcbin, "on-negotiation-needed", G_CALLBACK (on_negotiation_needed), NULL);
g_signal_connect (webrtcbin, "on-ice-candidate", G_CALLBACK (send_ice_candidate_message), NULL);
g_signal_connect (webrtcbin, "on-new-transceiver", G_CALLBACK (on_new_transceiver), NULL);
g_signal_connect (webrtcbin, "notify::on-new-transceiver", G_CALLBACK (on_new_transceiver), NULL);
g_signal_connect (webrtcbin, "notify::ice-gathering-state", G_CALLBACK (on_ice_gathering_state_notify), NULL);
g_signal_connect (webrtcbin, "notify::ice-connection-state", G_CALLBACK (on_ice_connection_state_notify), NULL);
g_signal_connect (webrtcbin, "notify::connection-state", G_CALLBACK (on_connection_state_notify), NULL);
And then we I connect to my application using Chrome the abbreviated output is:
set_offer.
on_offer_set.
create-answer promise wait over.
on_answer_created.
on_connection_state_notify '2'.
on_ice_gathering_state_notify '1'.
on_ice_connection_state_notify '3'.
on_ice_gathering_state_notify '2'.
on_negotiation_needed
The name of the element is 'sendonly'.
The signaling state of the element is '0'.
Remote description is set.
Closing the connection in Chrome does NOT fire any signal that I have been able to detect.
If I add in some debug logging with GST_DEBUG=2,dtls*:7
I can see the DTLS connection close being detected. But after that the webrtcbin
pipeline is not closed and continues to send packets to Chrome.
0:00:36.928521700 9 0x7f3470001980 LOG dtlssrtpdemux gstdtlssrtpdemux.c:123:sink_chain:<dtlssrtpdemux0> pushing dtls packet
0:00:36.928840100 9 0x7f3470001980 DEBUG dtlsdec gstdtlsdec.c:610:sink_chain:<dtlsdec0> received buffer from rtp_0_1231155112 with length 31
0:00:36.929062100 9 0x7f3470001980 TRACE dtlsconnection gstdtlsconnection.c:618:gst_dtls_connection_process:<GstDtlsConnection@0x7f3470009c50> locking @ process
0:00:36.929237600 9 0x7f3470001980 TRACE dtlsconnection gstdtlsconnection.c:620:gst_dtls_connection_process:<GstDtlsConnection@0x7f3470009c50> locked @ process
0:00:36.929438600 9 0x7f3470001980 LOG dtlsconnection gstdtlsconnection.c:844:log_state:<GstDtlsConnection@0x7f3470009c50> process start: role=client buf=(0x7f346c237210:0/31) 1000001|1 SSL negotiation finished successfully
0:00:36.929646900 9 0x7f3470001980 DEBUG dtlsconnection gstdtlsconnection.c:1222:bio_method_read:<GstDtlsConnection@0x7f3470009c50> reading 31/31 bytes 31 at offset 0, output buff size is 16717
0:00:36.929888000 9 0x7f3470001980 DEBUG dtlsconnection gstdtlsconnection.c:667:gst_dtls_connection_process:<GstDtlsConnection@0x7f3470009c50> read result: 0
0:00:36.930132300 9 0x7f3470001980 LOG dtlsconnection gstdtlsconnection.c:997:handle_error:<GstDtlsConnection@0x7f3470009c50> Connection was closed
0:00:36.930509700 9 0x7f3470001980 DEBUG dtlsdec gstdtlsdec.c:499:process_buffer:<dtlsdec0> Peer closed the connection