Olivier Crête
d67dcb2227
webrtcbin: Simplify answer_caps intersection code a little
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
12ab469ad3
webrtcbin: Move GstPromise reply to operation framework
...
This makes it possible to reply to all promises in a consistent way
without having to do a unlock/relock that is always risky.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
38ef12063d
webrtcbin: Make sure PC_LOCK is release when replying to promise
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
913383166b
webrtcbin: Take PC lock around all entry points
...
All of those action signals change the internal state, so
protect it by using the PC_LOCK
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
572c2b6783
webrtcbin: Take PC_LOCK when requesting new pad
...
This is needed to avoid having the state change under us.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
c7107fd940
webrtcbin: Ensure that query caps method returns valid caps
...
This means rejecting any caps that aren't fixed. Also, use a filter
that will create unfixed caps if the other side just returns ANY.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
09c65fe534
webrtcbin: Associate the stream with a new transceiver
...
Otherwise, this newly created transceiver has no stream and it
aborts later when it tries to connect the input pad.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
83e546f935
webrtcbin: Match unassociated transceiver by kind too
...
When a new m-line comes in that doesn't have a transceiver, only match
existing transceivers of the same kind.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
7db5848376
webrtcbin: Fix typoe in name of error GstStructure
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
7f29486ba4
webrtcbin: Enforce direction on request sink pad with a specific name
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
5971a96109
webrtcbin: Try to match an existing transceiver on pad request
...
This should avoid creating extra transceivers that are duplicated.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
2ca4cea538
webrtcbin: Validate locked m-lines in set*Description
...
Verify that the remote description match the locked m-lines, otherwise
just reject the SDP.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
be84cc2c54
webrtcbin: Remove unused session_mid_map
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
08dd305a20
webrtcbin: Enforce m-line restrictions when creating offer
...
First fail the offer creation if the mid of an existing offer doesn't
match a forced m-mline.
Then, for all newly added mlines, first look for a transceiver that
forces this m-line, then add a "floating" one, then the data channel.
And repeat this until we're out of transceivers.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
ed1f0f33a2
webrtcbin: Remember if a transceiver had a forced m-line
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
92d356d4b0
webrtcbin: Enforce same-kind on request sink pad with a specific name
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
249b2d54d7
webrtcbin: Enforce compatible caps on pad request
...
If a pad is requested with certain caps and there is already a
transceiver, reject the pad request if the caps don't match.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
902e40cae2
webrtcbin: Reject pad request for a specific m-line if it already exists
...
This way, the app developer is in control.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
0e2d128bec
webrtcbin: Make request-pad validation an early return
...
This reduces the indendation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
0f758a1730
webrtcbin: Add document for webrtcbin itself to generated doc
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
3be72a6c86
webrtc: Reset received_caps when releasing pad
...
This is to work around a race where the pad is accessed in the
webrtc main thread while being released.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Olivier Crête
b6114a7fed
webrtcbin: Split pad name from mline
...
The simple case where this breaks is if you add a
datachannel and want to add a new pad (a new media) after). Another
case where this is broken is if the order of the media is forced to
something different by the peer.
It's more simple to just split both things completely. In practice, the
pads will be named in the order in which they are allocated, so it
shouldn't change the current behaviour, just enable new ones.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:06 -04:00
Matthew Waters
2bed220771
webrtc: don't generate duplicate rtx payloads when bundle-policy is set
...
It was possible to generate a SDP that had an RTX payload type
that matched one of the media payload types when providing caps via
codec_preferences without any sink pads.
Fixes
m=video 9 UDP/TLS/RTP/SAVPF 96
...
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 nack pli
a=fmtp:96 apt=96
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2046 >
2021-03-09 02:22:35 +00:00
Mathieu Duponchelle
88e007fb21
webrtcbin: try harder not to pick duplicate media ids
...
On renegotiation, or when the user has specified a mid for
a transceiver, we need to avoid picking a duplicate mid for
a transceiver that doesn't yet have one.
Also assign the mid we created to the transceiver, that doesn't
fix a specific bug but seems to make sense to me.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1902 >
2021-01-08 20:22:57 +00:00
Olivier Crête
df8d29e9c3
webrtcbin: Remove remnant of non-rtcp-mux mode
...
There was some code left that wasn't used anymore.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1930 >
2021-01-06 23:02:37 +00:00
Olivier Crête
a801018ef1
webrtc: Make ssrc map into separate data structures
...
They now contain a weak reference and that could be freed later
causing strange crashes as GWeakRef are not movable.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766 >
2020-11-24 04:27:52 +00:00
Olivier Crête
1c1661b54f
webrtcbin: Implement getting stats for a specific pad
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766 >
2020-11-24 04:27:52 +00:00
Olivier Crête
fc0f6db856
webrtcbin: Store the rtpjitterbuffer instances to extract stats from them
...
Store them as web refs to avoid having to worry about freeing later and because
the new-jitterbuffer is on a different thread
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1766 >
2020-11-24 04:27:52 +00:00
Olivier Crête
5d5417f271
webrtc: Remove non rtcp-mux code
...
RTCP mux is now always required by the WebRTC spec
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1765 >
2020-11-24 01:59:55 +00:00
Jan Schmidt
af90778314
webrtc: Fix a race on shutdown.
...
The main context can disappear in gst_webrtc_bin_enqueue_task()
between checking the is_closed flag and enqueueing a source on the
main context. Protect the main context with the object lock instead
of the PC lock, and hold a ref briefly to make sure it stays alive.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1741 >
2020-10-31 01:47:06 +00:00
Olivier Crête
80a56c25a6
webrtc: Set the DSCP markings based on the priority
...
This matches how the WebRTC javascript API works and the Chrome implementation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1707 >
2020-10-30 16:24:40 -04:00
Olivier Crête
0fbbdc5734
rtptransceiver: Store the SSRC of the current stream
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1707 >
2020-10-30 16:23:10 -04:00
Olivier Crête
7be09a5f22
webrtc: Save the media kind in the transceiver
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1707 >
2020-10-30 16:23:10 -04:00
Olivier Crête
e172ca5be1
webrtcbin: Remove unused function
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1707 >
2020-10-30 16:23:10 -04:00
Sebastian Dröge
cc7e98816f
Revert "webrtc: Save the media kind in the transceiver"
...
This reverts commit f54d8e9945
.
It breaks the CI until the C# bindings are fixed.
2020-10-08 18:53:12 +03:00
Sebastian Dröge
849839ba97
Revert "rtptransceiver: Store the SSRC of the current stream"
...
This reverts commit d1da271f25
.
It breaks the CI until the C# bindings are fixed.
2020-10-08 18:53:07 +03:00
Sebastian Dröge
e65a8cbcf1
Revert "webrtcbin: Remove unused function"
...
This reverts commit 39723dbe93
.
It breaks the CI until the C# bindings are fixed.
2020-10-08 18:53:04 +03:00
Sebastian Dröge
b565a7ef66
Revert "webrtc: Set the DSCP markings based on the priority"
...
This reverts commit 8ba08598bb
.
It breaks the CI until the C# bindings are fixed.
2020-10-08 18:53:00 +03:00
Olivier Crête
8ba08598bb
webrtc: Set the DSCP markings based on the priority
...
This matches how the WebRTC javascript API works and the Chrome implementation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425 >
2020-10-06 16:49:08 -04:00
Olivier Crête
39723dbe93
webrtcbin: Remove unused function
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425 >
2020-10-06 16:49:08 -04:00
Olivier Crête
d1da271f25
rtptransceiver: Store the SSRC of the current stream
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425 >
2020-10-06 16:49:08 -04:00
Olivier Crête
f54d8e9945
webrtc: Save the media kind in the transceiver
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425 >
2020-10-06 16:49:08 -04:00
Olivier Crête
825a79f01f
webrtcbin: Accept end-of-candidate pass it to libnice
...
libnice now supports the concept of end-of-candidate, so use the API
for it. This also means that if you don't do that, the webrtcbin will
never declared the connection as failed.
This requires bumping the dependency to libnice 0.1.16
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1139 >
2020-09-18 18:40:58 -04:00
Olivier Crête
63f06d16db
webrtcbin: Merge the RTX SSRCs from all transceivers when bundling
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1545 >
2020-09-18 14:20:03 +00:00
Matthew Waters
e2d88f0569
webrtc: propagate more errors through the promise
...
Return errors on promises when things fail where available.
Things like parsing errors, invalid states, missing fields, unsupported
transitions, etc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1565 >
2020-09-14 04:04:29 +00:00
Matthew Waters
597c1b4ec6
webrtc: remove private properties/signals from the now public ice object
...
We don't want to expose all of the webrtcbin internals to the world.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1444 >
2020-07-20 15:56:20 +10:00
Olivier Crête
cceca1ffe8
webrtcbin: Expose "latency" property
...
This property sets the latency both on the rtpbin/rtpjittbuffer, but
also on the RTPStorage elements currently used by the FEC decoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1367 >
2020-06-29 22:45:31 -04:00
Sebastian Dröge
aa01e6ba22
webrtcbin: Don't call gst_ghost_pad_construct() anymore
...
It's deprecated, unneeded and doesn't do anything anymore.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1360 >
2020-06-22 17:01:34 +00:00
Matthew Waters
0f41c0f000
webrtc: fix ice control mode when we offer initially
...
An initial offer means we have a local description not a remote
description.
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1332
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1358 >
2020-06-22 12:17:09 +00:00
Mathieu Duponchelle
a048ce81d4
plugins: uddate gst_type_mark_as_plugin_api() calls
2020-06-06 00:40:42 +02:00