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/dav1d | |
parent | 5dd0a23986352fa363b002c8495951e6a3593673 (diff) |
Update for new #[glib::object_subclass] attribute macro
Diffstat (limited to 'video/dav1d')
-rw-r--r-- | video/dav1d/src/dav1ddec/imp.rs | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs index b2b6c9f10..b9b803ec7 100644 --- a/video/dav1d/src/dav1ddec/imp.rs +++ b/video/dav1d/src/dav1ddec/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::*; @@ -21,6 +20,7 @@ use std::i32; use std::str::FromStr; use std::sync::Mutex; +#[derive(Default)] struct NegotiationInfos { input_state: Option<gst_video::VideoCodecState<'static, gst_video::video_codec_state::Readable>>, @@ -28,6 +28,7 @@ struct NegotiationInfos { video_meta_supported: bool, } +#[derive(Default)] pub struct Dav1dDec { decoder: Mutex<dav1d::Decoder>, negotiation_infos: Mutex<NegotiationInfos>, @@ -345,26 +346,12 @@ fn video_output_formats() -> Vec<glib::SendValue> { values.iter().map(|i| i.to_str().to_send_value()).collect() } +#[glib::object_subclass] impl ObjectSubclass for Dav1dDec { const NAME: &'static str = "RsDav1dDec"; type Type = super::Dav1dDec; 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 { - decoder: Mutex::new(dav1d::Decoder::new()), - negotiation_infos: Mutex::new(NegotiationInfos { - input_state: None, - output_info: None, - video_meta_supported: false, - }), - } - } } impl ObjectImpl for Dav1dDec {} |