Sebastian Dröge
dcc49f846b
webrtcbin: Add a test for setting codec preferences as part of "on-new-transceiver" when setting the remote offer
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2310 >
2021-06-25 09:45:24 +00:00
Sebastian Dröge
348d4229e7
webrtc: Use fail_unless_equals_string() for string assertions
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2310 >
2021-06-25 09:45:24 +00:00
Olivier Crête
71052f0321
webrtcbin test: Fix race in new test
...
Pull a buffer from a sink to make sure that the caps are already
set before trying to update them.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2348 >
2021-06-24 09:41:09 +00:00
Olivier Crête
8b595e7c8b
webrtc test: Print content of error GstMessage
...
Makes it easier to interpret the result of the CI!
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183 >
2021-05-13 16:37:31 -04:00
Olivier Crête
78d2d6cf6f
webrtcbin tests: Add test for intersection src pad caps
...
This checks that the codec preferences are intersected also with what
the src pad can handle.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183 >
2021-05-13 16:37:31 -04:00
Olivier Crête
cc556452ce
webrtc test: Add explicit test clock
...
This way the test clock is not linked to the multiple harnesses
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183 >
2021-05-13 15:05:00 -04:00
Olivier Crête
2aa7efedd3
webrtc test: Add test for codec preferences negotiation
...
Validate that it does the intersection with the caps from
the sink pad and rejects the offer creation otherwise.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183 >
2021-05-13 15:05:00 -04:00
Olivier Crête
70befc0b21
webrtcbin: Implement caps queries on sinkpad based on codec preferences
...
Also includes a unit test.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183 >
2021-05-13 15:05:00 -04:00
Olivier Crête
6a3a62abae
webrtcbin tests: Use properties to access the inside of the transceiver object
...
This will allow hiding the insides from unsafe application access.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183 >
2021-05-13 15:05:00 -04:00
Johan Sternerup
caefc3a831
webrtcbin: Add unit test for closing of data channels
...
Add test for verifying that the data channel "close" action signal
triggers an SCTP_RESET_STREAMS request that is propagated to the other
side and eventually leads to both sides closing properly.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2186 >
2021-05-12 03:02:27 +00:00
François Laignel
ad3d7d34cc
Use gst_element_request_pad_simple...
...
Instead of the deprecated gst_element_get_request_pad.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2180 >
2021-05-05 06:17:14 +00:00
Olivier Crête
bc817f340c
webrtcbin test: Don't fail if data channel is created
...
In tests that voluntarily create a data channel.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2168 >
2021-04-21 03:21:55 +00:00
Olivier Crête
474c4bf08f
webrtcbin test: Wait for set-local-desc & set-remote-desc to continue
...
To avoid racing betwen the SDPs being set and the next step of the
test, let's wait for setting the SDP both locally and remotely to succeed.
of the test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
4a48e291ff
webrtcbin test: Add for the case where a second m-line is renegotiated
...
This is for the case where there answerer forces a specific media type
for a m-line, but he origin offer only has the other media type. In this
case, we will create a second transceiver on receiving the offer and add
the desired media type using renegotiation.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
2bd647e999
webrtc test: Verify that forcing different kinds on peers fails
...
If the offer contains an audio kind and a video kind, forcing them both
at m-line zero will fail.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
8df5b9f974
webrtc tests: Verify that create-offer is rejected when needed
...
Verify that it gets rejected if a m-line at index 1 is requested but
there is no m-line 0.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 18:37:27 -04:00
Olivier Crête
913d308e22
webrtcbin test: Add test for various cases where get_request_pad is meant to fail
...
This should ensure that the recently added code works.
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
d49e664c84
webrtcbin test: Test adding a stream to a stream+datachannel
...
This use-case was previously broken by the expectation of having
a 1-1 match between the pad id and the m-line index
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104 >
2021-04-12 17:55:07 -04:00
Matthew Waters
e463bcfadf
tests/webrtc: check for more sdp things across the board
...
e.g.
- test for a=setup:$val and direction attributes in all tests
- test number of media sections
- test number of formats in each m= section (for audio/video)
- test no duplicate formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2093 >
2021-03-19 18:02:21 +11: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
Ilya Kreymer
92626535c7
webrtc ice: Add 'min/max-rtp-port' props for setting RTP port range
...
default min port == 0, max port == 65535 -- if min port == 0, uses existing random port selection (range ignored)
add 'gathering_started' flag to avoid changing ports after gathering has started
validity checks: min port <= max port enforced, error thrown otherwise
include tests to ensure port range is being utilized (by @hhardy)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/119 >
2021-03-01 14:42:17 +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
e4b848e2a8
tests/webrtc: unref GBytes after use
...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1535 >
2020-08-24 17:02:35 +10:00
Matthew Waters
02c8e66ff1
webrtc: fix an off-by-one calculating low-threshold
...
We were not signalling low-threshold when the previous amount was at
exactly the low-threshold mark.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1247 >
2020-05-06 15:49:58 +10:00
Matthew Waters
d0b20f8bba
webrtc: fix a slightly racy test
...
There is no guarantee that the peer data channel has transitioned to
open when we do.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1247 >
2020-05-06 15:49:58 +10:00
Matthew Waters
d0be6b74f2
tests/webrtc: fix a data channel leak in a test
...
test_data_channel_create_after_negotiate overrides the data_channel_data
without ever freeing it.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1240 >
2020-05-06 02:53:27 +00:00
Matthew Waters
7aa58954c1
tests/webrtc: move bus thread creation earlier
...
Fixes a small deadlock race where the bus watch GSource could execute before
the unlock mutex GSource.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1240 >
2020-05-06 02:53:27 +00:00
Stéphane Cerveau
6bc0e9527e
remove various useless linefeed in logs
2019-12-11 10:51:29 +01:00
Sebastian Dröge
28b0be4036
rtptransceiver: Remove direction setter and vfunc and replace it by a property
...
It was changed from a function to a property in the latest WebRTC spec.
2019-08-06 12:22:21 +00:00
Matthew Waters
62cc5e51d1
tests/webrtc: wait until the SDP has been set before continuing
...
If we renegotiate, then it is currently possible for an added stream to
be added to webrtcbin before the SDP is complete. This causes an
internal inconsistency as there is a 'pending sink transceiver' without
a corresponding media section in the sdp. It also does not have an
associated transport stream and will fail in _connect_input_stream().
2019-05-30 21:33:09 +10:00
Matthew Waters
979daea7f2
tests/webrtc: fix racy test with a prenegotiated data channel
...
If both data channels become ready simultaneously, then the two integer
read-add-update cycles can execute concurrently and only ever increment
once instead of the required twice. Use an atomic add instead.
2019-05-30 21:33:09 +10:00
Matthew Waters
177aa22bcd
webrtc: Initial support for stream addition/removal
...
Limitations:
- No transport changes at all (ICE, DTLS)
- Codec changes are untested and probably don't work
- Stream removal doesn't remove transports (i.e. non-bundled transports
will stay around until webrtcbin is shutdown)
- Unified Plan SDP only. No Plan-B support.
2019-05-30 21:33:09 +10:00
Matthew Waters
015cb75f66
tests/webrtc: a couple of debug/error string fixes
2019-05-30 21:33:09 +10:00
Matthew Waters
be35735989
tests/webrtc: rewrite bundle checks for separate validate_sdp passes
...
Improves reusability
2019-05-30 21:33:09 +10:00
Matthew Waters
2bb1fde47c
tests/webrtc: add helper for getting the offer/answer element
2019-05-30 21:33:09 +10:00
Matthew Waters
b48e2947bf
tests/webrtc: only check audio/video for direction attributes
2019-05-30 21:33:09 +10:00
Matthew Waters
bd92b2f7c4
webrtc: fix answer creation with multiple streams and similar caps
2019-05-30 21:26:46 +10:00
Matthew Waters
ebb9c3c298
tests/webrtc: factor out sdp validation into a single function
2019-05-30 21:26:46 +10:00
Matthew Waters
eb79f95bf8
tests/webrtc: validate number of sdp media using validate_sdp
2019-05-30 21:26:46 +10:00
Matthew Waters
7e1cdbfd4d
tests/webrtc: allow multiple validation functions
2019-05-30 21:26:46 +10:00
Matthew Waters
120a40cf25
tests/webrtc: test that duplicate negotiations succeed
2019-05-30 21:26:46 +10:00
Matthew Waters
65c9c4b406
tests/webrtc: fix tests for no libnice
...
webrtcbin will fail the state change to READY when libnice elements are
not available.
2018-11-26 17:13:08 +11:00
Matthew Waters
57a006d8a5
tests/webrtc: use the existing functions in the plugin
...
Instead of redefining our own, use the function implementations in
webrtcsdp.c and utils.c
2018-11-26 17:13:08 +11:00
Mathieu Duponchelle
9f684a2f81
webrtcbin: implement support for group: BUNDLE
2018-10-15 14:17:35 +02:00
Matthew Waters
21bf3a35ac
webrtc/datachannel: fix support for prenegotiated channels
...
With prenegotiated channels, the data-channel protocol is not used and
instead the channel's negotiation is intended to be performed out of band in
some application-specific manner.
Comes with test!
2018-10-09 02:38:14 +11:00
Matthew Waters
7bf18ad258
webrtc: start in the closed state
...
This means that we will reject all operations before we've transitioned
into READY.
This also fixes the tests using the default GMainContext in the NULL
state instead of the webrtcbin internal GMainContext and thread. Also
removes a potential ordering race where on the element transitioning to
READY, an operations could have been queued on two different threads and
removing a guarentee on operation ordering.
2018-10-08 21:56:31 +11:00
Matthew Waters
faf212cd3a
tests/webrtcbin: add a couple more dependant element checks
...
Without the sctp elements, all the data channel tests will fail
2018-10-04 16:44:55 +10:00
Matthew Waters
07e9374eff
webrtcbin: add support for data channels based on SCTP
...
Mostly follows the W3C specification
https://www.w3.org/TR/webrtc/#peer-to-peer-data-api
With contributions from:
Mathieu Duponchelle <mathieu@centricular.com>
https://bugzilla.gnome.org/show_bug.cgi?id=794351
2018-09-21 19:45:12 +10:00
Jan Schmidt
0af199e25e
webrtc: Add some ssrc to caps in the unit test.
...
The unit test uses incomplete caps to test webrtcbin,
causing some weirdness generating RTX stream mappings.
https://bugzilla.gnome.org/show_bug.cgi?id=796810
2018-07-15 23:07:37 +10:00