threadshare: udpsrc / tcpclientsrc: latency report

Incoming packets might be pushed up to `context-wait` late if the scheduler
just parked due to no tasks needing progress.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2387>
This commit is contained in:
François Laignel 2025-07-17 19:12:12 +02:00
parent 10ec242460
commit 79f5bc96d9
2 changed files with 8 additions and 2 deletions

View file

@ -127,7 +127,10 @@ impl PadSrcHandler for TcpClientSrcPadHandler {
use gst::QueryViewMut;
let ret = match query.view_mut() {
QueryViewMut::Latency(q) => {
q.set(false, gst::ClockTime::ZERO, gst::ClockTime::NONE);
let latency =
gst::ClockTime::try_from(imp.settings.lock().unwrap().context_wait).unwrap();
gst::debug!(CAT, obj = pad, "Reporting latency {latency}");
q.set(true, latency, gst::ClockTime::NONE);
true
}
QueryViewMut::Scheduling(q) => {

View file

@ -153,7 +153,10 @@ impl PadSrcHandler for UdpSrcPadHandler {
use gst::QueryViewMut;
let ret = match query.view_mut() {
QueryViewMut::Latency(q) => {
q.set(true, gst::ClockTime::ZERO, gst::ClockTime::NONE);
let latency =
gst::ClockTime::try_from(imp.settings.lock().unwrap().context_wait).unwrap();
gst::debug!(CAT, obj = pad, "Reporting latency {latency}");
q.set(true, latency, gst::ClockTime::NONE);
true
}
QueryViewMut::Scheduling(q) => {