transcriberbin: support both latency and transcribe-latency properties

Also don't set translate-latency property if not present

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1831>
This commit is contained in:
Mathieu Duponchelle 2024-10-01 16:33:40 +02:00 committed by GStreamer Marge Bot
parent 8fae519c8d
commit 5eccb180be

View file

@ -513,10 +513,17 @@ impl TranscriberBin {
if let Some(ref transcriber) = pad_state.transcriber { if let Some(ref transcriber) = pad_state.transcriber {
let latency_ms = settings.latency.mseconds() as u32; let latency_ms = settings.latency.mseconds() as u32;
transcriber.set_property("transcribe-latency", latency_ms);
let translate_latency_ms = settings.translate_latency.mseconds() as u32; if transcriber.has_property("transcribe-latency", None) {
transcriber.set_property("translate-latency", translate_latency_ms); transcriber.set_property("transcribe-latency", latency_ms);
} else if transcriber.has_property("latency", None) {
transcriber.set_property("latency", latency_ms);
}
if transcriber.has_property("translate-latency", None) {
let translate_latency_ms = settings.translate_latency.mseconds() as u32;
transcriber.set_property("translate-latency", translate_latency_ms);
}
} }
pad_state pad_state
.queue_passthrough .queue_passthrough