Commit graph

222 commits

Author SHA1 Message Date
Philippe Normand
be12c0a5f7 Fix clippy warnings after upgrade to Rust 1.77
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1512>
2024-03-21 17:33:32 +00:00
Sebastian Dröge
c0d111e2c1 utils: Update for renamed clippy lint in 1.76 2024-02-08 21:37:17 +02:00
Sebastian Dröge
92891a61e8 Fix a couple of compiler/clippy warnings with --no-default-features
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1452>
2024-02-08 13:02:55 +02:00
Sebastian Dröge
4ad101b53b Use once_cell crate directly again
The glib crate does not depend on it anymore and also does not re-export
it anymore.

Also switch some usages of OnceCell to OnceLock from std.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1441>
2024-01-31 18:07:57 +02:00
Seungha Yang
8a04a38631 fallbacksrc: Fix timeout scheduling
Other thread can schedule the timeout (e.g., unblock signal
or active pad change) while state lock is released

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1384>
2023-11-15 09:17:39 +00:00
Sebastian Dröge
16b917abb1 Update for gst::Rank API changes 2023-11-02 14:10:59 +02:00
Sebastian Dröge
855b03a9ea Use let-else instead of match for weak reference upgrades
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1375>
2023-10-30 11:34:35 +02:00
Sebastian Dröge
d468e1e4a6 Clean up usage of pad probes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1361>
2023-10-17 08:44:06 +03:00
Guillaume Desmottes
f92dc28696 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/1300>
2023-08-14 14:18:41 +02:00
Guillaume Desmottes
d3da30be6d 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/1300>
2023-08-14 13:16:37 +02:00
Guillaume Desmottes
100333c021 fallbackswitch: ensure strict ordering when taking mutexes
Should prevent deadlocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1300>
2023-08-14 13:16:37 +02:00
Sebastian Dröge
bbd3d9ffe0 Remove unnecessary mut everywhere
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1273>
2023-07-11 10:09:35 +03:00
Jan Schmidt
2abc72b606 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/1198>
2023-07-07 01:45:52 +10:00
Jan Schmidt
61e282af1a 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/1198>
2023-07-07 01:45:52 +10:00
Bilal Elmoussaoui
dd2d7d9215 Use re-exported once_cell
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1268>
2023-07-06 17:50:49 +03:00
Guillaume Desmottes
4683291c1f fallbackswitch: add 'stop-on-eos' property
Fix the following use case:
- main input of fallbackswitch is finite (a media file)
- fallback input is infinite (videotestsrc)
- main input is done and send eos, which is propagated downstream
- fallbackswitch switches to fallback, sending STREAM_START which reset
  EOS downstream (aggregator does that)
- fallback input keeps pushing buffers forever.

Solve it by adding a 'stop-on-eos' property so fallbackswitch stops
pushing property once the main input is eos.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1242>
2023-06-13 14:49:06 +02:00
Guillaume Desmottes
6ad0db2cdb fallbackswitch: remove unused SinkState::eos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1242>
2023-06-13 12:43:51 +02:00
Guillaume Desmottes
692d1bfb9e fallbackswitch: log when handling events
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1242>
2023-06-13 12:43:51 +02:00
Seungha Yang
3406e604cd fallbacksrc: Don't apply fallback-audio-caps to the main audio stream
Intended behavior is configuring audio convert/resample elements
only for the fallback stream and also fallback-audio-caps is set.
Video and image stream are doing it as intended already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1213>
2023-05-17 23:49:09 +09:00
Guillaume Desmottes
7ebf2d7a4f fallbackswitch: document the pad priority ordering
I just wasted lots of time trying to figure out why my higher priority
pad wasn't used...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1208>
2023-05-15 16:13:20 +02:00
François Laignel
7ba0073052 use Pad builders for optional name definition
Also, apply auto-naming in the following cases

* When building from a non wildcard-named template, the name of the template is
  automatically assigned to the Pad. User can override with a specific name by
  calling `name()` on the `PadBuilder`.
* When building with a target and no name was provided via the above, the
  GhostPad is named after the target.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/448
Auto-naming discussion: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1255#note_1891181

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1197>
2023-05-12 12:55:31 +02:00
Sebastian Dröge
722dba1203 fallbacksrc: Don't check caps when linking to the fallbackswitch
Downstream might have different caps requirements and linking might
fail. Instead of having linking fail, give upstream an opportunity to
reconfigure and otherwise have a normal negotiation error during data
flow.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1156>
2023-04-04 10:14:06 +00:00
Sebastian Dröge
fc5ed15af5 Update for gst::Element::link_many() and related API generalization
Specifically, get rid of now unneeded `&`.
2023-03-09 16:46:52 +02:00
Sebastian Dröge
3b4c48d9f5 Fix various new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1062>
2023-01-25 10:31:19 +02:00
Sebastian Dröge
2c386fb792 Update for various deprecated APIs 2023-01-22 20:07:26 +02:00
Sebastian Dröge
458b2386ed Update for glib API changes 2023-01-21 18:13:48 +02:00
Sebastian Dröge
6132788b02 Update for caps/structure-related string API changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1048>
2023-01-15 22:58:44 +02:00
Sebastian Dröge
d44a1a4245 Fix some clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1035>
2023-01-05 12:42:47 +02:00
Sebastian Dröge
27435ad82e Update for API changes 2023-01-05 12:33:54 +02:00
Sebastian Dröge
a8250abbf1 Fix various new clippy warnings 2022-11-01 10:27:48 +02:00
Sebastian Dröge
9a68f6e221 Move from imp.instance() to imp.obj()
It's doing the same thing and is shorter.
2022-10-23 23:08:46 +03:00
François Laignel
86776be58c Remove & for obj in log macros
This is no longer necessary.

See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1137
2022-10-23 21:22:31 +02:00
Sebastian Dröge
f045099fc1 Fix GObject type names, GStreamer debug category names and element factory names
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/198
2022-10-23 20:46:08 +03:00
Sebastian Dröge
f058a5e229 Various minor cleanups 2022-10-22 19:50:24 +03:00
François Laignel
6319d104a8 Take advantage of Into<Option<_>> args
Commit 24b7cfc8 applied changes related to nullability as declared
by gir. One consequence was that some functions signature ended up
requiring users to pass `Some(val)` when they could use `val`
before.

This commit applies changes on `gstreamer-rs` which, will honoring
the nullability stil allow users to pass `val` for the few affected
functions.

This commit also fixes the signature for `Element::request_new_pad`
which was updated upstream.
2022-10-21 11:54:24 +02:00
Seungha Yang
92266cb82c fallbacksrc: Don't configure conversion elements for normal stream
Internal conversion element can cause unexpected format/resolution
change depending negotiated result, which didn't happen before
the recent fallbacksrc update for fallback stream support.

Configure conversion objects only for fallback streams and also
fallback-{audio,video}-caps are specified, in order to keep
previous behavior.
2022-10-20 15:06:33 +00:00
Seungha Yang
fec404f87a fallbacksrc: Fix for imagefreeze framerate setup
Put imagefreeze before capsfilter so that user specified framerate
for fallback image can be applied as expected
2022-10-20 02:08:08 +09:00
Seungha Yang
1db66e5a3b fallbacksrc: Drop QoS event while pad is blocked
An element which creates QoS event might reference different
GstSegment timeline (e.g., fallback testsrc's one).
Then it can cause lots of buffers are being dropped in decoder,
because of the QoS events.

Drops the QoS event before we calculate appropriate pad offsets
from blocking pad probe.
2022-10-20 01:56:36 +09:00
Sebastian Dröge
12400b6b87 Update everything for element factory builder API changes
And set properties as part of object construction wherever it makes
sense.
2022-10-19 19:43:29 +03:00
Seungha Yang
953ae18f1d fallbacksrc: Configure clocksync
It's missed in the previous refactoring
2022-10-18 16:27:41 +00:00
Seungha Yang
3eaf29b71f fallbacksrc: Don't use fallback caps to normal stream
fallback-{audio,video}-caps should be applied only to fallback
branches
2022-10-18 16:27:41 +00:00
François Laignel
8011eadfd2 Use new format constructors
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1128
2022-10-18 10:36:59 +00:00
Sebastian Dröge
e49138516c Update for pad default functions API changes 2022-10-12 19:50:15 +03:00
Sebastian Dröge
7ee4afacf4 Change *Impl trait methods to only take &self and not Self::Type in addition 2022-10-10 15:03:25 +03:00
Sebastian Dröge
4c57a97d4d Update for glib::Object::new() API changes 2022-10-07 23:54:53 +03:00
Sebastian Dröge
0b13bfe9dc fallbacksrc: Always restart the fallback stream on EOS and make sure to EOS all streams if the main stream is EOS 2022-10-05 19:13:36 +03:00
Sebastian Dröge
9719b055c5 fallbacksrc: Retry fallback stream on errors too
It was retrying but then nonetheless handling the error as fatal.
2022-10-04 16:31:09 +00:00
Sebastian Dröge
38753b08ac fallbacksrc: Implement support for fallback streams 2022-09-27 12:56:15 +03:00
Sebastian Dröge
00411523d4 fallbackswitch: Make sure to flush/reset pads during pad (de)activation
Otherwise this can potentially deadlock or delay state changes for a
longer time.
2022-09-27 12:56:01 +03:00
Sebastian Dröge
1f7126a8a1 fallbackswitch: Flush and deactivate pads before releasing them 2022-09-27 12:56:01 +03:00