Commit graph

6 commits

Author SHA1 Message Date
Sebastian Dröge
c497370254 sctp: Start connection synchronously when starting the association
Calling bind() only sets up some data structures and calling connect()
only produces one packet before it returns. That packet is stored in a
queue that is asynchronously forwarded by the encoder's source pad loop,
so not much is happening there either. Especially no waiting is
happening here and no forwarding of data to other elements.

This fixes a race condition during connection setup: the connection
would immediately fail if we pass a packet from the peer to the socket
before bind() and connect() have returned.

This can't happen anymore as bind() and connect() have returned already
before both elements reach the PAUSED state, and in webrtcbin there is
an additional blocking pad probe before the decoder that does not let
any data pass through before that anyway.
2020-02-12 16:11:15 +00:00
Sebastian Dröge
4c5c6e68c6 sctp: Switch back to a non-recursive mutex and don't hold it while calling any usrsctp functions
The library is thread-safe by itself and potentially calls back into our
code, not only from the same thread but also from other threads. This
can easily lead to deadlocks if we try to hold our mutex on both sides.
2020-02-12 16:11:15 +00:00
Sebastian Dröge
e6c6b5ea29 sctpenc: Report errors when sending out data and the association is in error or disconnected state 2020-01-31 08:55:10 +02:00
Sebastian Dröge
e9df80b235 sctp: Constify buffers in callbacks and functions
And free data with the correct free() function in the receive callback
by passing it to gst_buffer_new_wrapped_full() instead of
gst_buffer_new_wrapped().
2020-01-31 08:54:49 +02:00
Sebastian Dröge
fa0a233fa7 sctp: Make receive/packetout callbacks thread-safe 2020-01-30 16:07:48 +02:00
George Kiagiadakis
e2f06326ea Add new SCTP plugins (sctpenc/sctpdec)
https://bugzilla.gnome.org/show_bug.cgi?id=744863
2018-09-21 19:36:52 +10:00