utils: streamproducer: update appsrc latency upon appsink latency event

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

View file

@ -349,6 +349,7 @@ impl StreamProducer {
.is_ok()
|| latency_updated
{
gst::info!(CAT, obj = appsink, "setting new latency: {latency}");
consumer.appsrc.set_latency(latency, gst::ClockTime::NONE);
}
}
@ -626,6 +627,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
}