From 4d75091e91b1f458f3857193e5973bb77c6bc1f2 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 20 Sep 2024 17:40:37 +0200 Subject: [PATCH] awstranscriber: post warning message with details when item is late When the latency is configured to a value that is too low, items will be pushed out with an adjusted timestamp, thus affecting synchronization. It can be useful for the application to receive details about those adjustments. Part-of: --- net/aws/src/transcriber/imp.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/net/aws/src/transcriber/imp.rs b/net/aws/src/transcriber/imp.rs index e0c30af98..3982dd862 100644 --- a/net/aws/src/transcriber/imp.rs +++ b/net/aws/src/transcriber/imp.rs @@ -1424,6 +1424,18 @@ impl TranslationPadTask { "Updating item PTS ({pts} < {last_position}), consider increasing latency", ); + let details = gst::Structure::builder("awstranscriber/late-item") + .field("original-pts", pts) + .field("last-position", last_position) + .build(); + + gst::element_warning!( + self.pad.parent(), + gst::LibraryError::Settings, + ["Late transcription item, updating PTS"], + details: details + ); + pts = last_position; // FIXME if the resulting duration is zero, we might as well not push it. duration = duration.saturating_sub(delta);