Commit graph

2922 commits

Author SHA1 Message Date
Sebastian Dröge 8335bdb0b7 Update versions to 0.11.4 2024-02-13 11:13:23 +02:00
Sebastian Dröge 8af4eb2df6 Update CHANGELOG.md to 0.11.4 2024-02-13 11:12:55 +02:00
Sebastian Dröge b3b2b08d30 rtp: gcc: Use x += ... instead of x = x + ...
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 19:03:13 +02:00
Sebastian Dröge 96d5a4d75d Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:54:32 +02:00
Sebastian Dröge d0b944b2a7 Fix a couple of compiler/clippy warnings with --no-default-features
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:52:58 +02:00
Sebastian Dröge ed3b5934d8 ci: Ignore GTK4 plugin when building with --all-features
And run clippy also with default / no-default features.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:52:17 +02:00
Sebastian Dröge bf3d302efc gtk4: Always draw a black background behind the video frame
This makes sure that there is the same background behind the frame, no
matter if black borders have to be added or not. Without this a frame
that has transparency would change rendering depending on the layout.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:52:08 +02:00
Sebastian Dröge 9dcb68edc8 gtk4: Improve handling of RGBA GL textures in GTK
GTK 4.14 comes with a new GL renderer that does not support GL shader
nodes anymore, so the conversion from non-premultiplied alpha to
premultiplied alpha has to happen differently.

For GTK 4.14 or newer we use the correct format directly when building the
texture, but only if a GLES3+ context is used. In that case the NGL renderer is
used by GTK, which supports non-premultiplied formats correctly and fast.

For GTK 4.10-4.12, or 4.14 and newer if a GLES2 context is used, we use a
self-mask to pre-multiply the alpha.

For GTK before 4.10, we use a GL shader and hope that it works.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:51:27 +02:00
Ruben Gonzalez 7f041fe5c8 gtk4: Fix segfault running gst-inspect -a when GTK4 and GTK3 is installed
Segmentation fault when getting default value of paintable property
from gtk4paintablesink element when libgtk-4.so.1 from libgstgtk4.so
and libgtk-3.so.0 from libgstgtk.so are installed:

> cannot register existing type 'GdkDisplayManager'

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:51:02 +02:00
Ruben Gonzalez 883bfb6f94 meson: Update dav1d dependecies to avoid build error when 1.3
See: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1393
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:50:52 +02:00
Ruben Gonzalez e798d5b216 meson: Use list for dependency version to enable multiple restrictions
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:50:47 +02:00
Jordan Yelloz 44920082f0 livekit_signaller: Added high-quality layer for video streams
This change addresses a cosmetic issue with livekit, where the
connection quality indicator seen by other users shows bad quality
unless the track is added with a high quality layer. The details of the
layer submitted aren't significant for this purpose.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:49:52 +02:00
François Laignel af8a6d8081 webrtc: signallers: attempt to close the ws when an error occurs
This commit discards the early error returns in the send tasks to log the error
and attempt to close the websocket.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:49:36 +02:00
François Laignel 69c827a4d8 webrtc: only use close() to close websockets
In the signaller clients and servers, the following sequence is used to close
the websocket (in the [send task]):

```rust
    ws_sink.send(WsMessage::Close(None)).await?;
    ws_sink.close().await?;
```

tungstenite's [`WebSocket::close()` doc] states:

> Calling this function is the same as calling `write(Message::Close(..))``

So we might think they are redundant and either could be used for this purpose
(`send()` calls `write()`, then `flush()`).

The result is actually is bit different as `write()` starts by checking the
state of the connection and [returns `SendAfterClosing`] if the socket is no
longer active, which is the case when a closing request has been received from
the peer via a [call to `do_close()`]). Note that `do_close()` also enqueues a
`Close` frame.

This behaviour is visible from the server's logs:

```
1. tungstenite::protocol: Received close frame: None
2. tungstenite::protocol: Replying to close with Frame { header: FrameHeader { .., opcode: Control(Close), .. }, payload: [] }
3. gst_plugin_webrtc_signalling::server: Received message Ok(Close(None))
4. gst_plugin_webrtc_signalling::server: connection closed: None this_id=cb13892f-b4d5-4d59-95e2-b3873a7bd319
5. remove_peer{peer_id="cb13892f-b4d5-4d59-95e2-b3873a7bd319"}: gst_plugin_webrtc_signalling::server: close time.busy=285µs time.idle=55.5µs
6. async_tungstenite: websocket start_send error: WebSocket protocol error: Sending after closing is not allowed
```

1: The server's websocket receives the peer's `Close(None)`.
2: `do_close()` enqueues a `Close` frame.
3: The incoming `Close(None)` is handled by the server.
4 & 5: perform session closing.
6: `ws_sink.send(WsMessage::Close(None))` attempts to `write()` while the ws
   is no longer active. The error causes an early return, which means that
   the enqueued `Close` frame is not flushed.

Depending on the peer's shutdown sequence, this can result in the following
error, which can bubble up as a `Message` on the application's bus:

```
ERROR: from element /GstPipeline:pipeline0/GstWebRTCSrc:webrtcsrc0: GStreamer encountered a general stream error.
Additional debug info:
net/webrtc/src/webrtcsrc/imp.rs(625): gstrswebrtc::webrtcsrc:👿:BaseWebRTCSrc::connect_signaller::{{closure}}::{{closure}} (): /GstPipeline:pipeline0/GstWebRTCSrc:webrtcsrc0:
Signalling error: Error receiving: WebSocket protocol error: Connection reset without closing handshake
```

On the other hand, [`close()` ensures the ws is active] before attempting to
write a `Close` frame. If it's not, it only flushes the stream.

Thus, when we want to be able to close the websocket and/or to honor the closing
handshake in response to the peer `Close` message, the `ws_sink.close()`
variant is preferable.

This can be verified in the resulting server's logs:

```
tungstenite::protocol: Received close frame: None
tungstenite::protocol: Replying to close with Frame { header: FrameHeader { is_final: true, rsv1: false, rsv2: false, rsv3: false, opcode: Control(Close), mask: None}, payload: [] }
gst_plugin_webrtc_signalling::server: Received message Ok(Close(None))
gst_plugin_webrtc_signalling::server: connection closed: None this_id=192ed7ff-3b9d-45c5-be66-872cbe67d190
remove_peer{peer_id="192ed7ff-3b9d-45c5-be66-872cbe67d190"}: gst_plugin_webrtc_signalling::server: close time.busy=22.7µs time.idle=37.4µs
tungstenite::protocol: Sending pong/close
```

We now get the notification `Sending pong/close` (the closing handshake) instead
of `websocket start_send error` from step 6 with previous variant.

The `Connection reset without closing handshake` was not observed after this
change.

[send task]: 63b568f4a0/net/webrtc/signalling/src/server/mod.rs (L165)
[`WebSocket::close()` doc]: https://docs.rs/tungstenite/0.21.0/tungstenite/protocol/struct.WebSocket.html#method.close
[returns `SendAfterClosing`]: 85463b264e/src/protocol/mod.rs (L437)
[call to `do_close()`]: 85463b264e/src/protocol/mod.rs (L601)
[`close()` ensures the ws is active]: 85463b264e/src/protocol/mod.rs (L531)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:49:21 +02:00
Taruntej Kanakamalla 9fcd63222d webrtc: conditional compile for features with 1_22 dependency
Few features being used in webrtcsink like
the signal `request-aux-sender` are introduced
to webrtcbin in gstreamer release 1.22.

Rename the feature gst1_22 to v1_22 for uniformity.

Add v1_22 to default features.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:48:57 +02:00
Sebastian Dröge 58c22120c2 gif: Update to gif 0.13
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:48:42 +02:00
Sebastian Dröge ecd824adae webrtc: Update AWS signaller to http 1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:47:43 +02:00
Mathieu Duponchelle fdfd10112b textwrap: add support for gaps
When accumulate-time is non-zero, we need to drain our accumulated
text once the threshold is reached.

Implement support for gaps the simplest way, by transforming it into
an empty buffer and chaining it through ourself.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:46:44 +02:00
Michael Tretter 9f7bb6102c livesync: add support for image formats
The livesync element is also useful for Motion JPEG streams. However,
Motion JPEG uses image/ caps instead of video/ caps.

The framerate is defined for image/, too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:46:36 +02:00
Michael Tretter 21e5d3b7d8 meson: allow building plugins with GTK 4 examples
Only the examples of the fallbackswitch, livesync, and togglerecord
plugins require the gtk, gio, and gst-plugin-gtk4 features. The plugins
themselves don't actually have a dependency on GTK.

Only add the features (and examples) if the examples are actually
enabled to allow building these plugins without the GTK dependency.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:46:31 +02:00
Nirbheek Chauhan be3b46672d meson: Add nasm to PATH if meson can find it
Fixes rav1e build on Windows when built inside the monorepo.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:46:19 +02:00
Nirbheek Chauhan e3f03a690d meson: pkg-config is required at build time
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:46:14 +02:00
Nirbheek Chauhan 77acb7fad2 meson: Fix build on Windows with MSVC
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/480

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:46:08 +02:00
Michael Tretter 418107d64e meson: remove trailing whitespace and add comma
Cleanup without functional change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:46:02 +02:00
Sanchayan Maity 6eb3c7b446 webrtchttp: Allow audio or video caps to be specified as None with WHEP
We were setting audio and video caps by default even when the user
might have requested only video or audio. This would then result
in a `Could not reuse transceiver` error from the webrtcbin.

Fix this by allowing the user to specify audio or video caps as
None. This allows us to maintain the earlier behaviour for backward
compatibility while allowing the user to not request audio or video
as need be.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:45:57 +02:00
Guillaume Desmottes ddc15b92a5 livesync: properly format jitter in debug logs
Easier to read that way.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:45:46 +02:00
Sebastian Dröge bd0c6690e0 webrtc: Update to livekit-api / livekit-protocol 0.3
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:45:18 +02:00
Sebastian Dröge cee7c1e46c rav1e: Update to rav1e 0.7
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:44:16 +02:00
Nirbheek Chauhan ee5695d2e0 webrtc/signalling: We get the address when accepting
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:43:27 +02:00
Nirbheek Chauhan 879573c8f6 webrtc/signalling: Fix potential hang and FD leak
If a peer connects via TCP and never initiates TLS, then the server
will get stuck in the accept loop. Spawn a task when accepting a TLS
connection, and timeout if it doesn't complete in 5 seconds.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:43:21 +02:00
Guillaume Desmottes cb906a9d55 gtk4: fix build on Windows using winegl
from_glib_full() was not in scope.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1457>
2024-02-12 17:43:15 +02:00
Sebastian Dröge 5bba2f7836 meson: Update version to 0.11.3 too 2024-01-04 13:05:23 +02:00
Sebastian Dröge 46b84c1564 Update CHANGELOG.md to 0.11.3 2023-12-18 12:22:18 +02:00
Sebastian Dröge 4c8db5623f Update versions to 0.11.3 2023-12-18 12:13:48 +02:00
Sebastian Dröge aed165ee17 Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:46:42 +02:00
Sebastian Dröge ed5b090318 gtk4: Use async-channel instead of the glib MainContext channel
The latter will be removed in favour of using async code in the future,
and async code generally allows for more flexible message handling than the
callback based MainContext channel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:46:42 +02:00
Arun Raghavan af4cf79b37 threadshare: Fix a deadlock in used-socket notification
This manifests in a gst-launch-1.0 pipeline using ts-udpsrc, since
notification of used-socket results in the property being read by the
application, and the settings lock causes a deadlock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:07:29 +02:00
Arun Raghavan 12ceb178ed threadshare: Fix a typo while logging
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:07:24 +02:00
Sebastian Dröge 814735e537 webrtc: Downgrade aws-smithy-http to 0.60
Version 0.61 was yanked from crates.io.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:07:17 +02:00
Sebastian Dröge 25e8638a09 deny: Update
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:07:12 +02:00
Sebastian Dröge fd64d5259a webrtc: Update to aws-smithy-http 0.61
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:07:04 +02:00
Sebastian Dröge 975a3a53af rtp: Update to bitstream-io 2.0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:06:50 +02:00
Sebastian Dröge c655edd892 Update to async-tungstenite 0.24
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:06:17 +02:00
Sebastian Dröge c0499c7dd1 Update further AWS SDK crates to 1.0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:05:12 +02:00
Mathieu Duponchelle 824ae39848 webrtcsink: don't panic on failure to request pad from webrtcbin
webrtcbin will refuse pad requests for all sorts of reasons, and should
be logging an error when doing so, simply post an error message and let
the application deal with it, the reason for the refusal should
hopefully be available in the logs to the user.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:05:06 +02:00
Matthew Waters fc02f5abd4 tttocea608: use crate defined is_* functions instead of reeimplementing them
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:04:56 +02:00
Sebastian Dröge a788bf07f4 Update to AWS SDK 1.0 / 0.60 / 0.39
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:04:48 +02:00
Sebastian Dröge 5d52cd4e4c deny: Update for duplicated crypto-bigint dependency
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:04:43 +02:00
Sebastian Dröge 43db2c24bb Update to AWS SDK 0.101 / 0.59 / 0.38
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:04:36 +02:00
Sebastian Dröge c7d91ce28a aws: Stop using deprecated aws_config function in the test
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1410>
2023-12-18 10:04:31 +02:00