diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2021-08-01 19:15:19 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2021-08-05 15:57:56 +0300 |
commit | 198301c2edcc87027593a18a0094d31be5e02ba1 (patch) | |
tree | bea3f249176893ac89cd19bb004edab28663197e | |
parent | 2092059f712441dd8804d18e818e33332d7fd6fb (diff) |
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>
-rw-r--r-- | utils/fallbackswitch/Cargo.toml | 1 | ||||
-rw-r--r-- | utils/fallbackswitch/src/fallbackswitch/imp.rs | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/utils/fallbackswitch/Cargo.toml b/utils/fallbackswitch/Cargo.toml index e196afd00..b936090e1 100644 --- a/utils/fallbackswitch/Cargo.toml +++ b/utils/fallbackswitch/Cargo.toml @@ -39,6 +39,7 @@ pkg-config = "0.3" [features] default = ["libc"] v1_18 = ["gst-base/v1_18"] +v1_20 = ["v1_18", "gst/v1_20"] # We already use 1.14 which is new enough for static build static = [] diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs index 8b059890d..618c2a506 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -963,6 +963,7 @@ impl AggregatorImpl for FallbackSwitch { Ok(()) } + #[cfg(feature = "v1_20")] fn sink_event_pre_queue( &self, agg: &Self::Type, @@ -972,9 +973,13 @@ impl AggregatorImpl for FallbackSwitch { use gst::EventView; match event.view() { - EventView::Gap(_) => { - gst_debug!(CAT, obj: agg_pad, "Dropping gap event"); - Ok(gst::FlowSuccess::Ok) + EventView::Gap(gap) => { + if gap.gap_flags().contains(gst::GapFlags::DATA) { + gst_debug!(CAT, obj: agg_pad, "Dropping gap event"); + Ok(gst::FlowSuccess::Ok) + } else { + self.parent_sink_event_pre_queue(agg, agg_pad, event) + } } _ => self.parent_sink_event_pre_queue(agg, agg_pad, event), } |