diff options
author | Seungha Yang <seungha@centricular.com> | 2023-07-24 16:51:07 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2023-09-20 19:21:36 +0300 |
commit | 0f2e18987be3eb2b43e054bd7ade07f7f8361983 (patch) | |
tree | a3b8e3bff9314c5963c109e25bde6c28b30cd453 | |
parent | 23e7226c94dd4b2c86ae1844f2fb9390d7ae2317 (diff) |
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/1330>
-rw-r--r-- | video/closedcaption/src/transcriberbin/imp.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/video/closedcaption/src/transcriberbin/imp.rs b/video/closedcaption/src/transcriberbin/imp.rs index 6ecd9d085..3e8c283de 100644 --- a/video/closedcaption/src/transcriberbin/imp.rs +++ b/video/closedcaption/src/transcriberbin/imp.rs @@ -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, |