From 79845fd99a7ecddad380154346e9cbbea939e05f 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 897a5428d..eee543dfc 100644 --- a/net/aws/src/transcriber/imp.rs +++ b/net/aws/src/transcriber/imp.rs @@ -1436,6 +1436,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);