Update for new GLib boxed deriving API

This commit is contained in:
Sebastian Dröge 2020-03-19 11:18:17 +02:00
parent 56895f35bc
commit cbfd80d75f
2 changed files with 6 additions and 17 deletions

View file

@ -175,7 +175,8 @@ static PROPERTIES: [subclass::Property; 11] = [
const REQWEST_CLIENT_CONTEXT: &str = "gst.reqwest.client";
#[derive(Clone, Debug)]
#[derive(Clone, Debug, GBoxed)]
#[gboxed(type_name = "ReqwestClientContext")]
struct ClientContext(Arc<ClientContextInner>);
#[derive(Debug)]
@ -183,14 +184,6 @@ struct ClientContextInner {
client: Client,
}
impl glib::subclass::boxed::BoxedType for ClientContext {
const NAME: &'static str = "ReqwestClientContext";
glib_boxed_type!();
}
glib_boxed_derive_traits!(ClientContext);
#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
enum State {

View file

@ -22,7 +22,8 @@ use futures::lock::Mutex as FutMutex;
use futures::prelude::*;
use glib;
use glib::{glib_boxed_derive_traits, glib_boxed_type, glib_object_impl, glib_object_subclass};
use glib::GBoxed;
use glib::{glib_object_impl, glib_object_subclass};
use gst;
use gst::prelude::*;
@ -439,16 +440,11 @@ enum Item {
Event(gst::Event),
}
#[derive(Clone, Debug)]
#[derive(Clone, Debug, GBoxed)]
#[gboxed(type_name = "TsTestItemSender")]
struct ItemSender {
sender: mpsc::Sender<Item>,
}
impl glib::subclass::boxed::BoxedType for ItemSender {
const NAME: &'static str = "TsTestItemSender";
glib_boxed_type!();
}
glib_boxed_derive_traits!(ItemSender);
static SINK_PROPERTIES: [glib::subclass::Property; 1] =
[glib::subclass::Property("sender", |name| {