Commit graph

801 commits

Author SHA1 Message Date
Sanchayan Maity
cf7172248c net/quinn: Allow setting some parameters from TransportConfig
As of now, we expose the below four properties from `TransportConfig`.
- Initial MTU
- Minimum MTU
- Datagram receive buffer size
- Datagram send buffer size

Maximum UDP payload size from `EndpointConfig` and upper bound from
`MtuDiscoveryConfig` are also exposed as properties.

See the below documentation for further details.
- https://docs.rs/quinn/latest/quinn/struct.TransportConfig.html
- https://docs.rs/quinn/latest/quinn/struct.MtuDiscoveryConfig.html
- https://docs.rs/quinn/latest/quinn/struct.EndpointConfig.html

While at it, also clean up passing function parameters to the functions
in utils.rs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1613>
2024-06-25 20:15:40 +05:30
Sanchayan Maity
bc5ed023e4 net/quinn: Improve datagram handling
We now check if the peer actually supports Datagram and refusing to
proceed if it does not. Since the datagram size can actually change
over the lifetime of a connection according to variation in path MTU
estimate, also check buffer size before trying to send.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1613>
2024-06-25 20:15:40 +05:30
Matthew Waters
39b61195ad rtprecv: ensure that stopping the rtp src task does not critical
When pad a released, then we were removing the pad from an internal
list. If the pad was not already deactivated, the deactiviation would
attempt to look for the pad in that list and panic if it was not there.

Fix by delaying removal of the pad from the list until after pad
deactivation occurs.

Also includes test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1618>
2024-06-24 13:13:28 +00:00
Matthew Waters
10a31a397e rtp/recv: support pushing buffer lists from the jitterbuffer
Multiple concurrent buffers produced by the jitterbuffer will be
combined into a single buffer list which will be sent downstream.

Events or queries that interrupt the buffer flow will cause a split in
the output buffer list.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1618>
2024-06-24 13:13:28 +00:00
Matthew Waters
d036abb7d2 rtp/recv: support buffers lists on rtp sink pad
In one case, improves throughput by 25% when buffer lists are used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1618>
2024-06-24 13:13:28 +00:00
Matthew Waters
df4a4fb2ef rtp/send: support receiving buffer lists
Can reduce processing overhead if many buffers are pushed concurrently.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1618>
2024-06-24 13:13:28 +00:00
Matthew Waters
2d1f556794 rtp/session: guard against a busy wait with no members
If the number of members is 0, then the calculated time to the next rtcp
wakup would be 'now' and could result in a busy loop in the rtcp
processing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1618>
2024-06-24 13:13:28 +00:00
Matthew Waters
84a9f9c61f rtp/source: use extended sequence number helper
Instead of rolling our own

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1618>
2024-06-24 13:13:28 +00:00
Sebastian Dröge
47d62b6d78 Update for new clone/closure macro syntax
Also fix various weak/strong references in the webrtc plugin, and make
sure to pass the object to debug log functions in every place.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1625>
2024-06-21 11:54:58 +03:00
Sebastian Dröge
9b323a6519 Use Option::is_some_and(...) instead of Option::map_or(false, ...)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1630>
2024-06-19 13:03:37 +00:00
Sebastian Dröge
23d998a1db Slightly improve code making use of element factories retrieved from an element
We can use `is_some_and(...)` instead of `map_or(false, ...)`.

Also in a few places the factory was retrieved multiple times, one time
with unwrapping and another time with handling the `None` case
correctly. Instead of unwrapping, move code to handle the `None` case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1630>
2024-06-19 13:03:37 +00:00
Arun Raghavan
8f96509f03 aws: s3: Enable tests again
We lost the environment variable checks during the addition of the
putobjectsink tests, which caused failures on MR branches.

It would be nicer to use some other mechanism to validate the tests can
run, so we don't count on only the environmnent, but for now this will
have to do.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1629>
2024-06-18 11:58:43 -04:00
Sebastian Dröge
743ab29ba8 Update Cargo.lock and MSRV to 1.71
cea608-types requires that now because it updated the env_logger
dependency. As a result, we can also update it here now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1622>
2024-06-18 10:27:27 +03:00
Sebastian Dröge
5aedcab32f Revert "aws: s3: Re-enable tests"
This reverts commit b4b56eb282.
The tests are still failing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1624>
2024-06-18 08:50:07 +03:00
Sebastian Dröge
4677948a82 rtp: av1pay: Derive Default trait for the state instead of manual implementation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1624>
2024-06-18 08:07:24 +03:00
Sebastian Dröge
d357a63bf9 rtp: av1pay: Correctly use N flag for marking keyframes
The "first packet of a coded video sequence" means that this should be
the first packet of a keyframe that comes together with a sequence
header, not the first packet of a new frame.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/558

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1624>
2024-06-18 08:06:59 +03:00
Sebastian Dröge
5cd9e34265 rtp: av1pay: Correctly skip over ignored OBUs
The reader is already after the header at this point so only the OBU
content has to be skipped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1624>
2024-06-18 08:06:59 +03:00
Sebastian Dröge
bbe38b9599 rtp: av1: Drop padding OBUs too like Chrome does
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1624>
2024-06-18 08:06:59 +03:00
Arun Raghavan
b4b56eb282 aws: s3: Re-enable tests
These seem to have stopped working due to bad/rotated creds. Should work
fine now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1623>
2024-06-17 06:08:18 -04:00
Sebastian Dröge
343680ffea rtp: av1depay: Don't return an error if parsing a packet fails
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1612>
2024-06-14 13:13:21 +00:00
Sebastian Dröge
477855789d rtp: av1depay: Also log warnings on errors
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1612>
2024-06-14 13:13:21 +00:00
Sebastian Dröge
93c9821cba rtp: av1depay: Drop unusable packets as early as possible
Otherwise they would pile up until a discontinuity or until we can
actually output something.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1612>
2024-06-14 13:13:21 +00:00
Sebastian Dröge
0ca4a3778a rtp: av1depay: Parse internal size fields of OBUs and handle them
They're not recommended by the spec to include in the RTP packets but it
is valid to include them. Pion is including them.

When parsing the size fields also make sure to only take that much of a
payload unit and to skip any trailing data (which should not exist in
the first place).

Pion is also currently storing multiple OBUs in a single payload unit,
which is not allowed by the spec but can be easily handled with this
code now.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/560

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1612>
2024-06-14 13:13:21 +00:00
Sebastian Dröge
69c3c2ae46 Fix various new clippy 1.79 warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1620>
2024-06-14 08:33:49 +03:00
Sebastian Dröge
3d4d785a2a webrtchttp: Fix race condition when unlocking
It would be possible that there is no cancellable yet when unlock() is
called, then a new future is executed and it wouldn't have any
information that it is not supposed to run at all.

To solve this remember if cancellation should happen and reset this
later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1602>
2024-06-10 07:38:29 +00:00
Sebastian Dröge
51f6d3986f aws: Fix race condition when unlocking
It would be possible that there is no cancellable yet when unlock() is
called, then a new future is executed and it wouldn't have any
information that it is not supposed to run at all.

To solve this remember if unlock() was called and reset this in
unlock_stop().

Also implement actual unlocking in s3hlssink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1602>
2024-06-10 07:38:29 +00:00
Sebastian Dröge
00aaecad07 quinn: Fix race condition when unlocking
It would be possible that there is no cancellable yet when unlock() is
called, then a new future is executed and it wouldn't have any
information that it is not supposed to run at all.

To solve this remember if unlock() was called and reset this in
unlock_stop().

Also actually implement unlock() / unlock_stop() for the sink, and don't
cancel in stop() as unlock() / unlock_stop() would've been called before
that already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1602>
2024-06-10 07:38:29 +00:00
Sebastian Dröge
9945b702b8 reqwesthttpsrc: Fix race condition when unlocking
It would be possible that there is no cancellable yet when unlock() is
called, then a new future is executed and it wouldn't have any
information that it is not supposed to run at all.

To solve this remember if unlock() was called and reset this in
unlock_stop().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1602>
2024-06-10 07:38:29 +00:00
Sebastian Dröge
f68655b5e2 Update for gst::BufferList API changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1610>
2024-06-08 09:58:10 +03:00
Sebastian Dröge
30252a1b2e ndi: Add support for loading NDI SDK v6
The library name and environment variable name have changed but the ABI
is completely compatible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1607>
2024-06-06 14:51:09 +00:00
Matthew Waters
260b04a1cf rtpbin2: protoct against adding with overflow
If jitter is really bad, then this calculation may overflow.  Protect
against that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1605>
2024-06-06 11:43:26 +00:00
Sebastian Dröge
ba70bb1154 deny: Add override for older tungstenite
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1603>
2024-06-06 10:34:12 +00:00
Sebastian Dröge
85c38107cf webrtc: Update to async-tungstenite 0.26
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1603>
2024-06-06 10:34:12 +00:00
Sanchayan Maity
8171a00943 net/quinn: Fix pad template naming typo
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1601>
2024-06-05 13:44:40 +05:30
Tim-Philipp Müller
ab2f5e3d8d rtp: ac3: add some unit tests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1586>
2024-06-01 12:43:27 +00:00
Tim-Philipp Müller
2b68920f82 rtp: tests: add possibility to make input live
.. for payloaders that behave differently with live
and non-live inputs (e.g. audio payloaders which by
default will pick different aggregation modes based
on that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1586>
2024-06-01 12:43:27 +00:00
Tim-Philipp Müller
6597ec84eb rtp: tests: add possibility to check duration of depayloaded buffers
.. and clarify an expect panic message.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1586>
2024-06-01 12:43:27 +00:00
Tim-Philipp Müller
6b628485c5 rtp: Add AC-3 RTP payloader/depayloader
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1586>
2024-06-01 12:43:27 +00:00
Tamas Levai
802ff6a67c net/quinn: Make QUIC role configurable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1575>
2024-05-31 23:20:38 +02:00
Francisco Javier Velázquez-García
8fc652f208 webrtcsink: Refactor value retrieval to avoid lock poisoning
When setting an incorrect property name in settings,
start_stream_discovery_if_needed would panic because it attempts to
unwrap a poisoned lock for settings.

This refactor avoids that situation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1594>
2024-05-31 08:10:23 +00:00
Francisco Javier Velázquez-García
568e8533fa webrtcsink: Fix typo in property name for av1enc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1594>
2024-05-31 08:10:23 +00:00
Arun Raghavan
04e9e5284c webrtc: signaller: A couple of minor doc fixups
The expectation is `Returns:`, not `Return:`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1525>
2024-05-30 22:16:46 +03:00
Arun Raghavan
1c54c77840 webrtcsink: Add a mechanism for SDP munging
Unfortunately, server implementations might have odd SDP-related quirks,
so let's allow clients a way to work around these oddities themselves.
For now, this means that a client can fix up the H.264 profile-level-id
as required by Twitch (whose media pipeline is more permissive than the
WHIP implementation).

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/516
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1525>
2024-05-30 22:16:46 +03:00
Taruntej Kanakamalla
83f76280f5 net/webrtc: Example for whipserver
rudimentary sample to test multiple WHIP client connections

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1339>
2024-05-29 21:03:27 +00:00
Taruntej Kanakamalla
712d4757c3 net/webrtc/whip_signaller: multiple client support in the server
- generate a new session id for every new client
use the session id in the resource url

- remove the producer-peer-id property in the WhipServer signaler as it
is redundant to have producer id in a session having only one producer

- read the 'producer-peer-id' property on the signaller conditionally
if it exists else use the session id as producer id

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1339>
2024-05-29 21:03:27 +00:00
Taruntej Kanakamalla
de726ca8d2 net/webrtc: multi producer support in webrtcsrc
- Add a new structure Session
  - manage each producer using a session
  - avoid send EOS when a session terminates, instead keep running
    waiting for any new producer to connect

- Maintain a bin element per session
  - each session bin encapsulates webrtcbin and the decoder if needed
    as well as the parser and filter if requested by the application
    (through request-encoded-filter)
  - this will be helpful to cleanup the session's respective elements
    when the corresponding producer terminates the session

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1339>
2024-05-29 21:03:27 +00:00
Sebastian Dröge
a7418fb483 rtp: Use released version of rtcp-types 2024-05-29 10:30:40 +03:00
Matthew Waters
df32e1ebfa rtpsend: ensure only a single rtcp pad push
Otherwise, it can occur that multiple rtcp packets may be produced out
of order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1426>
2024-05-28 19:58:09 +10:00
Matthew Waters
525179f666 rtpbin2: handle ssrc collisions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1426>
2024-05-28 19:58:09 +10:00
Nirbheek Chauhan
9485265769 rtspsrc2: Update rtpbin2 support to use rtprecv and rtpsend
USE_RTPBIN2 is now USE_RTP2 because there is no "rtpbin2" now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1426>
2024-05-28 19:58:09 +10:00