transcriberbin: fix caption-source selection ..

with recent enough cccombiner.

Originally, dropping transcriptions was enough to support
caption-source=inband, as cccombiner did not implement output
scheduling.

However now that it does, even if no captions arrive on the caption pad
the combiner will still output padding.

Recent-enough combiners however expose an `input-meta-processing`
property which lets us achieve the desired behavior, we thus make use of
it when available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2115>
This commit is contained in:
Mathieu Duponchelle 2025-02-26 18:22:34 +01:00 committed by GStreamer Marge Bot
parent 4397b1e8e1
commit e31e5b2c6f

View file

@ -2620,7 +2620,25 @@ impl ObjectImpl for TranscriberBin {
let s = self.state.lock().unwrap();
if let Some(state) = s.as_ref() {
if settings.caption_source == CaptionSource::Inband {
if state.cccombiner.has_property("input-meta-processing") {
match settings.caption_source {
CaptionSource::Inband => {
state
.cccombiner
.set_property_from_str("input-meta-processing", "force");
}
CaptionSource::Both => {
state
.cccombiner
.set_property_from_str("input-meta-processing", "append");
}
CaptionSource::Transcription => {
state
.cccombiner
.set_property_from_str("input-meta-processing", "drop");
}
}
} else if settings.caption_source == CaptionSource::Inband {
gst::debug!(
CAT,
imp = self,