Commit graph

2677 commits

Author SHA1 Message Date
Guillaume Desmottes
91d2406180 fallbackswitch: protect src pad stream lock using Cond
Should prevent stream and State deadlocks, see https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/202

Fix #202
Hopefully fix #192 as well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:44:22 +03:00
Guillaume Desmottes
e1d35536ad fallbackswitch: prevent deadlocks in chain function
Calling schedule_timeout() may result in handle_timeout() being called right away,
which will need pad state locks which was still hold in chain().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:44:14 +03:00
Guillaume Desmottes
74b6955e0e fallbackswitch: ensure strict ordering when taking mutexes
Should prevent deadlocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:43:59 +03:00
Sebastian Dröge
17b3a3183b Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:41:23 +03:00
Sebastian Dröge
7c59caf3f8 webrtcsink: Fix clippy warning
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:34:07 +03:00
Sebastian Dröge
7e113539b0 gtk4: Only support RGBA/RGB in the GL code path
For all other component orderings a shader is necessary to re-order the
components for what GTK expects.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:27:57 +03:00
Ivan Molodetskikh
54ae12c8c2 gtk4: Premultiply alpha in GL textures
GTK expects GL textures to have premultiplied alpha. The ones we get
from GStreamer don't, leading to incorrect rendering of semitransparent
frames.

GTK 4.12 gained an API to set a different GL texture format, but it
won't help for older GTK versions. Plus, at the time of writing, it
causes a very slow download/upload path in GTK.

So, use a GTK GL shader node to premultiply the alpha without leaving
the GPU.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:27:57 +03:00
Sebastian Dröge
26d90191b5 onvifmetadataparse: Skip metadata frames with unrepresentable UTC time
Previously we would panic, which causes the element to post an error
message. Instead, simply skip metadata frames if their UTC time since
the UNIX epoch can't be represented as nanoseconds in u64.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:25:31 +03:00
Seungha Yang
d134e165c5 webrtcsink: Propagate GstContext messages
Implement CustomBusStream so that NEED_CONTEXT and HAVE_CONTEXT
messages from session/discovery can be forwarded to parent
pipeline and also GstContext can be shared.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:24:38 +03:00
Seungha Yang
938d3d73b9 webrtcsink: Add support for d3d11 memory and qsvh264enc
Adding d3d11 memory and qsvh264enc support

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:24:31 +03:00
Robert Ayrapetyan
1ec74d8569 webrtcsink: fix TWCC extension adding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:24:06 +03:00
robert
105ffaa4a1 meson: Fix handling of optional deps
We were requiring the presence of all optional dependencies, such as
gstreamer-check-1.0 and gstreamer-gl-1.0, on the system, regardless of
whether the user actually requires these functionalities.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:23:55 +03:00
L. E. Segovia
59214481ae meson: Tell cargo to prefer static libraries
This fixes most, but not all, of the build errors in Windows when using
static libraries.

The ones remaining are:

- redirection of gstreamer-1.0 towards gstreamer-full-1.0
- Cairo not exporting the C++ stdlib requirement when built statically

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:23:49 +03:00
L. E. Segovia
4144cc3c17 meson: Disable plugins and related outputs if features are disabled
Previously, there was no check performed on features of plugins if these
specify GStreamer plugins. This commit adds that, and ensures that the
plugins and pkg-config targets are skipped if no outputs are to be
generated (this is already done for examples).

Closes #369

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:23:43 +03:00
L. E. Segovia
3362d16492 meson: Disable plugins and related outputs if features are disabled
Previously, there was no check performed on features of plugins if these
specify GStreamer plugins. This commit adds that, and ensures that the
plugins and pkg-config targets are skipped if no outputs are to be
generated (this is already done for examples).

Closes #369

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:23:37 +03:00
L. E. Segovia
8c1361efbf meson: Allow usage of externally overridden pkg-config
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:23:30 +03:00
Nirbheek Chauhan
d6e11f38d2 meson: Don't require Python 3.8 for cargo_wrapper.py
Documentation on gstreamer monorepo is disabled because the image we
use to build the docs only has Python 3.7

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2873

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:23:25 +03:00
Nirbheek Chauhan
0faaa20565 meson: Don't override RUSTFLAGS in the env
Meson does not add RUSTFLAGS to rustc.cmd_array(), so the effect of
this code is to override that value in the env.

This is hacky, since the env has to match during setup and compile
now, and rust_args added in the cross / native file will be ignored.
But at least it fixes this regression:

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:23:19 +03:00
Mathieu Duponchelle
3eab53be85 webrtcsink: don't forget to setup encoders for discoveries
The "encoder-setup" signal must also be emitted for the encoders
used in discovery pipelines in order for the default settings to
be applied.

This otherwise meant that for instance the x264 encoder would
use a 60 frames latency, greatly delaying startup.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:23:09 +03:00
Seungha Yang
0f2e18987b transcriberbin: Configure audioresample in front of transcriber
Allows any samplerate and make it negotiable. Fixing a scenario
where transcriberbin is configured with passthrough enabled,
(and negotiated samplerate is not supported by transcriber)
and then setting passthrough=false later during playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:21:36 +03:00
Sebastian Dröge
23e7226c94 webrtcsink: NVIDIA V4L2 encoders always require NVMM memory
And if the input is not like that then a corresponding converter must be
inserted.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1330>
2023-09-20 19:21:27 +03:00
Sebastian Dröge
8f3fed8462 meson: Update version to 0.10.11 2023-07-20 15:15:25 +03:00
Sebastian Dröge
d8db1f502d Update Cargo.lock 2023-07-20 14:43:23 +03:00
Sebastian Dröge
6393572b37 Update version to 0.10.11 2023-07-20 14:43:13 +03:00
Sebastian Dröge
8fe0388010 Update CHANGELOG.md for 0.10.11 2023-07-20 14:43:01 +03:00
Sebastian Dröge
7c5bc496b1 Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 10:12:00 +03:00
Sebastian Dröge
1526bfc399 ci: Remove omx=disabled from the documentation job
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 09:56:46 +03:00
Sebastian Dröge
3525b5c625 fmp4mux: Fix draining in chunk mode if keyframes are too late
We would create another chunk that ends after the fragment end, and
would from then on consider the stream always filled for the chunk
because it starts after the current fragment end (i.e. nothing would go
into this fragment).

This is obviously wrong because the actual fragment end moved further
ahead because of the additional chunk.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 09:53:07 +03:00
Mathieu Duponchelle
584dff7961 webrtcsink: fix pipeline when input caps contain max-framerate
GstVideoInfo uses max-framerate to compute its fps, but this leads
to issues in videorate when framerate is actually 0/1.

Fix this by stripping away max-framerate from input caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 09:53:00 +03:00
Sebastian Dröge
acff5a9394 webrtcsink: Configure only 4 threads for x264enc
More threads can cause more slices to be created, and Chrome simply falls
apart if there are more than a few slices and fails decoding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 09:52:55 +03:00
Sebastian Dröge
369e555e13 webrtcsink: Translate force-keyunit events to force-IDR action signal for NVIDIA encoders
NVIDIA's v4l2 encoder elements don't handle the force-keyunit events but
instead provide a custom action signal based API for requesting a
keyframe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 09:52:49 +03:00
Sebastian Dröge
12bb9afd81 webrtcsink: Set config-interval=-1 and aggregate-mode=zero-latency on rtph26[45]pay
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 09:52:43 +03:00
Sebastian Dröge
adb113a591 webrtcsink: Set VP8/VP9 payloader based on payloader element factory name
Instead of checking the encoder's name. There are more VP8/VP9 encoders
than the ones from the vpx plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 09:52:37 +03:00
Jan Schmidt
83a2c52f32 fallbackswitch: Change the threshold for trailing buffers
Only discard buffers on inactive pads if they are later
than the current output running time, rather than the
later timeout running time. That can mean switching
to a higher priority pad can happen quicker.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 09:52:32 +03:00
Jan Schmidt
e7f70cc228 fallbackswitch: Fix pad health calculation and notifies
Change the pad health calculation to consider a pad 'healthy'
if it has received data within the last 'timeout' window. Previously,
inactive pads were constantly flip-flopping between healthy and not
healthy depending on whether they were slightly ahead of or behind
the active pad running_time.

When the health status of a pad changes, make sure to always notify
the property, so that applications that are manually controlling
the active pad can make their switching decisions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1286>
2023-07-19 09:52:25 +03:00
Sebastian Dröge
a291a2f098 Update CHANGELOG.md for 0.10.10 2023-07-05 15:59:01 +03:00
Sebastian Dröge
72c53e8c55 Update Cargo.lock 2023-07-05 15:53:51 +03:00
Sebastian Dröge
4f78e7b92e Update versions to 0.10.10 2023-07-05 15:53:20 +03:00
Sebastian Dröge
88313fd2a5 Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:40:16 +03:00
Sebastian Dröge
698db4b13e Correctly declare 1.64 as minimum supported Rust version
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:36:57 +03:00
Vivia Nikolaidou
bbc775b8dc togglerecord: Clip segment before calculating timestamp/duration
Clipping happens in buffer time space and data.clip can modify the
buffer timestamp and duration. Move it before we calculate them in order
to make it actually have some effect.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:36:08 +03:00
yatinmaan
c5ce52852b gtk4: Add python example
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:36:08 +03:00
Vivia Nikolaidou
8f19a01fdd togglerecord: Error out if main stream buffer has no valid running time
We cannot continue with this buffer, because we cannot calculate the
time when the recording stopped or started. We also cannot safely drop
it, because that might break the stream, especially if it's encoded.
Therefore, we return an element error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:36:08 +03:00
Sebastian Dröge
0c3def8b9e webrtcink: Use correct property types for nvvideoconvert
These are enums and not plain integers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:36:08 +03:00
Sebastian Dröge
50a979d772 videofx: Minimize dependencies of the image crate
Only the basic infrastructure is needed and none of the
decoders/encoders for various image formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:36:08 +03:00
Sebastian Dröge
ce21db5171 gtk4: Fix up dependencies
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:35:56 +03:00
Sebastian Dröge
3e31c12d0f gtk4: Update to windows-sys 0.48
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:31:47 +03:00
Jayson Reis
16a1a6d4c5 gtk4: Make winegl code compilable
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:31:40 +03:00
Jayson Reis
870f7fd89b gtk4: Fix code to run on current main branch
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:31:33 +03:00
Sebastian Dröge
87dac3001a gtk4: Add support for GL on Windows
This implements all the workarounds for Windows-specific complications
that the GTK GStreamer mediafile implementation also does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1266>
2023-07-05 12:31:20 +03:00