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/cdg | |
parent | 5dd0a23986352fa363b002c8495951e6a3593673 (diff) |
Update for new #[glib::object_subclass] attribute macro
Diffstat (limited to 'video/cdg')
-rw-r--r-- | video/cdg/src/cdgdec/imp.rs | 14 | ||||
-rw-r--r-- | video/cdg/src/cdgparse/imp.rs | 11 |
2 files changed, 4 insertions, 21 deletions
diff --git a/video/cdg/src/cdgdec/imp.rs b/video/cdg/src/cdgdec/imp.rs index 4f892c42c..40cde0c62 100644 --- a/video/cdg/src/cdgdec/imp.rs +++ b/video/cdg/src/cdgdec/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::gst_debug; use gst::subclass::prelude::*; @@ -23,27 +22,18 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { gst::DebugCategory::new("cdgdec", gst::DebugColorFlags::empty(), Some("CDG decoder")) }); +#[derive(Default)] pub struct CdgDec { cdg_inter: Mutex<Box<cdg_renderer::CdgInterpreter>>, output_info: Mutex<Option<gst_video::VideoInfo>>, } +#[glib::object_subclass] impl ObjectSubclass for CdgDec { const NAME: &'static str = "CdgDec"; type Type = super::CdgDec; type ParentType = gst_video::VideoDecoder; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); - - fn new() -> Self { - Self { - cdg_inter: Mutex::new(Box::new(cdg_renderer::CdgInterpreter::new())), - output_info: Mutex::new(None), - } - } } impl ObjectImpl for CdgDec {} diff --git a/video/cdg/src/cdgparse/imp.rs b/video/cdg/src/cdgparse/imp.rs index 756dee536..6aebb708d 100644 --- a/video/cdg/src/cdgparse/imp.rs +++ b/video/cdg/src/cdgparse/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::format::Bytes; use gst::gst_debug; @@ -25,6 +24,7 @@ const CDG_CMD_MEMORY_PRESET: u8 = 1; const CDG_CMD_MEMORY_LOAD_COLOR_TABLE_1: u8 = 30; const CDG_CMD_MEMORY_LOAD_COLOR_TABLE_2: u8 = 31; +#[derive(Default)] pub struct CdgParse; static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { @@ -35,19 +35,12 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { ) }); +#[glib::object_subclass] impl ObjectSubclass for CdgParse { const NAME: &'static str = "CdgParse"; type Type = super::CdgParse; type ParentType = gst_base::BaseParse; - type Interfaces = (); type Instance = gst::subclass::ElementInstanceStruct<Self>; - type Class = subclass::simple::ClassStruct<Self>; - - glib::object_subclass!(); - - fn new() -> Self { - Self - } } impl ObjectImpl for CdgParse {} |