From 29b54ed2fc3d59cc5325f092c445f94ef54174b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 16 Sep 2024 13:56:14 +0300 Subject: [PATCH] cea708mux: Don't create a separate source pad and actually push gap events downstream The aggregator base class is already creating the source pad and the source pad that was created here internally was never added to the element at all. As such all gap events pushed on it never went anywhere. Part-of: --- video/closedcaption/src/cea708mux/imp.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/video/closedcaption/src/cea708mux/imp.rs b/video/closedcaption/src/cea708mux/imp.rs index 5dcc538f..e2d604ae 100644 --- a/video/closedcaption/src/cea708mux/imp.rs +++ b/video/closedcaption/src/cea708mux/imp.rs @@ -90,9 +90,8 @@ struct State { n_frames: u64, } +#[derive(Default)] pub struct Cea708Mux { - srcpad: gst_base::AggregatorPad, - state: Mutex, } @@ -345,7 +344,7 @@ impl AggregatorImpl for Cea708Mux { self.finish_buffer(buf) } else { - self.srcpad.push_event( + self.obj().src_pad().push_event( gst::event::Gap::builder(start_running_time) .duration(duration) .build(), @@ -572,19 +571,6 @@ impl ObjectSubclass for Cea708Mux { const NAME: &'static str = "GstCea708Mux"; type Type = super::Cea708Mux; type ParentType = gst_base::Aggregator; - - fn with_class(klass: &Self::Class) -> Self { - let templ = klass.pad_template("src").unwrap(); - let srcpad = gst::Pad::builder_from_template(&templ) - .build() - .downcast::() - .expect("Not a GstAggregatorPad?!"); - - Self { - srcpad, - state: Mutex::new(State::default()), - } - } } #[derive(Default)]