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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1774>
This commit is contained in:
Sebastian Dröge 2024-09-16 13:56:14 +03:00 committed by GStreamer Marge Bot
parent 7905626a5f
commit 29b54ed2fc

View file

@ -90,9 +90,8 @@ struct State {
n_frames: u64, n_frames: u64,
} }
#[derive(Default)]
pub struct Cea708Mux { pub struct Cea708Mux {
srcpad: gst_base::AggregatorPad,
state: Mutex<State>, state: Mutex<State>,
} }
@ -345,7 +344,7 @@ impl AggregatorImpl for Cea708Mux {
self.finish_buffer(buf) self.finish_buffer(buf)
} else { } else {
self.srcpad.push_event( self.obj().src_pad().push_event(
gst::event::Gap::builder(start_running_time) gst::event::Gap::builder(start_running_time)
.duration(duration) .duration(duration)
.build(), .build(),
@ -572,19 +571,6 @@ impl ObjectSubclass for Cea708Mux {
const NAME: &'static str = "GstCea708Mux"; const NAME: &'static str = "GstCea708Mux";
type Type = super::Cea708Mux; type Type = super::Cea708Mux;
type ParentType = gst_base::Aggregator; 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::<gst_base::AggregatorPad>()
.expect("Not a GstAggregatorPad?!");
Self {
srcpad,
state: Mutex::new(State::default()),
}
}
} }
#[derive(Default)] #[derive(Default)]