mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-18 05:45:14 +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": {
|
"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",
|
"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,
|
"conditionally-available": false,
|
||||||
"construct": false,
|
"construct": true,
|
||||||
"construct-only": false,
|
"construct-only": false,
|
||||||
"controllable": false,
|
"controllable": false,
|
||||||
"default": "languages, transcript=(string)cc1;",
|
"default": "languages, transcript=(string)cc1;",
|
||||||
|
|
|
@ -1248,6 +1248,7 @@ impl ObjectImpl for TranscriberBin {
|
||||||
glib::ParamSpecBoxed::builder::<gst::Structure>("translation-languages")
|
glib::ParamSpecBoxed::builder::<gst::Structure>("translation-languages")
|
||||||
.nick("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")
|
.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()
|
.mutable_playing()
|
||||||
.build(),
|
.build(),
|
||||||
glib::ParamSpecUInt::builder("translate-latency")
|
glib::ParamSpecUInt::builder("translate-latency")
|
||||||
|
@ -1754,11 +1755,7 @@ struct TranscriberSinkPadSettings {
|
||||||
impl Default for TranscriberSinkPadSettings {
|
impl Default for TranscriberSinkPadSettings {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
translation_languages: Some(
|
translation_languages: None,
|
||||||
gst::Structure::builder("languages")
|
|
||||||
.field("transcript", "cc1")
|
|
||||||
.build(),
|
|
||||||
),
|
|
||||||
language_code: String::from(DEFAULT_INPUT_LANG_CODE),
|
language_code: String::from(DEFAULT_INPUT_LANG_CODE),
|
||||||
mode: DEFAULT_MODE,
|
mode: DEFAULT_MODE,
|
||||||
}
|
}
|
||||||
|
@ -1857,7 +1854,6 @@ impl ObjectImpl for TranscriberSinkPad {
|
||||||
fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
|
fn set_property(&self, _id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
|
||||||
match pspec.name() {
|
match pspec.name() {
|
||||||
"translation-languages" => {
|
"translation-languages" => {
|
||||||
if let Some(this) = self.obj().parent().and_downcast::<super::TranscriberBin>() {
|
|
||||||
let mut settings = self.settings.lock().unwrap();
|
let mut settings = self.settings.lock().unwrap();
|
||||||
settings.translation_languages = value
|
settings.translation_languages = value
|
||||||
.get::<Option<gst::Structure>>()
|
.get::<Option<gst::Structure>>()
|
||||||
|
@ -1868,8 +1864,10 @@ impl ObjectImpl for TranscriberSinkPad {
|
||||||
"Updated translation-languages {:?}",
|
"Updated translation-languages {:?}",
|
||||||
settings.translation_languages
|
settings.translation_languages
|
||||||
);
|
);
|
||||||
|
|
||||||
drop(settings);
|
drop(settings);
|
||||||
|
|
||||||
|
if let Some(this) = self.obj().parent().and_downcast::<super::TranscriberBin>() {
|
||||||
this.imp().update_languages(&self.obj(), false);
|
this.imp().update_languages(&self.obj(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue