utils: streamproducer: update appsrc latency upon appsink latency event

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1565>
This commit is contained in:
juan.adarve 2024-10-17 15:11:52 -05:00 committed by GStreamer Marge Bot
parent b0aa32b844
commit ceea56aa72

View file

@ -327,6 +327,7 @@ impl StreamProducer {
.is_ok()
|| latency_updated
{
gst::info!(CAT, obj: appsink, "setting new latency: {latency}");
consumer.appsrc.set_latency(latency, gst::ClockTime::NONE);
}
}
@ -562,6 +563,7 @@ impl<'a> From<&'a gst_app::AppSink> for StreamProducer {
let latency = event.latency();
let mut consumers = consumers.lock().unwrap();
consumers.current_latency = Some(latency);
consumers.latency_updated = true;
gst::PadProbeReturn::Ok
}),