diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2021-03-07 19:22:24 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2021-03-07 19:27:00 +0300 |
commit | dc0c5f7611d5896f9fcfa9e141fabe02dea16ea6 (patch) | |
tree | 74d3f6c20a64a3e5fa9c1f4fcff6efb8a1d694d4 /video/closedcaption | |
parent | 5dd0a23986352fa363b002c8495951e6a3593673 (diff) |
Update for new #[glib::object_subclass] attribute macro
Diffstat (limited to 'video/closedcaption')
-rw-r--r-- | video/closedcaption/src/ccdetect/imp.rs | 14 | ||||
-rw-r--r-- | video/closedcaption/src/cea608overlay/imp.rs | 11 | ||||
-rw-r--r-- | video/closedcaption/src/cea608tott/imp.rs | 6 | ||||
-rw-r--r-- | video/closedcaption/src/mcc_enc/imp.rs | 6 | ||||
-rw-r--r-- | video/closedcaption/src/mcc_parse/imp.rs | 6 | ||||
-rw-r--r-- | video/closedcaption/src/scc_enc/imp.rs | 6 | ||||
-rw-r--r-- | video/closedcaption/src/scc_parse/imp.rs | 6 | ||||
-rw-r--r-- | video/closedcaption/src/tttocea608/imp.rs | 6 | ||||
-rw-r--r-- | video/closedcaption/src/tttojson/imp.rs | 6 |
9 files changed, 15 insertions, 52 deletions
diff --git a/video/closedcaption/src/ccdetect/imp.rs b/video/closedcaption/src/ccdetect/imp.rs index 597dbf35f..da7cd8063 100644 --- a/video/closedcaption/src/ccdetect/imp.rs +++ b/video/closedcaption/src/ccdetect/imp.rs @@ -15,7 +15,6 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -70,6 +69,7 @@ struct State { last_cc708_change: gst::ClockTime, } +#[derive(Default)] pub struct CCDetect { settings: Mutex<Settings>, state: Mutex<Option<State>>, @@ -214,22 +214,12 @@ impl CCDetect { } } +#[glib::object_subclass] impl ObjectSubclass for CCDetect { const NAME: &'static str = "CCDetect"; type Type = super::CCDetect; type ParentType = gst_base::BaseTransform; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); - - fn new() -> Self { - Self { - settings: Mutex::new(Default::default()), - state: Mutex::new(None), - } - } } impl ObjectImpl for CCDetect { diff --git a/video/closedcaption/src/cea608overlay/imp.rs b/video/closedcaption/src/cea608overlay/imp.rs index 4e6d153da..e9afe2701 100644 --- a/video/closedcaption/src/cea608overlay/imp.rs +++ b/video/closedcaption/src/cea608overlay/imp.rs @@ -15,7 +15,6 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -436,10 +435,15 @@ impl Cea608Overlay { self.negotiate(element, &mut state)?; } + for meta in buffer.iter_meta::<gst_video::VideoTimeCodeMeta>() { + println!("timecode {}", meta.get_tc()); + } + for meta in buffer.iter_meta::<gst_video::VideoCaptionMeta>() { if meta.get_caption_type() == gst_video::VideoCaptionType::Cea708Cdp { match extract_cdp(meta.get_data()) { Ok(data) => { + println!("meh {:?}", meta.get_data()); self.decode_cc_data(pad, element, &mut state, data); } Err(e) => { @@ -536,15 +540,12 @@ impl Cea608Overlay { } } +#[glib::object_subclass] impl ObjectSubclass for Cea608Overlay { const NAME: &'static str = "RsCea608Overlay"; type Type = super::Cea608Overlay; type ParentType = gst::Element; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); diff --git a/video/closedcaption/src/cea608tott/imp.rs b/video/closedcaption/src/cea608tott/imp.rs index cbd4e35cd..79e7f2592 100644 --- a/video/closedcaption/src/cea608tott/imp.rs +++ b/video/closedcaption/src/cea608tott/imp.rs @@ -6,7 +6,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -371,15 +370,12 @@ impl Cea608ToTt { } } +#[glib::object_subclass] impl ObjectSubclass for Cea608ToTt { const NAME: &'static str = "Cea608ToTt"; type Type = super::Cea608ToTt; type ParentType = gst::Element; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); diff --git a/video/closedcaption/src/mcc_enc/imp.rs b/video/closedcaption/src/mcc_enc/imp.rs index 76a1792ad..7aa4cf4ad 100644 --- a/video/closedcaption/src/mcc_enc/imp.rs +++ b/video/closedcaption/src/mcc_enc/imp.rs @@ -16,7 +16,6 @@ // Boston, MA 02110-1335, USA. use glib::prelude::*; -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::structure; @@ -445,15 +444,12 @@ impl MccEnc { } } +#[glib::object_subclass] impl ObjectSubclass for MccEnc { const NAME: &'static str = "RsMccEnc"; type Type = super::MccEnc; type ParentType = gst::Element; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs index 2c35b33bf..691a2ae6c 100644 --- a/video/closedcaption/src/mcc_parse/imp.rs +++ b/video/closedcaption/src/mcc_parse/imp.rs @@ -16,7 +16,6 @@ // Boston, MA 02110-1335, USA. use glib::prelude::*; -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -1118,15 +1117,12 @@ impl MccParse { } } +#[glib::object_subclass] impl ObjectSubclass for MccParse { const NAME: &'static str = "RsMccParse"; type Type = super::MccParse; type ParentType = gst::Element; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); diff --git a/video/closedcaption/src/scc_enc/imp.rs b/video/closedcaption/src/scc_enc/imp.rs index caca4d0d5..8bb1a45b7 100644 --- a/video/closedcaption/src/scc_enc/imp.rs +++ b/video/closedcaption/src/scc_enc/imp.rs @@ -16,7 +16,6 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::structure; @@ -333,15 +332,12 @@ impl SccEnc { } } +#[glib::object_subclass] impl ObjectSubclass for SccEnc { const NAME: &'static str = "RsSccEnc"; type Type = super::SccEnc; type ParentType = gst::Element; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs index 8f5a2d576..eda5b663f 100644 --- a/video/closedcaption/src/scc_parse/imp.rs +++ b/video/closedcaption/src/scc_parse/imp.rs @@ -16,7 +16,6 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -998,15 +997,12 @@ impl SccParse { } } +#[glib::object_subclass] impl ObjectSubclass for SccParse { const NAME: &'static str = "RsSccParse"; type Type = super::SccParse; type ParentType = gst::Element; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); diff --git a/video/closedcaption/src/tttocea608/imp.rs b/video/closedcaption/src/tttocea608/imp.rs index f6d61d539..facb9a9db 100644 --- a/video/closedcaption/src/tttocea608/imp.rs +++ b/video/closedcaption/src/tttocea608/imp.rs @@ -16,7 +16,6 @@ // Boston, MA 02110-1335, USA. use glib::prelude::*; -use glib::subclass; use glib::subclass::prelude::*; use gst::prelude::*; use gst::subclass::prelude::*; @@ -975,15 +974,12 @@ impl TtToCea608 { } } +#[glib::object_subclass] impl ObjectSubclass for TtToCea608 { const NAME: &'static str = "TtToCea608"; type Type = super::TtToCea608; type ParentType = gst::Element; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); diff --git a/video/closedcaption/src/tttojson/imp.rs b/video/closedcaption/src/tttojson/imp.rs index f7e4df7dd..76cac1c7e 100644 --- a/video/closedcaption/src/tttojson/imp.rs +++ b/video/closedcaption/src/tttojson/imp.rs @@ -15,7 +15,6 @@ // Free Software Foundation, Inc., 51 Franklin Street, Suite 500, // Boston, MA 02110-1335, USA. -use glib::subclass; use glib::subclass::prelude::*; use gst::gst_log; use gst::prelude::*; @@ -188,15 +187,12 @@ impl ElementImpl for TtToJson { } } +#[glib::object_subclass] impl ObjectSubclass for TtToJson { const NAME: &'static str = "RsTtToJson"; type Type = super::TtToJson; type ParentType = gst::Element; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); fn with_class(klass: &Self::Class) -> Self { let templ = klass.get_pad_template("sink").unwrap(); |