transcriberbin: Configure audioresample in front of transcriber

Allows any samplerate and make it negotiable. Fixing a scenario
where transcriberbin is configured with passthrough enabled,
(and negotiated samplerate is not supported by transcriber)
and then setting passthrough=false later during playback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1327>
This commit is contained in:
Seungha Yang 2023-07-24 22:51:07 +09:00 committed by Sebastian Dröge
parent 17f7b04b82
commit 257a0de483

View file

@ -38,6 +38,7 @@ struct State {
audio_queue_passthrough: gst::Element,
video_queue: gst::Element,
audio_tee: gst::Element,
transcriber_resample: gst::Element,
transcriber_aconv: gst::Element,
transcriber: gst::Element,
transcriber_queue: gst::Element,
@ -99,6 +100,7 @@ impl TranscriberBin {
state.transcription_bin.add_many(&[
&aqueue_transcription,
&state.transcriber_resample,
&state.transcriber_aconv,
&state.transcriber,
&state.transcriber_queue,
@ -111,6 +113,7 @@ impl TranscriberBin {
gst::Element::link_many(&[
&aqueue_transcription,
&state.transcriber_resample,
&state.transcriber_aconv,
&state.transcriber,
&state.transcriber_queue,
@ -457,6 +460,7 @@ impl TranscriberBin {
let tttocea608 = gst::ElementFactory::make("tttocea608")
.name("tttocea608")
.build()?;
let transcriber_resample = gst::ElementFactory::make("audioresample").build()?;
let transcriber_aconv = gst::ElementFactory::make("audioconvert").build()?;
let transcriber = gst::ElementFactory::make("awstranscriber")
.name("transcriber")
@ -474,6 +478,7 @@ impl TranscriberBin {
internal_bin,
audio_queue_passthrough,
video_queue,
transcriber_resample,
transcriber_aconv,
transcriber,
transcriber_queue,