speechmaticstranscriber: post messages with raw results

This deprecates the buffers pushed on the unsynced pads, which should
be removed prior to release.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2055>
This commit is contained in:
Mathieu Duponchelle 2025-01-30 16:55:29 +01:00 committed by GStreamer Marge Bot
parent 484275b350
commit 9da6dff1a9

View file

@ -587,6 +587,22 @@ impl TranscriberSrcPad {
gst::info!(CAT, imp = self, "Parsed translation {:?}", translation);
let s = gst::Structure::builder("speechmatics/raw")
.field("translation", &text)
.field("arrival-time", transcriber.current_running_time())
.field("language-code", &language_code)
.build();
gst::trace!(
CAT,
obj = transcriber,
"received translation event, posting message"
);
let _ = transcriber.post_message(
gst::message::Element::builder(s).src(&transcriber).build(),
);
let unsynced_pad = self.state.lock().unwrap().unsynced_pad.clone();
if let Some(unsynced_pad) = unsynced_pad {
@ -670,6 +686,31 @@ impl TranscriberSrcPad {
transcript
);
let s = gst::Structure::builder("speechmatics/raw")
.field("transcript", &text)
.field("arrival-time", transcriber.current_running_time())
.field(
"language-code",
&transcriber
.imp()
.settings
.lock()
.as_ref()
.unwrap()
.language_code,
)
.build();
gst::trace!(
CAT,
obj = transcriber,
"received transcript event, posting message"
);
let _ = transcriber.post_message(
gst::message::Element::builder(s).src(&transcriber).build(),
);
let unsynced_pad = self.state.lock().unwrap().unsynced_pad.clone();
if let Some(unsynced_pad) = unsynced_pad {