diff --git a/docs/plugins/gst_plugins_cache.json b/docs/plugins/gst_plugins_cache.json index 4e804daf..3324286a 100644 --- a/docs/plugins/gst_plugins_cache.json +++ b/docs/plugins/gst_plugins_cache.json @@ -8799,6 +8799,17 @@ "type": "GstElement", "writable": true }, + "transcription-mix-matrix": { + "blurb": "Initial transformation matrix for the transcriber audioconvert", + "conditionally-available": false, + "construct": false, + "construct-only": false, + "controllable": false, + "mutable": "ready", + "readable": true, + "type": "GstValueArray", + "writable": true + }, "translation-languages": { "blurb": "A map of language codes to caption channels, e.g. translation-languages=\"languages, transcript={CC1, 708_1}, fr={708_2, CC3}\" will map the French translation to CC1/service 1 and the original transcript to CC3/service 2", "conditionally-available": false, diff --git a/video/closedcaption/src/transcriberbin/imp.rs b/video/closedcaption/src/transcriberbin/imp.rs index 49c21b72..1d847a5a 100644 --- a/video/closedcaption/src/transcriberbin/imp.rs +++ b/video/closedcaption/src/transcriberbin/imp.rs @@ -2509,6 +2509,27 @@ impl ObjectImpl for TranscriberSinkPad { .blurb("A map of language codes to bin descriptions, e.g. synthesis-languages=\"languages, fr=awspolly\" will use the awspolly element to synthesize speech from French translations") .mutable_playing() .build(), + gst::ParamSpecArray::builder("transcription-mix-matrix") + .nick("Transcription mix matrix") + .blurb("Initial transformation matrix for the transcriber audioconvert") + .element_spec( + &gst::ParamSpecArray::builder("rows") + .nick("Rows") + .blurb("A row in the matrix") + .element_spec( + &glib::ParamSpecFloat::builder("columns") + .nick("Columns") + .blurb("A column in the matrix") + .minimum(-1.) + .maximum(1.) + .default_value(0.) + .build() + ) + .build(), + ) + .mutable_ready() + .build() + ] }); @@ -2664,6 +2685,15 @@ impl ObjectImpl for TranscriberSinkPad { } } } + "transcription-mix-matrix" => { + let mut ps = self.state.lock().unwrap(); + let Ok(pad_state) = ps.as_mut() else { + return; + }; + pad_state + .transcriber_aconv + .set_property("mix-matrix", value); + } _ => unimplemented!(), } } @@ -2697,6 +2727,16 @@ impl ObjectImpl for TranscriberSinkPad { Err(_) => None::.to_value(), } } + "transcription-mix-matrix" => { + let ps = self.state.lock().unwrap(); + match ps.as_ref() { + Ok(ps) => ps.transcriber_aconv.property_value("mix-matrix"), + Err(_) => { + let v: Vec = vec![]; + gst::Array::new(&v).to_value() + } + } + } _ => unimplemented!(), } }