Commit graph

6740 commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig) 132e3a1af9
srt: Remove use of closures for signal emission
It seems overly complicated.
2020-04-15 10:42:47 +02:00
Jan Alexander Steffens (heftig) d2d00e07ac
srt: Clean up locking
Use GST_OBJECT_LOCK (srtobject->element) to protect only the fields
involved in property access.

Introduce a new mutex srtobject->sock_lock to go with
srtobject->sock_cond and protect the list of callers from concurrent
access.
2020-04-15 10:42:47 +02:00
Jan Alexander Steffens (heftig) 37ee389913
srt: Remove trailing whitespace 2020-04-15 10:42:47 +02:00
Philippe Normand 991bcb22d5 wpe: Add support for SHM without requiring EGLDisplay
The previous version of the SHM export support still required a valid
EGLDisplay. The upcoming WPEBackend-FDO 1.8.x aims to remove this requirement,
hence allowing wpesrc to be used without GPU.
2020-04-13 11:53:16 +00:00
J. Kim 04f3f4be4f srtobject: fix mutex lock target
GstSRTObject is a structure that has an actual GstElement
which is extended to srt{src,sink}.
2020-04-13 15:23:46 +09:00
Zeid Bekli 663cd44ef0 srtp: Added support for BYE packet
SRTCP can't get SSRC from BYE packet, this will make srtpdec element
to drop the package. Adding support to get the SSRC from BYE packets.
2020-04-09 15:11:19 +00:00
Stéphane Cerveau d59bd5f674 dash: fix VARARGS coverity error
va_end was not called in every code path due to
g_return_val_if_fail.

API usage errors  (VARARGS)
va_end was not called for "myargs".

CID: 1461294
2020-04-08 20:02:57 +00:00
worldofpeace f10b424418 meson: build with neon 0.31
No API/ABI changes https://github.com/notroj/neon/blob/0.31.0/NEWS#L3
2020-04-03 18:50:16 -04:00
Nirbheek Chauhan 387b6df948 meson: Don't use get_option('buildtype')
We should directly check the values of the `debug` and `optimization`
options instead.

`get_option('buildtype')` will return `'custom'` for most combinations
of `-Doptimization` and `-Ddebug`, but those two will always be set
correctly if only `-Dbuildtype` is set. So we should look at those
options directly.

For the two-way mapping between `buildtype` and `optimization`
+ `debug`, see this table:
https://mesonbuild.com/Builtin-options.html#build-type-options
2020-04-03 17:07:47 +05:30
Miguel Paris 45a1070203 srtpdec: reduce log level for replay cases
These are normal cases, so DEBUG level is enough.
2020-04-01 17:45:15 +00:00
Miguel París Díaz ed71e262b0 srtpdec: do not warning old replay errors
Reordered packets producing decrypting errors are very normal,
so we should filter which errors are warning and which not.
2020-04-01 17:45:15 +00:00
Miguel Paris 075ff1e8b0 srtpdec: fix reseting RTP sequence number on ROC changes
Each srtp_stream_t is tied to an specific SSRC, so a
roc_changed flag should be kept per each SSRC in order to
properly reset RTP sequence number on ROC changes.
2020-04-01 16:49:44 +02:00
Seungha Yang 770a851e03 x265enc: Update for video-hdr struct change
See the change of -base https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/594
2020-04-01 05:18:11 +00:00
Matthew Waters 8da177c0bf dtls/connection: fix EOF handling with openssl 1.1.1e
openssl 1.1.1e does some stricker EOF handling and will throw an error
if the EOF is unexpected (like in the middle of a record).  As we are
streaming data into openssl here, it is entirely possible that we push
data from multiple buffers/packets into openssl separately.

From the openssl changelog:

 Changes between 1.1.1d and 1.1.1e [17 Mar 2020]
  *) Properly detect EOF while reading in libssl. Previously if we hit an EOF
     while reading in libssl then we would report an error back to the
     application (SSL_ERROR_SYSCALL) but errno would be 0. We now add
     an error to the stack (which means we instead return SSL_ERROR_SSL) and
     therefore give a hint as to what went wrong.
     [Matt Caswell]

We can relax the EOF signalling to only return TRUE when we have stopped
for any reason (EOS, error).

Will also remove a spurious EOF error from previous openssl version.
2020-03-27 11:43:53 +11:00
Matthew Waters 319a5e5779 webrtc: mark streams as active on renegotiation as well.
Otherwise when bundling, only the changed streams would be considered as
to whether the bundled transport needs to be blocked as all streams are
inactive.

Scenario is one transceiver changes direction to inactive and as that is
the only change in transciever direction, the entire bundled transport would
be blocked even if there are other active transceivers inside the same bundled
transport that are still active.

Fix by always checking the activeness of a stream regardless of if the
transceiverr has changed direction.
2020-03-25 14:46:15 +11:00
Philippe Normand 26f76dd927 wpe: Enable SHM support for new stable WPEBackend-FDO release
1.5.0 was the development version.
2020-03-23 13:08:46 +00:00
Philippe Normand 49560b4ba8 wpe: Mouse scroll events support 2020-03-23 13:08:46 +00:00
Philippe Normand 158a2b3fd1 webrtcdsp: Fix documentation markup 2020-03-15 12:44:31 +00:00
Philippe Normand b36e36f74a openni2: Remove spurious gtk-doc markers 2020-03-15 10:47:02 +00:00
yychao cb0e4bffea smoothstreaming: fix H264 CodecPrivateData parsing
Do not pass SPS nal_unit_type (0x67) into gst_h264_parse_sps()

Fixes #648
2020-03-10 12:55:05 +00:00
Sebastian Dröge 5a2053e0af webrtcbin: Use GPtrArrays or store items inline instead of using GArrays of pointers 2020-03-09 21:38:42 +02:00
Jan Schmidt 8274fcd311 webrtcbin: Prevent ICE gathering state reaching complete early
The ICE gathering state can transition to complete prematurely if the
underlying ICE components complete their gathering while the initial
ICE gathering state task is queued and still pending.

In that situation, the ice gathering state task will report complete
while there are still ICE candidates queued for emission.

Prevent that by storing ICE candidates in an array and checking if
there are any pending before reporting a completed ICE gathering
state.
2020-03-10 05:47:40 +11:00
Jan Schmidt 9410ef56b8 webrtc: Protect the pending ICE candidates array
ICE candidates can be added to the array directly from the application
or from the webrtc main loop. Rename it to make it clear that it's
holding remote ICE candidates from the peer, and protect it with a
new mutex
2020-03-10 05:25:40 +11:00
Jan Schmidt ad53de1da1 webrtc: Don't crash in ICE gathering
Fix a crash collating ICE gathering states if there are
unassociated transceivers in the list with no TransportStream
2020-03-04 23:06:52 +00:00
Jan Schmidt 905988c63f webrtc: Unblock transportreceivebin for send-only bundled streams
If there is any active mline in a bundle, we need to unblock
the transportreceivebin for DTLS setup and RTCP reception,
otherwise no data can ever start flowing.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1206
2020-03-04 10:15:19 +00:00
Jan Schmidt cb48733ff3 webrtc: Remove RECEIVE_STATE_DROP from transportreceivebin
As per discussion in the bug, remove the drop state from transportreceivebin.
Dropping data is necessary, but for bundled config, needs to happen
further downstream after mixed flows have been separated.

Also support switching back to BLOCK from PASS state.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1206
2020-03-04 10:15:19 +00:00
Matthew Waters 0f1ba5b2f2 dash: add build-dep on pbutils
Fixes dependency issues:

FAILED: subprojects/gst-plugins-bad/ext/dash/8bd0b95@@gstdash@sha/gstdashsink.c.obj
cl @subprojects/gst-plugins-bad/ext/dash/8bd0b95@@gstdash@sha/gstdashsink.c.obj.rsp
C:\builds\ystreet\gst-plugins-base\gst-build\subprojects\gst-plugins-base\gst-libs\gst/pbutils/pbutils.h(30): fatal error C1083: Cannot open include file: 'gst/pbutils/pbutils-enumtypes.h': No such file or directory
2020-03-03 06:34:40 +00:00
Matthew Waters d66743e482 vulkan/sink: implement GstNavigation support 2020-03-03 05:00:50 +00:00
Jan Schmidt 8e3472faee webrtc: Use the dtlssrtenc rtp-sync property
Instead of synchronising at the ICE transport, do clock sync for the
RTP stream at the DTLS transport via the dtlssrtpenc rtp-sync
property. This avoids delaying RTCP while waiting until it is time
to output an RTP packet when rtcp-mux is enabled.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1212
2020-02-27 12:30:32 +00:00
Jan Schmidt 0c72a41767 gstdtlsrtpenc: Add rtp-sync property
Add an rtp-sync property which synchronises RTP streams
to the pipeline clock before passing them to funnel for
merging with RTCP.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1212
2020-02-27 12:30:32 +00:00
Nirbheek Chauhan a06ddd182d dash: Don't use sscanf + glib format modifiers
We do not have a way to know the format modifiers to use with string
functions provided by the system. `G_GUINT64_FORMAT` and other string
modifiers only work for glib string formatting functions. We cannot
use them for string functions provided by the stdlib. See:
https://developer.gnome.org/glib/stable/glib-Basic-Types.html#glib-Basic-Types.description

F.ex.
```
 ../ext/dash/gstxmlhelper.c: In function 'gst_xml_helper_get_prop_unsigned_integer_64':
../ext/dash/gstxmlhelper.c:473:40: error: unknown conversion type character 'l' in format [-Werror=format=]
     if (sscanf ((gchar *) prop_string, "%" G_GUINT64_FORMAT,
                                        ^~~
In file included from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86/include/glib-2.0/glib/gtypes.h:32,
                 from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86/include/glib-2.0/glib/galloca.h:32,
                 from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86/include/glib-2.0/glib.h:30,
                 from /builds/nirbheek/cerbero/cerbero-build/dist/windows_x86/include/gstreamer-1.0/gst/gst.h:27,
                 from ../ext/dash/gstxmlhelper.h:26,
                 from ../ext/dash/gstxmlhelper.c:22:
/builds/nirbheek/cerbero/cerbero-build/dist/windows_x86/lib/glib-2.0/include/glibconfig.h:69:28: note: format string is defined here
 #define G_GUINT64_FORMAT "llu"
                            ^
../ext/dash/gstxmlhelper.c:473:40: error: too many arguments for format [-Werror=format-extra-args]
     if (sscanf ((gchar *) prop_string, "%" G_GUINT64_FORMAT,
                                        ^~~
```

In the process, we're also following the DASH MPD spec more closely
now, which specifies that ranges must follow RFC 2616 section 14.35.1:
https://tools.ietf.org/html/rfc2616#page-138
2020-02-27 09:42:33 +00:00
Sebastian Dröge cc8b90967b dtls: Set a random serial number and issuer/subject in the self-signed certificates
This is also what Chrome and Firefox are doing, citing privacy concerns.
Also putting OpenWebRTC from Sweden as issuer/subject is rather
confusing.
2020-02-27 08:27:19 +00:00
Jan Schmidt 499be261cd webrtc: Configure transportsendbin latency internally
Add latency configuration logic to transportsendbin to
isolate it from the overall pipeline latency. That means that
it configures minimum latency internally based on the
latency query, and sends a latency event upstream that
matches.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1209
2020-02-21 13:42:05 +11:00
Jan Schmidt 96a407334d webrtc: Merge ICE candidates to local descriptions
When emitting ICE candidates, also merge them to the local and
pending description so they show up in the SDP if those are
retrieved from the current-local-description and
pending-local-description properties.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/676
2020-02-17 14:23:56 +00:00
Sebastian Dröge f156ee1da4 webrtcbin: Block the source pads before dtlssrtpdec inside transportreceivebin
Otherwise dropped sticky events are not actually re-sent on the next
opportunity and we can end up with data-flow before stream-start/segment
events.
2020-02-12 16:54:42 +00:00
Sebastian Dröge 26a6b17593 sctp: Take some socket configurations from Firefox's datachannel code
- 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
2020-02-12 16:11:15 +00:00
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
Philippe Normand 9ac798ae5e wpe: Add software rendering support support
Starting from WPEBackend-FDO 1.6.x, software rendering support is available.
This features allows wpesrc to be used on machines without GPU, and/or for
testing purpose. To enable it, set the `LIBGL_ALWAYS_SOFTWARE=true` environment
variable and make sure `video/x-raw, format=BGRA` caps are negotiated by the
wpesrc element.
2020-02-11 16:47:53 +00:00
Jan Alexander Steffens (heftig) e2cefdd6ff fluiddec: Move logging init into plugin_init
This is a nicer place to keep it. We also initialize it before touching
the drivers.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/1026
2020-02-11 12:10:50 +00:00
Jan Alexander Steffens (heftig) 9aa12399a8 fluiddec: Keep fluidsynth from probing audio drivers
It might cause problems and we don't need the drivers anyway. This also
avoids a bunch of stderr spam from the drivers.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/1026
2020-02-11 12:10:50 +00:00
Jan Alexander Steffens (heftig) c35e80dc0e fluiddec: Avoid deprecated fluid_synth_set_sample_rate
This function is used to change the rate at runtime, which has issues:
https://github.com/FluidSynth/fluidsynth/issues/585

Use the settings key instead (which already defaults to 44100, but I did
test other rates).

https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/merge_requests/1026
2020-02-11 12:10:50 +00:00
Sebastian Dröge 4ffa6350e8 webrtc: In all blocking pad probes except for sink pads also handle serialized events
Otherwise it can happen that e.g. the stream-start event is tried to be
sent as part of pushing the first buffer. Downstream might not be in
PAUSED/PLAYING yet, so the event is rejected with GST_FLOW_FLUSHING and
because it's an event would not cause the blocking pad probe to trigger
first. This would then return GST_FLOW_FLUSHING for the buffer and shut
down all of upstream.

To solve this we return GST_PAD_PROBE_DROP for all events. In case of
sticky events they would be resent again later once we unblocked after
blocking on the buffer and everything works fine.

Don't handle events specifically in sink pad blocking pad probes as here
downstream is not linked yet and we are actually waiting for the
following CAPS event before unblocking can happen.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1172
2020-02-11 00:49:51 +00:00
Sebastian Dröge c16d4d2c33 webrtcbin: Add a blocking pad probe for the receivebin -> sctpdec connection
Without this it might happen that received data from the DTLS transport
is already passed to sctpdec before its state was set to PLAYING. This
would cause the data to be dropped, GST_FLOW_FLUSHING to be returned and
the whole DTLS transport to shut down.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1172
among other things.
2020-02-11 00:49:51 +00:00
Sebastian Dröge f8fa71da27 webrtcbin/transportreceivebin: Use actual pad blocks instead of an additional GCond for blocking pads
Using a GCond can easily lead to deadlocks and only duplicates the
waiting code from gstpad.c in the best case.

In this case it actually could lead to a deadlock if both RTP and RTCP
were waiting. Only one of them would be woken up because g_cond_signal()
was used instead of g_cond_broadcast().
2020-02-11 00:49:51 +00:00
Sebastian Dröge 1ecb27f221 webrtc/transportsendbin: Clean up pad probe removal
We already have a helper function for this so just use it instead of
duplicating it.
2020-02-11 00:49:51 +00:00
Ederson de Souza 916966606b avtp: Build with clang
Minor non-conformity on AVTP code made it not compile with clang.
2020-02-07 21:53:57 +00:00
Ederson de Souza f1976e0de5 avtp: Plug several leaks
After finally running tests with valgrind enabled, some leaks were found
- both on code and on tests themselves. This patch plugs them all!
2020-02-07 21:53:57 +00:00
Ludvig Rappe 2d585f2b0b gstcurlhttpsink: Update HTTP header for curl 7.66
Change how content-length is set for HTTP POST headers, letting curl set
the header (given the content-length) instead of manually writing it.
This enables curl to know the content-length of the data.
In curl 7.66, if curl does not know the content-length (e.g. when
manually writing the header) curl will use Transfer-Encoding: chunked,
which might not be desired.
2020-02-07 13:24:53 +00:00
Tim-Philipp Müller dbb0e71e70 ladspa: only multiply bounded rate properties by sample rate
We don't want to accidentally multiply G_MAXFLOAT or -GMAXFLOAT
with the sample rate.
2020-02-06 10:15:12 +00:00