mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
transcriberbin: Fix mux-method=cea708
* Update "translation-languages" property to include G_PARAM_CONSTRUCT so that it can be applied to initial state. * Change default "translation-languages" value to be None instead of cea608 specific one. Transcriberbin will be able to configure initia state depending on selected mux method if "translation-languages" is unspecified. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1589>
This commit is contained in:
parent
45800d7636
commit
ebdcc403cf
2 changed files with 16 additions and 18 deletions
|
@ -6152,7 +6152,7 @@
|
|||
"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,
|
||||
"construct": false,
|
||||
"construct": true,
|
||||
"construct-only": false,
|
||||
"controllable": false,
|
||||
"default": "languages, transcript=(string)cc1;",
|
||||
|
|
|
@ -1248,6 +1248,7 @@ impl ObjectImpl for TranscriberBin {
|
|||
glib::ParamSpecBoxed::builder::<gst::Structure>("translation-languages")
|
||||
.nick("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")
|
||||
.construct()
|
||||
.mutable_playing()
|
||||
.build(),
|
||||
glib::ParamSpecUInt::builder("translate-latency")
|
||||
|
@ -1754,11 +1755,7 @@ struct TranscriberSinkPadSettings {
|
|||
impl Default for TranscriberSinkPadSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
translation_languages: Some(
|
||||
gst::Structure::builder("languages")
|
||||
.field("transcript", "cc1")
|
||||
.build(),
|
||||
),
|
||||
translation_languages: None,
|
||||
language_code: String::from(DEFAULT_INPUT_LANG_CODE),
|
||||
mode: DEFAULT_MODE,
|
||||
}
|
||||
|
@ -1857,19 +1854,20 @@ impl ObjectImpl for TranscriberSinkPad {
|
|||
fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
|
||||
match pspec.name() {
|
||||
"translation-languages" => {
|
||||
if let Some(this) = self.obj().parent().and_downcast::<super::TranscriberBin>() {
|
||||
let mut settings = self.settings.lock().unwrap();
|
||||
settings.translation_languages = value
|
||||
.get::<Option<gst::Structure>>()
|
||||
.expect("type checked upstream");
|
||||
gst::debug!(
|
||||
CAT,
|
||||
imp: self,
|
||||
"Updated translation-languages {:?}",
|
||||
settings.translation_languages
|
||||
);
|
||||
drop(settings);
|
||||
let mut settings = self.settings.lock().unwrap();
|
||||
settings.translation_languages = value
|
||||
.get::<Option<gst::Structure>>()
|
||||
.expect("type checked upstream");
|
||||
gst::debug!(
|
||||
CAT,
|
||||
imp: self,
|
||||
"Updated translation-languages {:?}",
|
||||
settings.translation_languages
|
||||
);
|
||||
|
||||
drop(settings);
|
||||
|
||||
if let Some(this) = self.obj().parent().and_downcast::<super::TranscriberBin>() {
|
||||
this.imp().update_languages(&self.obj(), false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue