Commit graph

44 commits

Author SHA1 Message Date
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
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
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
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 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 86f422592b Update for glib::Enum / glib::Boxed / glib::flags! macro renames 2021-11-22 11:04:26 +02:00
Sebastian Dröge 55aad51141 Update for glib constructor renames
See https://github.com/gtk-rs/gtk-rs-core/pull/384
2021-11-20 14:31:06 +02:00
Jan Alexander Steffens (heftig) 5285fab8b3 fallbackswitch: Correct immediate-fallback default value
Only affects the claimed default in the properties, not the actual
default.
2021-11-18 21:02:54 +00:00
Sebastian Dröge d9bda62a47 Update for GLib/GStreamer API changes
And clean up a lot of related property/caps/structure code.
2021-11-06 09:34:10 +02:00
Sebastian Dröge b9541b2ca4 Update for GstObjectImpl API change 2021-10-23 12:31:33 +03:00
François Laignel 27b9f0d868 Improve usability thanks to opt-ops
The crate option-operations simplifies usage when dealing with
`Option`s, which is often the case with `ClockTime`.
2021-10-18 15:09:47 +02:00
Sebastian Dröge 54c8f5b3ab fallbackswitch: Remove bundled aggregator copy and require GStreamer 1.18
1.18 is old enough at this point and carrying around a copy of
 aggregator is not sustainable.
2021-10-17 17:35:45 +03:00
Sebastian Dröge 96d86eaa06 Clean up clippy warnings and CI configuration
Put clippy overrides into the sources files instead of the CI
configuration, and fix various warnings / clean up code.
2021-09-08 12:35:41 +00:00
Mathieu Duponchelle 19dcb8159a fallbackswitch: only drop MISSING_DATA gap events pre queue
Regular gap events can be output by sources such as cefsrc in
normal operation, and should not trigger an active pad change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/538>
2021-08-04 15:12:02 +00:00
Sebastian Dröge 052365ba1a Fix various needless-borrow clippy warnings and others 2021-07-30 13:53:35 +03:00
Mathieu Duponchelle a5a80281f3 fallbackswitch: output buffers ASAP at startup
When only the backup pad is receiving buffers, and the primary
pad is a bit slow to start up (eg network source with buffering),
it makes for a better UX to output buffers from the backup pad
while waiting for the network source to make its move.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/515>
2021-06-30 00:46:46 +00:00
François Laignel c2de0649a7 utils: migrate to new ClockTime design 2021-06-05 10:36:21 +02:00
François Laignel 8dfc872544 use gst::glib where applicable 2021-06-03 20:53:16 +02:00
Sebastian Dröge 15cf738616 Update for Value trait refactoring 2021-04-25 15:48:55 +03:00
François Laignel 67c5871957 fix-getters-calls 0.3.0 pass 2021-04-20 18:19:58 +02:00
François Laignel 27bc5c89ca fix-getters-def 0.3.0 pass 2021-04-20 18:19:58 +02:00
François Laignel 7d17f88941 post fix-getters manual updates 2021-04-13 17:24:20 +02:00
François Laignel 06accc8d98 fix-getters-{def,calls} pass 2021-04-12 15:57:19 +02:00
Sebastian Dröge 2cada57efc Update for the subclassing glib/gstreamer bindings API changes 2021-03-09 17:07:13 +02:00
Sebastian Dröge dc0c5f7611 Update for new #[glib::object_subclass] attribute macro 2021-03-07 18:27:00 +02:00
Jan Schmidt f63c4284c1 fallbackswitch: Fix draining of the backup pad.
When not autoswitching between the primary and fallback pad, make sure
to drain the disabled pad to the current running time, and fix the
drain_pad_to_time() function to use the correct running time variable.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/472>
2021-02-05 03:24:02 +11:00
Sebastian Dröge b649e9b076 Use gst::PARAM_FLAG_MUTABLE_PLAYING and others consistently everywhere
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/139
2021-01-31 15:43:00 +02:00
Sebastian Dröge d4ce1a33f2 Update for glib/gstreamer bindings API changes 2021-01-25 14:43:05 +02:00
Seungha Yang 084c9d1447 fallbackswitch,togglerecord: Don't apply clipped PTS to buffer DTS
Setting DTS on raw video buffers doesn't make sense and it's even wrong
in case of compressed video stream because PTS might be able to
go back when B frames are placed, but DTS is expected to be monotonically
increased.
2021-01-19 19:45:14 +09:00
Sebastian Dröge 3d617371af Update for macro renames 2020-12-20 20:43:45 +02:00
Sebastian Dröge ea6c05e16c Update everything for glib macro renamings 2020-12-18 00:44:49 +02:00
Jan Schmidt b80a607737 fallbackswitch: Reset fallback pad state on remove. 2020-12-11 13:02:00 +00:00
Jan Schmidt f57ce41e89 fallbackswitch: Document return parameters for get_next_buffer()
The return type for get_next_buffer() is quite complex, so add some
comments about what is what.
2020-12-11 13:02:00 +00:00
Jan Schmidt fddf33d339 fallbackswitch: Use pad as the debug object
Instead of using the aggregator as the object in debug statements
relating to pad dataflow, use the pad itself.
2020-12-11 13:02:00 +00:00
Jan Schmidt 34a2dd80a2 fallbackswitch: Move health checks to the OutputState.
Move some code to the OutputState from the fallbackswitch
struct to make things a bit cleaner.
2020-12-11 13:02:00 +00:00
Jan Schmidt 74f3de5674 fallbackswitch: Update for upstream changes 2020-12-11 13:02:00 +00:00
Jan Schmidt d5b648921c fallbackswitch: Add manual stream control mode
Add properties to report and notify on stream health changes, and
a mode where the app can control the stream switching by setting
the active-pad property manually.

This is useful for modifying the policy of fallbackswitch stream
choices, and to synchronise switching of multiple fallbackswitches
2020-12-11 13:02:00 +00:00
Sebastian Dröge 767ed3afae utils: Update to 2018 edition 2020-11-23 10:28:34 +02:00
Sebastian Dröge d56ae71e0e Update for ObjectImpl::get_property() being infallible now 2020-11-19 18:25:53 +02:00
Sebastian Dröge b021a8bf10 utils: Update for subclassing API changes 2020-11-15 18:25:42 +02:00
Renamed from utils/fallbackswitch/src/fallbackswitch.rs (Browse further)