Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2021-03-07 19:22:24 +0300
committerSebastian Dröge <sebastian@centricular.com>2021-03-07 19:27:00 +0300
commitdc0c5f7611d5896f9fcfa9e141fabe02dea16ea6 (patch)
tree74d3f6c20a64a3e5fa9c1f4fcff6efb8a1d694d4 /generic
parent5dd0a23986352fa363b002c8495951e6a3593673 (diff)
Update for new #[glib::object_subclass] attribute macro
Diffstat (limited to 'generic')
-rw-r--r--generic/file/src/filesink/imp.rs13
-rw-r--r--generic/file/src/filesrc/imp.rs13
-rw-r--r--generic/sodium/src/decrypter/imp.rs6
-rw-r--r--generic/sodium/src/encrypter/imp.rs6
-rw-r--r--generic/threadshare/src/appsrc/imp.rs6
-rw-r--r--generic/threadshare/src/inputselector/imp.rs6
-rw-r--r--generic/threadshare/src/jitterbuffer/imp.rs6
-rw-r--r--generic/threadshare/src/proxy/imp.rs15
-rw-r--r--generic/threadshare/src/queue/imp.rs6
-rw-r--r--generic/threadshare/src/tcpclientsrc/imp.rs6
-rw-r--r--generic/threadshare/src/udpsink/imp.rs6
-rw-r--r--generic/threadshare/src/udpsrc/imp.rs6
-rw-r--r--generic/threadshare/tests/pad.rs10
13 files changed, 17 insertions, 88 deletions
diff --git a/generic/file/src/filesink/imp.rs b/generic/file/src/filesink/imp.rs
index 13d9015ac..87eff33c5 100644
--- a/generic/file/src/filesink/imp.rs
+++ b/generic/file/src/filesink/imp.rs
@@ -8,7 +8,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::*;
@@ -49,6 +48,7 @@ impl Default for State {
}
}
+#[derive(Default)]
pub struct FileSink {
settings: Mutex<Settings>,
state: Mutex<State>,
@@ -106,22 +106,13 @@ impl FileSink {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for FileSink {
const NAME: &'static str = "RsFileSink";
type Type = super::FileSink;
type ParentType = gst_base::BaseSink;
type Interfaces = (gst::URIHandler,);
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(Default::default()),
- }
- }
}
impl ObjectImpl for FileSink {
diff --git a/generic/file/src/filesrc/imp.rs b/generic/file/src/filesrc/imp.rs
index 742e0a17c..1abdd88ec 100644
--- a/generic/file/src/filesrc/imp.rs
+++ b/generic/file/src/filesrc/imp.rs
@@ -7,7 +7,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::*;
@@ -49,6 +48,7 @@ impl Default for State {
}
}
+#[derive(Default)]
pub struct FileSrc {
settings: Mutex<Settings>,
state: Mutex<State>,
@@ -120,22 +120,13 @@ impl FileSrc {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for FileSrc {
const NAME: &'static str = "RsFileSrc";
type Type = super::FileSrc;
type ParentType = gst_base::BaseSrc;
type Interfaces = (gst::URIHandler,);
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(Default::default()),
- }
- }
}
impl ObjectImpl for FileSrc {
diff --git a/generic/sodium/src/decrypter/imp.rs b/generic/sodium/src/decrypter/imp.rs
index 9aa80b863..adc9896d9 100644
--- a/generic/sodium/src/decrypter/imp.rs
+++ b/generic/sodium/src/decrypter/imp.rs
@@ -23,7 +23,6 @@
// SPDX-License-Identifier: MIT
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
@@ -545,15 +544,12 @@ impl Decrypter {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for Decrypter {
const NAME: &'static str = "RsSodiumDecryptor";
type Type = super::Decrypter;
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/generic/sodium/src/encrypter/imp.rs b/generic/sodium/src/encrypter/imp.rs
index 1ccb792c0..a2c7a9dfc 100644
--- a/generic/sodium/src/encrypter/imp.rs
+++ b/generic/sodium/src/encrypter/imp.rs
@@ -23,7 +23,6 @@
// SPDX-License-Identifier: MIT
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
use gst::subclass::prelude::*;
@@ -335,15 +334,12 @@ impl Encrypter {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for Encrypter {
const NAME: &'static str = "RsSodiumEncrypter";
type Type = super::Encrypter;
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/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs
index f264bb30b..c44c659d7 100644
--- a/generic/threadshare/src/appsrc/imp.rs
+++ b/generic/threadshare/src/appsrc/imp.rs
@@ -22,7 +22,6 @@ use futures::lock::Mutex as FutMutex;
use futures::prelude::*;
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
@@ -504,15 +503,12 @@ impl AppSrc {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for AppSrc {
const NAME: &'static str = "RsTsAppSrc";
type Type = super::AppSrc;
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 src_pad_handler = AppSrcPadHandler::default();
diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs
index a490a4641..c625886c3 100644
--- a/generic/threadshare/src/inputselector/imp.rs
+++ b/generic/threadshare/src/inputselector/imp.rs
@@ -20,7 +20,6 @@ use futures::future::{abortable, AbortHandle};
use futures::prelude::*;
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
@@ -391,15 +390,12 @@ impl InputSelector {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for InputSelector {
const NAME: &'static str = "RsTsInputSelector";
type Type = super::InputSelector;
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 {
Self {
diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs
index f679a03b9..1c679ea62 100644
--- a/generic/threadshare/src/jitterbuffer/imp.rs
+++ b/generic/threadshare/src/jitterbuffer/imp.rs
@@ -20,7 +20,6 @@ use futures::future::{abortable, AbortHandle, Aborted};
use futures::prelude::*;
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
@@ -1335,15 +1334,12 @@ impl JitterBuffer {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for JitterBuffer {
const NAME: &'static str = "RsTsJitterBuffer";
type Type = super::JitterBuffer;
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 sink_pad_handler = SinkHandler::default();
diff --git a/generic/threadshare/src/proxy/imp.rs b/generic/threadshare/src/proxy/imp.rs
index bc13654d4..15e5e1ba6 100644
--- a/generic/threadshare/src/proxy/imp.rs
+++ b/generic/threadshare/src/proxy/imp.rs
@@ -20,7 +20,6 @@ use futures::future::BoxFuture;
use futures::prelude::*;
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
@@ -572,15 +571,12 @@ impl ProxySink {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for ProxySink {
const NAME: &'static str = "RsTsProxySink";
type Type = super::ProxySink;
- type Interfaces = ();
type ParentType = gst::Element;
type Instance = gst::subclass::ElementInstanceStruct<Self>;
- type Class = subclass::simple::ClassStruct<Self>;
-
- glib::object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
Self {
@@ -1113,19 +1109,12 @@ impl ProxySrc {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for ProxySrc {
const NAME: &'static str = "RsTsProxySrc";
type Type = super::ProxySrc;
type ParentType = gst::Element;
- type Interfaces = ();
type Instance = gst::subclass::ElementInstanceStruct<Self>;
- type Class = subclass::simple::ClassStruct<Self>;
-
- glib::object_subclass!();
-
- fn new() -> Self {
- unreachable!()
- }
fn with_class(klass: &Self::Class) -> Self {
Self {
diff --git a/generic/threadshare/src/queue/imp.rs b/generic/threadshare/src/queue/imp.rs
index dd257cadc..3426b3c65 100644
--- a/generic/threadshare/src/queue/imp.rs
+++ b/generic/threadshare/src/queue/imp.rs
@@ -20,7 +20,6 @@ use futures::future::BoxFuture;
use futures::prelude::*;
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
@@ -692,15 +691,12 @@ impl Queue {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for Queue {
const NAME: &'static str = "RsTsQueue";
type Type = super::Queue;
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 {
Self {
diff --git a/generic/threadshare/src/tcpclientsrc/imp.rs b/generic/threadshare/src/tcpclientsrc/imp.rs
index 4b584b07e..331dbaa7e 100644
--- a/generic/threadshare/src/tcpclientsrc/imp.rs
+++ b/generic/threadshare/src/tcpclientsrc/imp.rs
@@ -21,7 +21,6 @@ use futures::lock::Mutex as FutMutex;
use futures::prelude::*;
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
@@ -545,15 +544,12 @@ impl TcpClientSrc {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for TcpClientSrc {
const NAME: &'static str = "RsTsTcpClientSrc";
type Type = super::TcpClientSrc;
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 src_pad_handler = TcpClientSrcPadHandler::default();
diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs
index ad1333bfc..477f27b84 100644
--- a/generic/threadshare/src/udpsink/imp.rs
+++ b/generic/threadshare/src/udpsink/imp.rs
@@ -21,7 +21,6 @@ use futures::lock::Mutex;
use futures::prelude::*;
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
@@ -944,15 +943,12 @@ fn try_into_socket_addr(element: &super::UdpSink, host: &str, port: i32) -> Resu
Ok(SocketAddr::new(addr, port))
}
+#[glib::object_subclass]
impl ObjectSubclass for UdpSink {
const NAME: &'static str = "RsTsUdpSink";
type Type = super::UdpSink;
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 settings = Arc::new(StdMutex::new(Settings::default()));
diff --git a/generic/threadshare/src/udpsrc/imp.rs b/generic/threadshare/src/udpsrc/imp.rs
index b8d92e143..07e9d1362 100644
--- a/generic/threadshare/src/udpsrc/imp.rs
+++ b/generic/threadshare/src/udpsrc/imp.rs
@@ -20,7 +20,6 @@ use futures::lock::Mutex as FutMutex;
use futures::prelude::*;
use glib::prelude::*;
-use glib::subclass;
use glib::subclass::prelude::*;
use gst::prelude::*;
@@ -686,15 +685,12 @@ impl UdpSrc {
}
}
+#[glib::object_subclass]
impl ObjectSubclass for UdpSrc {
const NAME: &'static str = "RsTsUdpSrc";
type Type = super::UdpSrc;
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 src_pad_handler = UdpSrcPadHandler::default();
diff --git a/generic/threadshare/tests/pad.rs b/generic/threadshare/tests/pad.rs
index d5574464e..65f27957a 100644
--- a/generic/threadshare/tests/pad.rs
+++ b/generic/threadshare/tests/pad.rs
@@ -301,15 +301,12 @@ mod imp_src {
}
}
+ #[glib::object_subclass]
impl ObjectSubclass for ElementSrcTest {
const NAME: &'static str = "TsElementSrcTest";
type Type = super::ElementSrcTest;
type ParentType = gst::Element;
- type Interfaces = ();
type Instance = gst::subclass::ElementInstanceStruct<Self>;
- type Class = glib::subclass::simple::ClassStruct<Self>;
-
- glib::object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
ElementSrcTest {
@@ -636,15 +633,12 @@ mod imp_sink {
)
});
+ #[glib::object_subclass]
impl ObjectSubclass for ElementSinkTest {
const NAME: &'static str = "TsElementSinkTest";
type Type = super::ElementSinkTest;
type ParentType = gst::Element;
- type Interfaces = ();
type Instance = gst::subclass::ElementInstanceStruct<Self>;
- type Class = glib::subclass::simple::ClassStruct<Self>;
-
- glib::object_subclass!();
fn with_class(klass: &Self::Class) -> Self {
ElementSinkTest {