Commit graph

400 commits

Author SHA1 Message Date
Jan Alexander Steffens (heftig) 33696a8aed livesync: Only resend segment if not in single-segment mode
In single-segment mode, the outgoing segment does not change when the
incoming segment changes. We only need to resend the segment if we got
flushed or deactivated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1069>
2023-01-30 15:37:00 +00:00
Sebastian Dröge c7209dbd4f Return exit code from gio::Application::run() from main()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1065>
2023-01-27 18:50:01 +00: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
Guillaume Desmottes 570eb7463a livesync: fix late-threshold property min value
The code is handling 0 as "always over threshold" but it was not
possible to set the property to 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1049>
2023-01-17 10:54:05 +01:00
Sebastian Dröge 4464bf2eaa Update for gtk::Application constructor API changes 2023-01-16 11:51:10 +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 620ba6e185 livesync: Fix version 2022-12-16 18:53:37 +02:00
Jan Alexander Steffens (heftig) 42385c81be Add livesync plugin
It attempts to produce a (nearly) gapless live stream by synchronizing
its output to the running time and forwarding the next input buffer if
its start is (nearly) flush with the end of the last output buffer.

If the input buffer is missing or too far in the future, it duplicates
the last output buffer with adjusted timestamps. If it is operating on a
raw audio stream, it will fill duplicate buffers with silence.

If an input buffer arrives too late, it is thrown away. If the last
input buffer was accepted too long ago (according to `late-threshold`),
a late input buffer is accepted anyway, but immediately considered a
duplicate. Due to the silence-filling, this has no effect on audio, but
video gets a "slideshow" effect instead of freezing completely.

The "many-repeats" property will be notified when this element has
recently duplicated a lot of buffers or recovered from such a state.

Co-authored-by: Vivia Nikolaidou <vivia@ahiru.eu>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/708>
2022-12-14 18:51:36 +02:00
Sebastian Dröge 3f904553ea Fix various new clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1011>
2022-12-13 11:43:16 +02:00
Sebastian Dröge 45fa946e8b tracer: buffer-lateness: Fix compilation after minor API change 2022-11-22 10:39:32 +02:00
Sebastian Dröge a8250abbf1 Fix various new clippy warnings 2022-11-01 10:27:48 +02:00
Sebastian Dröge f2223cf2cb Update versions to 0.10.0-alpha.1 2022-10-24 19:31:19 +03: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 20ad9175d8 Make GStreamer plugin/crate/library/directory names and descriptions consistent
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/238
2022-10-23 20:25: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
Vivia Nikolaidou 9b1361b538 plugins: Use .into() instead of gst::Fraction::new() where applicable 2022-10-14 18:21:28 +03:00
Vivia Nikolaidou f11b0fa5eb plugins, examples, tutorials: Use AudioCapsBuilder and VideoCapsBuilder
Simplify caps creation code
2022-10-13 19:24:57 +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
François Laignel 7818ac658b Use GFV::none_for_format where applicable 2022-10-08 18:29:10 +02: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
Nirbheek Chauhan 1d4d3e4cb0 build: Update versions to be 0.9.0-alpha.1
0.9.0 is the next release, so we can't name things that already.

Also the version in meson.build was 0.13.0, which is completely wrong.
2022-10-04 21:27:23 +05:30
Sebastian Dröge f66aafb039 tracers: queue-levels: Update for gst::TracerImpl API changes 2022-10-02 11:44:34 +03:00
Sebastian Dröge 4ba4b00235 examples: Update to clap 4 2022-09-29 09:48:53 +03:00
Sebastian Dröge 7479888200 uriplaylistbin: Port example from structopt to clap 2022-09-27 13:30:38 +03: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
Sebastian Dröge b6ebad2761 fallbackswitch: Fix lock order problem between state and stream lock
The order is first stream lock, then state lock. Everything else can
lead to deadlocks.
2022-09-27 12:54:21 +03:00
Thibault Saunier adb4cb8691 tracers: Fix documentation comment using gtk-doc style
So the online documentation works
2022-09-24 16:30:50 -03:00
Jordan Petridis d8e3894209 togglerecord: Port example to GTK 4 2022-09-05 11:47:37 +03:00
Jordan Petridis a60f4e9ae8 fallbackswitch: Port the example to GTK 4 2022-09-05 11:47:28 +03:00
Sebastian Dröge 1a40186485 Update for GLib ParamSpec builder API changes 2022-09-05 11:45:47 +03:00
Sebastian Dröge 46dddaf31c Update minimum supported Rust version to 1.63 2022-09-04 21:31:55 +03:00
Thibault Saunier 67e651f57c Allow "unused_doc_comments" as we use hotdoc and not rustdoc 2022-08-29 18:33:22 -04:00
Thibault Saunier 31a53bba8a Generate plugins documentation using hotdoc
Which will automatically be integrated in gstreamer documentation
2022-08-29 18:33:22 -04:00
Vivia Nikolaidou 5606111345 plugins: Simplify code using ParamSpecBuilder 2022-08-22 17:58:43 +03:00
Sebastian Dröge 374bb8323f Fix build after glib SignalBuilder::param_types() API change 2022-08-17 23:37:39 +03:00
Sebastian Dröge 2a54d57968 tracers: queue_levels.py: cycle colors
Fix crash when drawing more dataset than the number of colors.
2022-08-11 09:34:46 +00:00
Seungha Yang a9a41a54be tracers: Enable PipelineSnapshot only for unix target
This implementation does not support the other targets
(it uses SIGUSR1 which does not exist on Windows)
and would not be compiled
2022-08-09 11:47:02 +00:00
Guillaume Desmottes 7eea27aefc tracers: buffer_lateness.py: cycle colors
Fix crash when drawing more dataset than the number of colors.

Fix #221
2022-08-09 13:13:14 +02:00
Bilal Elmoussaoui 52973d975e Update per glib::SignalBuilder changes 2022-07-21 20:03:13 +02:00
Sebastian Dröge 7d666ce517 tracers: queue-levels: Fix analysis script if only a single plot should be created 2022-07-21 12:26:22 +03:00
Sebastian Dröge a45443251b tracers: queue-levels: Add support for multiqueue and queue2
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/218
2022-07-21 12:26:22 +03:00
Guillaume Desmottes fe210a5715 tracers: queue_levels: log when file is being written
Help debugging when nothing is generated.
2022-07-20 17:05:29 +02:00
Guillaume Desmottes bdd47d69ce tracers: buffer_lateness: log when file is being written
Help debugging when nothing is generated.
2022-07-20 16:37:49 +02:00
Sebastian Dröge 02990f8fcc tracers: queue-levels: Output bytes/buffers/time graphs in separate plots
Much easier to read.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/220
2022-07-20 16:03:51 +03:00
Sebastian Dröge 320cb73527 tracers: Add new tracer for logging the lateness of each buffer when it leaves a pad 2022-07-19 18:03:40 +03:00
Sebastian Dröge 2f987b09ee tracers: Add queue levels tracer and Python script for plotting 2022-07-19 18:03:40 +03:00
François Laignel 5c5c15d36a Simplify Formatted value handling
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1059
2022-07-11 21:21:54 +02:00
Sebastian Dröge cb84206457 Fix a couple of new 1.62 clippy warnings 2022-06-28 14:52:20 +03:00
Sebastian Dröge 5dac064a49 fallbackswitch: Remove unused libc dependency/feature 2022-06-15 09:48:19 +03:00
Mathieu Duponchelle abf872130a fallbackswitch: fix gap processing regression
This was broken by the rewrite, receiving gaps on the main pad
should let the position progress, reset timeouts and keep the main
pad active.

This picks the simplest solution, transforming gap events into GAP
buffers and letting them go through chain(), this achieves the desired
effect.
2022-06-15 06:21:04 +00:00
Sebastian Dröge 427ebcd759 uriplaylistbin: Update to more-asserts 0.3 2022-06-06 11:55:52 +03:00
Seungha Yang 4072f1df34 fallbacksrc: Add fallback-{audio,video}-caps properties
Add new properties so that user can specify output raw audio and/or
video format of fallback stream (output of testsrc or still image)
2022-06-03 13:18:38 +00:00
Jan Alexander Steffens (heftig) a5dd92f479
fallbackswitch: Reset timeout_clock_id on timeout
We shouldn't leave the used clock ID around. Otherwise, we might never
schedule a new timeout from an inactive pad if the active pad doesn't
get a buffer.
2022-06-02 11:07:20 +02:00
Jan Alexander Steffens (heftig) 90ad761d83
fallbackswitch: Use cancel_timeout in schedule_timeout
Dedupe the code and use the function that does the exact same thing.
2022-06-02 11:07:20 +02:00
Guillaume Desmottes 0dd0acd738 uriplaylistbin: disable more tests
Those are not reliable either.
2022-05-30 09:23:52 +02:00
Jan Alexander Steffens (heftig) 68c55ca413
fallbackswitch: Recheck active_sinkpad after schedule_timeout
`schedule_timeout` can synchronously call `handle_timeout` and change the
active pad. We need to update `is_active` afterwards.

After calling `schedule_timeout` with `end_running_time`, we used to
assume there was no pad switch and reset `switched_pad` immediately. If
the pad actually got switched, this would make us miss a sticky events
update.
2022-05-25 17:53:55 +02:00
Guillaume Desmottes 351453c132 add snapshotting tracer
Convenient tracer to dump all the existing pipelines when receiving the
SIGUSR1 Unix signal.
2022-05-23 13:52:52 +02:00
Jan Alexander Steffens (heftig) d27e279272
fallbackswitch: Move active_sinkpad out of State into its own Mutex
As described in issue #200, we hold the srcpad's stream lock in some
situations where we notify the `active-pad` property.

If there's a handler installed it will most likely attempt to read the
property, which had to take the `state` lock. Another thread could
already be holding this lock and attempting to obtain the srcpad's
stream lock. This resulted in a deadlock.

To avoid this, move the `active_sinkpad` field into its own Mutex, which
we never hold for long.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/200
2022-05-12 16:52:07 +02:00
Guillaume Desmottes d69b4edfbc uriplaylistbin: fix number of streaming items
One more item than intended was allowed.
2022-04-22 14:50:42 +02:00
Guillaume Desmottes 03fcc2cb9a uriplaylistbin: implement Debug on State
Help debugging.
2022-04-22 14:50:28 +02:00
Vivia Nikolaidou 385a983e5f fallbackswitch: Fix racy manual switching test
The element has a small race condition where it might output two buffers
with the same running time during e.g. a manual switch. In practice this
is not a problem, so the test takes this race into account.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/195
2022-04-18 16:13:00 +03:00
Sebastian Dröge e82678586f fallbackswitch: Remove a redundant pad state unlock/lock 2022-04-14 08:14:26 +00:00
Sebastian Dröge 279dd7d053 fallbackswitch: Set end running time as current running time once a buffer has passed 2022-04-14 08:14:26 +00:00
Sebastian Dröge 4aa00c9eca fallbackswitch: Don't configure a framerate in the test
The tests assume that buffers have no known duration and would deadlock
otherwise because timeouts are scheduled to the end of a buffer.
2022-04-14 08:14:26 +00:00
Sebastian Dröge f5260f9b36 fallbackswitch: Explictly set priority of pads in the test 2022-04-14 08:14:26 +00:00
Sebastian Dröge 0ca0d485a0 fallbackswitch: Log affected pad when scheduling buffer waiting for it 2022-04-14 08:14:26 +00:00
Sebastian Dröge d73bce2985 fallbackswitch: Only update the output running time if it's increasing 2022-04-14 08:14:26 +00:00
Sebastian Dröge 930cdca750 fallbackswitch: Only drop raw audio/video buffers if they're trailing
Otherwise this can cause decoding errors further downstream.
2022-04-14 08:14:26 +00:00
Sebastian Dröge bbb7ced95a fallbackswitch: Improve some debug outputs
Don't print "buffer buffer ...".
2022-04-14 08:14:26 +00:00
Sebastian Dröge ca7cf7dee7 fallbackswitch: Fix clipping of buffers against the output running time
To handle buffers outside the segment correctly.

Also fix debug output to print the correct value.
2022-04-14 08:14:26 +00:00
Sebastian Dröge 617a2ef49e fallbackswitch: Clip buffers against the segment
Also clip raw audio/video buffers according to the caps if they have the
relevant information in the caps, and drop raw audio samples if they're
outside the segment too.

In addition also set durations on raw audio/video buffers based on the
caps if no duration is set.
2022-04-14 08:14:26 +00:00
Sebastian Dröge 6ce523a7a8 fallbackswitch: Improve debug output of clock times and simplify some code 2022-04-14 08:14:26 +00:00
Guillaume Desmottes 5004479c6f uriplaylistbin: disable more tests
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/194
2022-04-13 07:55:27 +00:00
Seungha Yang 930cc41aaa fallbacksrc: Don't forward manual flush events to downstream
fallbackswitch might forward flush event if it's for the currently
active pad. But forwarded flush event will be problematic in various
reasons and that's not a behavior we expected.
2022-04-12 23:21:32 +09:00
Sebastian Dröge 5788837fb6 fallbacksrc: Unflush downstream pads of the source after shutting down everything
Otherwise the pads might still be flushing on the next try and the
source would never recover.
2022-04-12 14:40:08 +03:00
Sebastian Dröge 7233d6936c fallbacksrc: Remove imagefreeze if it becomes unneeded 2022-04-12 14:37:29 +03:00
Vivia Nikolaidou de936f42e9 fallbackswitch: Minor cleanup in get_sync_time 2022-04-11 15:57:20 +03:00
Sebastian Dröge 3de317b3c9 fallbacksrc: Don't panic when shutting down the source and there are source pad blocks but no actual source pads
This can happen if the source removed the actual source pad already but
our downstream pad that is blocked still exists.
2022-04-11 11:01:27 +00:00
Sebastian Dröge 84402f39ef fallbacksrc: Reset state in fallbacksrc custom source also if changing the state to READY before failed
Otherwise it will panic on the next try because always pads are already
linked to the ghostpads.
2022-04-11 11:01:27 +00:00
Vivia Nikolaidou 0ba6ebb10f fallbackswitch: Notify active-pad without state lock held
Can otherwise deadlock.
2022-04-11 10:48:28 +00:00
Sebastian Dröge 08379ab389 fallbacksrc: Request the main pad first from fallbackswitch
By default the first created pad is the active one before the
fallbackswitch is actually processing data.
2022-04-08 20:24:03 +03:00
Sebastian Dröge 96c28a5728 fallbackswitch: Only notify active-pad property on state changes if it actually changed 2022-04-08 20:23:28 +03:00
Sebastian Dröge 452ea76a69 fallbackswitch: Rename debug category from fallback-switch to fallbackswitch
The element name is without hyphen so the debug category should ideally
too to reduce confusion.
2022-04-08 20:07:01 +03:00
Sebastian Dröge d3d98c73ca fallbacksrc: Connect to notify::active-pad after requesting pads
Requesting the first pad will emit the property because the first pad is
then selected. That will cause the callback to be called, which tries to
take the same mutex that is already locked during element setup and
causes a deadlock.
2022-04-08 19:53:38 +03:00
Guillaume Desmottes 7daab76f17 uriplaylistbin: skip missing_http test
It's not reliable.
2022-04-08 16:18:03 +02:00
Guillaume Desmottes 00b3199727 Revert "Revert "uriplaylistbin: disable test deadlocking""
This reverts commit 821ec857e1.

Looks like the test is still unreliable. :(
2022-04-08 16:16:05 +02:00
Guillaume Desmottes cde5fdf202 uriplaylistbin: break reference cycle
Passing ownership of item to the probe callback was introducing a reference cycle as the item is owning the sinkpad.
2022-04-08 15:50:48 +02:00
Guillaume Desmottes ffdcc8167c uriplaylistbin: remove useless uridecodebin clone 2022-04-08 15:50:48 +02:00
Guillaume Desmottes 821ec857e1 Revert "uriplaylistbin: disable test deadlocking"
This reverts commit d9f3e8e9e7.

The test seems to work reliably so hopefully it's been fixed with the
latest dead lock fixes.

Fix #191
2022-04-08 12:58:13 +02:00
Guillaume Desmottes 69ceaa3a5e uriplaylistbin: add Status::ShuttingDown
Fix a race where we were trying to process new decodedin pads while the
element was being shutdown, resulting in a dead lock.
2022-04-08 12:58:13 +02:00
Guillaume Desmottes 0ed72a360d uriplaylistbin: replace errored with Status enum 2022-04-08 12:58:13 +02:00
Guillaume Desmottes 97dba9046b uridecodebin: stop using crossbeam_channel
I give up on crossbeam_channel. For some reasons some receivers are not
always unblocked and I was not able to reproduce using simpler test
cases.
Use with mpsc channels instead which are more reliable.
2022-04-08 12:58:13 +02:00
Sebastian Dröge 803e452889 Update minimum supported GStreamer version to 1.14 2022-04-07 12:41:54 +03:00
Jan Alexander Steffens (heftig) 0a3e9c81f9
fallbackswitch: Add missing requires_private 2022-04-06 11:11:25 +02:00
Jan Schmidt bd2ff494c7 fallbackswitch: Replace with priorityswitch
fallbackswitch now supports multiple sink pads, and on a timeout of the
active pad, it will automatically switch to the next lowest priority pad
that has data available.

fallbackswitch sink pads follow the `sink_%u` template and have
`priority` as a pad property.

Co-authored-by: Vivia Nikolaidou <vivia.nikolaidou@ltnglobal.com>
2022-04-05 18:52:31 +03:00
Guillaume Desmottes bf14939b9b uriplaylistbin: remove pad probe when shutting down
The previous patch was unblocking the receiver in the pad probe but
it could be blocked again as the item streaming status was not changed.
2022-04-01 11:58:50 +02:00
Guillaume Desmottes 5dab4bc502 uriplaylistbin: handle waiting items no longer being set
ab96219c19 broke some assertions as
waiting items are now unset when shutting down the element.
2022-03-28 13:02:40 +02:00
Guillaume Desmottes ab96219c19 uriplaylistbin: fix deadlock when shutting down
The probes on srcpad was not removed which was preventing the element to
reach the NULL state.
2022-03-28 10:10:42 +02:00
Guillaume Desmottes e0d05353e8 uriplaylistbin: fix race when handling topology change
Keep the state mutex during the whole decodebin pad-added callback.
Fix a race when we were checking if state.waiting_for_ss_eos was set and
it was removed before we actually processed the item.

Fix #184
2022-03-25 14:33:02 +01:00
Vivia Nikolaidou c6feb31207 Revert "fallbackswitch: Forward custom downstream events from active sinkpad"
This reverts commit 9ebbae9d27.

It works even without the change.
2022-03-22 13:11:00 +02:00
Vivia Nikolaidou 9ebbae9d27 fallbackswitch: Forward custom downstream events from active sinkpad
This will allow us to forward e.g. SCTE-35 events
2022-03-21 15:30:36 +02:00
Sebastian Dröge 4a54001aed fallbacksrc: Flush source before restarting on errors
It might still be blocked downstream for a while, e.g. in the clocksync.

Flushing does not cause any problems as fallbackswitch is not going to
forward it and will only unblock everything up to there.
2022-03-17 16:12:34 +00:00
Guillaume Desmottes 8389bff7d8 fallbackswitch: properly handle GAP events
Handle GAP events from the active pad as activity and forward
downstream.
2022-03-03 11:48:26 +01:00
Guillaume Desmottes 7b109785be fallbackswitch: factor out handle_main_timed_item()
No semantic change, I'll re-use this to handle GAP events.
2022-03-03 10:01:59 +01:00
Guillaume Desmottes 31864c9a9d fallbackswitch: add support for buffers without pts
Re-use the previously seen PTS.

Fix #186
2022-03-02 13:32:06 +01:00
Guillaume Desmottes 73cfb357c6 fallbackswitch: export GEnum used in properties
Rust applications will be able to use those directly.
2022-03-01 14:44:16 +01:00
Sebastian Dröge b38f6cc731 Remove now unnecessary Send+Sync impls for element/etc subclasses
This is now automatically implemented.
2022-02-28 18:56:58 +02:00
Guillaume Desmottes d9f3e8e9e7 uriplaylistbin: disable test deadlocking 2022-02-28 16:48:13 +01:00
Seungha Yang de2ea8a1b2 fallbacksrc: Disconnect signals on ReadyToNull
Otherwise multiple signal handlers will be connected to the source
2022-02-25 23:12:30 +09:00
Sebastian Dröge a1e2debde4 fallbacksrc: Changing the URI of the video fallback is supported in NULL state
And not just during construction.

This fixes switching from a failing video fallback to a dummy fallback,
which was added in c7fe08bf6.
2022-02-24 12:29:53 +02:00
Guillaume Desmottes 52f5dc0185 uriplaylistbin: display invalid state when panicing
Will help debugging failing tests such as #184
2022-02-22 17:29:02 +01:00
François Laignel 2cf84d5ce8 Update minimum supported Rust version to 1.57 2022-02-21 23:32:32 +01:00
François Laignel 422ea740ca Update to gst::_log_macro_
See the details:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/980
2022-02-21 20:50:01 +01:00
Sebastian Dröge 42f9f99690 Update to parking_lot 0.12 and hrtf 0.8 2022-01-31 15:20:44 +02:00
Sebastian Dröge f44b86cd30 Simplify some code around event/query views 2022-01-22 12:18:02 +02:00
Sebastian Dröge 65fcd55160 Update for event/message/query view API changes 2022-01-19 15:07:45 +02:00
Sebastian Dröge 763ad0cb18 Rename self_ variables to imp for consistency 2022-01-17 20:09:18 +02:00
Sebastian Dröge b2d0172422 Replace Foo::from_instance(foo) with foo.imp() 2022-01-17 19:36:41 +02:00
Sebastian Dröge 326449b3e6 Re-license LGPL-2.1 plugins to MPL-2
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/168
2022-01-15 21:05:11 +02:00
Sebastian Dröge 0c7764fa40 Update versions to 0.9.0 2022-01-15 20:33:49 +02:00
Sebastian Dröge ab14c50d1c Ignore clippy::non_send_fields_in_send_ty lint
It's useless in its current shape and wrongly triggering on all types.

See https://github.com/rust-lang/rust-clippy/issues/8045
2022-01-14 12:09:57 +02:00
Guillaume Desmottes 8bab034bc8 uriplaylistbin: fix license when registering plugin 2022-01-03 00:08:53 +01:00
Guillaume Desmottes b7c08933aa uriplaylistbin: add properties reporting the current state of the playlist 2021-12-22 15:26:17 +01:00
Guillaume Desmottes 9783d01a35 uriplaylistbin: prevent overflow panic with infinite playlist
enumerate() will panic if the index overflows.
2021-12-22 12:53:11 +01:00
Guillaume Desmottes 4a5815cc97 uriplaylistbin: factor out create_items() 2021-12-22 12:53:11 +01:00
François Laignel 7c909e59a9 utils/togglerecord: fix race condition in sink_chain when segment is pending
In `sink_chain` when the Segment is pending, attempting to lock
rec state could lead to a dead lock because the stream state is
already locked while the main stream state was not locked.
2021-12-20 09:01:09 +00:00
François Laignel a1c89dd17b utils/togglerecord: fix race condition checking other streams EOS state
Function `check_and_update_stream_start` checks whether other streams
reached EOS. The stream being checked might already have locked its
state. If it's about to check other streams too, this results in a
deadlock.

The problem was due to the `main_state` guard being dropped handling
event `StreamStart` checking whether the main stream is EOS:

```rust
    let main_is_eos = if let Some(main_state) = main_state {
        main_state.eos
    } else {
        false
    };
```

In the above code, `main_state` main state is comsumed and dropped
after evaluating `main_state.eos`.

This is also the case before handling event `Eos`.

This revealed another deadlock handling event `Eos` which is under
investigation.
2021-12-20 09:01:09 +00:00
Vivia Nikolaidou 2acb83da8f togglerecord: Handle stream-start event after EOS
It should restart any pending streams instead of keeping everything
EOS'd

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/622>
2021-12-14 14:34:50 +02:00
Sebastian Dröge 86021d637b fallbacksrc: Actually calculate running times of segment start/stop if the PTS is outside the segment
Previously it was just using the segment start/stop without converting
it to the corresponding running time.
2021-12-09 12:30:42 +02:00
Sebastian Dröge 66e987c174 Fix a couple of new clippy warnings 2021-12-02 22:31:52 +02:00
Sebastian Dröge 423fa0d0a9 uriplaylistbin: Remove unnecessary & to fix clippy warning 2021-12-01 15:57:45 +02:00