transcriberbin: forward sticky events on unsynced source pads

This way an application can tell the language code right away at
pad-added time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2029>
This commit is contained in:
Mathieu Duponchelle 2025-01-07 18:12:39 +01:00 committed by GStreamer Marge Bot
parent c51a65d973
commit cf40739da9

View file

@ -2645,6 +2645,23 @@ impl TranscriberSinkPadState {
state.internal_bin.add_pad(&srcpad)?;
let srcpad = gst::GhostPad::with_target(&srcpad).unwrap();
srcpad.set_active(true).unwrap();
unsynced_pad.sticky_events_foreach(|event| {
if event.type_() == gst::EventType::Tag
|| event.type_() == gst::EventType::StreamStart
{
gst::debug!(
CAT,
obj = srcpad,
"Storing {event:?} on unsynced source pad"
);
let _ = srcpad.store_sticky_event(event);
}
std::ops::ControlFlow::Continue(gst::EventForeachAction::Keep)
});
topbin.add_pad(&srcpad)?;
}