summaryrefslogtreecommitdiff
path: root/ext/sctp
Commit message (Collapse)AuthorAgeFilesLines
* Use gst_buffer_new_memdup()Tim-Philipp Müller2021-05-241-1/+1
| | | | | | | | Update for function rename in core. https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/827 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2281>
* Use new gst_buffer_new_copy()Tim-Philipp Müller2021-05-231-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2279>
* sctp: Ensure pad is still a child of element before removalDoug Nazar2021-05-191-1/+4
| | | | | | | | | During pipeline shutdown there are several competing paths to remove pads. Avoids tests failing due to: Unexpected critical/warning: Padname '':sink_1 does not belong to element sctpenc1 when removing Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2256>
* sctp: Fix race of pad removal during reset/stopDoug Nazar2021-05-191-1/+4
| | | | | | | Both reset & stop remove existing pads. Can result in warning from gst_element_remove_pad(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2256>
* webrtcbin: Support closing of data channelsJohan Sternerup2021-05-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Support for closing WebRTC data channels as described in RFC 8831 (section 6.7) now fully supported. This means that we can now reuse data channels that have been closed properly. Previously, an application that created a lot of short-lived on-demand data channels would quickly exhaust resources held by lingering non-closed data channels. We now use a one-to-one style socket interface to SCTP just like the Google implementation (i.e. SOCK_STREAM instead of SOCK_SEQPACKET, see RFC 6458). For some reason the socket interface to use was made optional through a property "use-sock-stream" even though code wasn't written to handle the SOCK_SEQPACKET style. Specifically the SCTP_RESET_STREAMS command wouldn't work without passing the correct assocation id. Changing the default interface to use from SOCK_SEQPACKET to SOCK_STREAM now means we don't have to bother about the association id as there is only one association per socket. For the SCTP_RESET_STREAMS command we set it to SCTP_ALL_ASSOC just to match the Google implementation. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2186>
* sctp: allow per feature registrationStéphane Cerveau2021-03-235-5/+12
| | | | | | | | | | | | | Split plugin into features including dynamic types which can be indiviually registered during a static build. More details here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2038>
* gst: don't use volatile to mean atomicMatthew Waters2021-03-221-1/+1
| | | | | | | | | | | | volatile is not sufficient to provide atomic guarantees and real atomics should be used instead. GCC 11 has started warning about using volatile with atomic operations. https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2098>
* sctp: Do downward state change logic after chaining up.Jan Schmidt2020-10-312-5/+13
| | | | | | | | Call the parent state_change function first when changing state downward, to make sure that the element has stopped before cleaning it up. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1741>
* sctp: usrsctp: increase DIAG_MSG_LEN to accomodate longer file pathTim-Philipp Müller2020-08-261-1/+1
| | | | | | | | | | | Fixes "‘%s’ directive output truncated writing XX bytes into a region of size NN [-Wformat-truncation=]" compiler warnings. https://github.com/sctplab/usrsctp/pull/521 Fixes #1389 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1540>
* sctpdec: unref after retrieving the static pad templateMatthew Waters2020-08-241-0/+1
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1535>
* sctp: fix build with GST_DISABLE_GST_DEBUGSebastian Dröge2020-08-141-0/+6
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1465>
* sctp: hook up internal copy of libusrsctp to buildTim-Philipp Müller2020-08-143-104/+84
| | | | | | | | | Add option 'sctp-internal-usrsctp' so people can choose to build againts the distro version instead. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/870 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1465>
* sctp: import internal copy of usrsctp libraryTim-Philipp Müller2020-08-1469-0/+93497
| | | | | | | | | | | | | | There are problems with global shared state and no API stability guarantees, and we can't rely on distros shipping the fixes we need. Both firefox and Chrome bundle their own copies too. Imported from https://github.com/sctplab/usrsctp, commit 547d3b46c64876c0336b9eef297fda58dbe1adaf Date: Thu Jul 23 21:49:32 2020 +0200 Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/870 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1465>
* sctp: enable usrsctp debug when supportedMatthew Waters2020-05-051-1/+25
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1234>
* sctp: Take some socket configurations from Firefox's datachannel codeSebastian Dröge2020-02-121-5/+81
| | | | | | | | | | | | | - Do not send ABORTs for unexpected packets are as response to INIT - Enable interleaving of messages of different streams - Configure 1MB send and receive buffer for the socket - Enable SCTP_SEND_FAILED_EVENT and SCTP_PARTIAL_DELIVERY_EVENT events - Set SCTP_REUSE_PORT configuration - Set SCTP_EXPLICIT_EOR and the corresponding send flag. We probably want to split packets to a maximum size later and only set the flag on the last packet. Firefox uses 0x4000 as maximum size here. - Enable SCTP_ENABLE_CHANGE_ASSOC_REQ - Disable PMTUD and set an maximum initial MTU of 1200
* sctp: Start connection synchronously when starting the associationSebastian Dröge2020-02-122-30/+7
| | | | | | | | | | | | | | | | | 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.
* sctp: Switch back to a non-recursive mutex and don't hold it while calling ↵Sebastian Dröge2020-02-122-47/+49
| | | | | | | | 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.
* sctpassociation: Add missing return to prevent double unlockSebastian Dröge2020-01-311-0/+1
|
* sctpenc: Report errors when sending out data and the association is in error ↵Sebastian Dröge2020-01-313-16/+34
| | | | or disconnected state
* sctp: Clean up association state handling and go into error/disconnected ↵Sebastian Dröge2020-01-312-28/+46
| | | | state in more circumstances
* sctpassociation: Use GStreamer logging system instead of g_warning() and g_log()Sebastian Dröge2020-01-311-44/+53
|
* sctp: Add more logging to the encoder/decoder elements on data processingSebastian Dröge2020-01-312-2/+29
| | | | And convert g_warning()s into normal log output instead.
* sctpenc: Correctly log/handle errors and handle short writesSebastian Dröge2020-01-312-16/+34
|
* sctp: Constify buffers in callbacks and functionsSebastian Dröge2020-01-313-12/+23
| | | | | | 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().
* sctp: Make receive/packetout callbacks thread-safeSebastian Dröge2020-01-304-51/+54
|
* sctp: Add logging and missing cleanup on errors when creating padsSebastian Dröge2020-01-302-7/+21
|
* sctpenc: Use g_signal_emit() instead of g_signal_emit_by_name()Sebastian Dröge2020-01-301-1/+2
| | | | We have all the required information around so make use of it.
* sctpenc: Propagate downstream flow errors upstreamSebastian Dröge2020-01-302-1/+33
| | | | Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1180
* sctpdec: Use a flow combiner for the source pad flow returns and propagate ↵Sebastian Dröge2020-01-302-7/+62
| | | | | | errors upstream Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1180
* Don't pass default GLib marshallers for signalsNiels De Graef2019-11-063-5/+4
| | | | | | | | | | | | By passing NULL to `g_signal_new` instead of a marshaller, GLib will actually internally optimize the signal (if the marshaller is available in GLib itself) by also setting the valist marshaller. This makes the signal emission a bit more performant than the regular marshalling, which still needs to box into `GValue` and call libffi in case of a generic marshaller. Note that for custom marshallers, one would use `g_signal_set_va_marshaller()` with the valist marshaller instead.
* Remove autotools build systemTim-Philipp Müller2019-10-141-22/+0
|
* sctp: Fix crash on free() when using the MSVC binariesNirbheek Chauhan2019-08-201-1/+5
| | | | | | | | | | On Windows, if libusrsctp and gstreamer are built with different C runtimes (CRT), we cannot free memory allocated inside libusrsctp with the `free()` function from gstreamer's CRT. `usrsctp_freedumpbuffer()` simply calls `free()`, but because of the way DLLs work on Windows, it will always call the free function from the correct CRT.
* meson: add more plugins to plugins listTim-Philipp Müller2019-05-301-0/+1
| | | | | Makes sure their path gets added to the uninstalled environment and makes sure they get included in the docs.
* sctp: increase DEFAULT_NUMBER_OF_SCTP_STREAMS to 1024Fabio D'Urso2019-04-261-1/+1
| | | | | | | This change makes it possible to create more than just 5 webrtc data channels. The maximum number of data channels is exactly DEFAULT_NUMBER_OF_SCTP_STREAMS / 2, therefore the limit is now 512.
* sctp: Create plugin with $(GST_PLUGIN_LDFLAGS)Sebastian Dröge2019-04-121-0/+1
| | | | | Otherwise we don't create a plugin but a proper shared library with version information, i.e. libgstsctp.so.0.0.0.
* sctp: link against ws2_32 on windowsMatthew Waters2018-10-171-1/+6
| | | | | ext/sctp/ext@sctp@@gstsctp@sha/sctpassociation.c.obj: In function `receive_cb': /var/lib/jenkins/workspace/cerbero-cross-mingw32/workdir/sources/windows_x86/gst-plugins-bad-1.0-1.15.0.1/_builddir/../ext/sctp/sctpassociation.c:692: undefined reference to `_imp__ntohl@4'
* sctp elements: avoid assertions on shutdownMathieu Duponchelle2018-09-212-3/+6
|
* sctpassociation: don't join a NULL threadMatthew Waters2018-09-211-1/+2
| | | | | Can occur if no connection is actually made and thus no connection thread is created.
* sctpenc: don't require caps when requesting the padMatthew Waters2018-09-211-4/+8
| | | | They can be set later
* sctpenc: start pad task after the parent has activated padsMatthew Waters2018-09-211-6/+17
| | | | | | Fixes a race where the task could attempt to set stream-start/caps/segment before the pad was active and would be dropped resulting in a 'data-flow before stream-start' warning.
* Update sctp plugin for the current build systemMatthew Waters2018-09-211-0/+31
| | | | | - Add meson build definitions - Add necessary API decorators
* Add new SCTP plugins (sctpenc/sctpdec)George Kiagiadakis2018-09-218-0/+2768
https://bugzilla.gnome.org/show_bug.cgi?id=744863