diff options
author | Seungha Yang <seungha@centricular.com> | 2023-07-24 16:51:07 +0300 |
---|---|---|
committer | Seungha Yang <seungha@centricular.com> | 2023-07-24 16:51:07 +0300 |
commit | 516c623df5b2a88b5c79e9f91fe5f62de4aeab95 (patch) | |
tree | 73d62e9c84b8609f8989de869b15d5f0f26c81b5 /video | |
parent | d4b3827efa8cf03a7e426ccd72818be8cfbe37da (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/1287>
Diffstat (limited to 'video')
-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 6e37075a4..7c7a823d3 100644 --- a/video/closedcaption/src/transcriberbin/imp.rs +++ b/video/closedcaption/src/transcriberbin/imp.rs @@ -72,6 +72,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, ccmux: gst::Element, @@ -176,6 +177,7 @@ impl TranscriberBin { state.transcription_bin.add_many([ &aqueue_transcription, + &state.transcriber_resample, &state.transcriber_aconv, &state.transcriber, &state.ccmux, @@ -187,6 +189,7 @@ impl TranscriberBin { gst::Element::link_many([ &aqueue_transcription, + &state.transcriber_resample, &state.transcriber_aconv, &state.transcriber, ])?; @@ -730,6 +733,7 @@ impl TranscriberBin { let cccombiner = gst::ElementFactory::make("cccombiner") .name("cccombiner") .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") @@ -776,6 +780,7 @@ impl TranscriberBin { internal_bin, audio_queue_passthrough, video_queue, + transcriber_resample, transcriber_aconv, transcriber, ccmux, |