mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-22 07:36:20 +00:00
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:
parent
c51a65d973
commit
cf40739da9
1 changed files with 17 additions and 0 deletions
|
@ -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)?;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue