Update for removal of ObjectImpl::get_type_data()

This commit is contained in:
Sebastian Dröge 2020-07-26 18:33:14 +03:00
parent 1730de6cea
commit 0eb777cf5a
48 changed files with 77 additions and 203 deletions

View file

@ -194,8 +194,6 @@ impl ObjectSubclass for AudioEcho {
}
impl ObjectImpl for AudioEcho {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -1824,8 +1824,6 @@ impl ObjectSubclass for AudioLoudNorm {
}
impl ObjectImpl for AudioLoudNorm {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -93,9 +93,7 @@ impl ObjectSubclass for ClaxonDec {
}
}
impl ObjectImpl for ClaxonDec {
glib_object_impl!();
}
impl ObjectImpl for ClaxonDec {}
impl ElementImpl for ClaxonDec {}

View file

@ -15,9 +15,9 @@
// Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
// Boston, MA 02110-1335, USA.
use glib::glib_object_subclass;
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
use gst::{
@ -431,8 +431,6 @@ impl ObjectSubclass for CsoundFilter {
}
impl ObjectImpl for CsoundFilter {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];
match *prop {

View file

@ -92,9 +92,7 @@ impl ObjectSubclass for LewtonDec {
}
}
impl ObjectImpl for LewtonDec {
glib_object_impl!();
}
impl ObjectImpl for LewtonDec {}
impl ElementImpl for LewtonDec {}

View file

@ -159,8 +159,6 @@ impl ObjectSubclass for FileSink {
}
impl ObjectImpl for FileSink {
glib_object_impl!();
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];
match *prop {

View file

@ -173,8 +173,6 @@ impl ObjectSubclass for FileSrc {
}
impl ObjectImpl for FileSrc {
glib_object_impl!();
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];
match *prop {

View file

@ -639,8 +639,6 @@ impl ObjectSubclass for Decrypter {
}
impl ObjectImpl for Decrypter {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -470,8 +470,6 @@ impl ObjectSubclass for Encrypter {
}
impl ObjectImpl for Encrypter {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -21,10 +21,10 @@ use futures::future::BoxFuture;
use futures::lock::Mutex as FutMutex;
use futures::prelude::*;
use glib::glib_object_subclass;
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -639,8 +639,6 @@ impl ObjectSubclass for AppSrc {
}
impl ObjectImpl for AppSrc {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -19,10 +19,10 @@ use futures::future::BoxFuture;
use futures::future::{abortable, AbortHandle};
use futures::prelude::*;
use glib::glib_object_subclass;
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -481,8 +481,6 @@ impl ObjectSubclass for InputSelector {
}
impl ObjectImpl for InputSelector {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -19,10 +19,10 @@ use futures::future::BoxFuture;
use futures::future::{abortable, AbortHandle, Aborted};
use futures::prelude::*;
use glib::glib_object_subclass;
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -1494,8 +1494,6 @@ impl ObjectSubclass for JitterBuffer {
}
impl ObjectImpl for JitterBuffer {
glib_object_impl!();
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -19,10 +19,10 @@ use futures::channel::oneshot;
use futures::future::BoxFuture;
use futures::prelude::*;
use glib::glib_object_subclass;
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -693,8 +693,6 @@ impl ObjectSubclass for ProxySink {
}
impl ObjectImpl for ProxySink {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES_SINK[id];
@ -1216,8 +1214,6 @@ impl ObjectSubclass for ProxySrc {
}
impl ObjectImpl for ProxySrc {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES_SRC[id];

View file

@ -19,10 +19,10 @@ use futures::channel::oneshot;
use futures::future::BoxFuture;
use futures::prelude::*;
use glib::glib_object_subclass;
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -808,8 +808,6 @@ impl ObjectSubclass for Queue {
}
impl ObjectImpl for Queue {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -20,10 +20,10 @@ use futures::future::BoxFuture;
use futures::lock::Mutex as FutMutex;
use futures::prelude::*;
use glib::glib_object_subclass;
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -654,8 +654,6 @@ impl ObjectSubclass for TcpClientSrc {
}
impl ObjectImpl for TcpClientSrc {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -20,10 +20,10 @@ use futures::future::BoxFuture;
use futures::lock::Mutex;
use futures::prelude::*;
use glib::glib_object_subclass;
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -1305,8 +1305,6 @@ impl ObjectSubclass for UdpSink {
}
impl ObjectImpl for UdpSink {
glib_object_impl!();
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];
let element = obj.downcast_ref::<gst::Element>().unwrap();

View file

@ -19,10 +19,10 @@ use futures::future::BoxFuture;
use futures::lock::Mutex as FutMutex;
use futures::prelude::*;
use glib::glib_object_subclass;
use glib::prelude::*;
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -832,8 +832,6 @@ impl ObjectSubclass for UdpSrc {
}
impl ObjectImpl for UdpSrc {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -21,8 +21,8 @@ use futures::future::BoxFuture;
use futures::lock::Mutex as FutMutex;
use futures::prelude::*;
use glib::glib_object_subclass;
use glib::GBoxed;
use glib::{glib_object_impl, glib_object_subclass};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -336,8 +336,6 @@ impl ObjectSubclass for ElementSrcTest {
}
impl ObjectImpl for ElementSrcTest {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &SRC_PROPERTIES[id];
@ -649,8 +647,6 @@ impl ObjectSubclass for ElementSinkTest {
}
impl ObjectImpl for ElementSinkTest {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &SINK_PROPERTIES[id];

View file

@ -670,8 +670,6 @@ impl ReqwestHttpSrc {
}
impl ObjectImpl for ReqwestHttpSrc {
glib_object_impl!();
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];
match *prop {

View file

@ -1085,8 +1085,6 @@ impl ObjectSubclass for Transcriber {
}
impl ObjectImpl for Transcriber {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -418,8 +418,6 @@ impl ObjectSubclass for S3Sink {
}
impl ObjectImpl for S3Sink {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id as usize];
let mut settings = self.settings.lock().unwrap();

View file

@ -251,8 +251,6 @@ impl ObjectSubclass for S3Src {
}
impl ObjectImpl for S3Src {
glib_object_impl!();
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id as usize];
let basesrc = obj.downcast_ref::<gst_base::BaseSrc>().unwrap();

View file

@ -330,8 +330,6 @@ impl ObjectSubclass for TextWrap {
}
impl ObjectImpl for TextWrap {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -230,9 +230,6 @@ impl ObjectSubclass for Identity {
// Implementation of glib::Object virtual methods
impl ObjectImpl for Identity {
// This macro provides some boilerplate
glib_object_impl!();
// Called right after construction of a new instance
fn constructed(&self, obj: &glib::Object) {
// Call the parent class' ::constructed() implementation first

View file

@ -156,9 +156,6 @@ impl ObjectSubclass for ProgressBin {
// Implementation of glib::Object virtual methods
impl ObjectImpl for ProgressBin {
// This macro provides some boilerplate
glib_object_impl!();
// Called whenever a value of a property is changed. It can be called
// at any time from any thread.
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {

View file

@ -237,9 +237,6 @@ impl ObjectSubclass for Rgb2Gray {
// Implementation of glib::Object virtual methods
impl ObjectImpl for Rgb2Gray {
// This macro provides some boilerplate.
glib_object_impl!();
// Called whenever a value of a property is changed. It can be called
// at any time from any thread.
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {

View file

@ -280,9 +280,6 @@ impl ObjectSubclass for SineSrc {
// Implementation of glib::Object virtual methods
impl ObjectImpl for SineSrc {
// This macro provides some boilerplate.
glib_object_impl!();
// Called right after construction of a new instance
fn constructed(&self, obj: &glib::Object) {
// Call the parent class' ::constructed() implementation first

View file

@ -257,12 +257,10 @@ In the `new` function we return our empty struct.
In the `class_init` function we, again, set up some metadata for our new element. In this case these are a description, a classification of our element, a longer description and the author. The metadata can later be retrieved and made use of via the [`Registry`](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer/struct.Registry.html) and [`PluginFeature`](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer/struct.PluginFeature.html)/[`ElementFactory`](https://slomo.pages.freedesktop.org/rustdocs/gstreamer/gstreamer/struct.ElementFactory.html) API. We also configure the `BaseTransform` class and define that we will never operate in-place (producing our output in the input buffer), and that we dont want to work in passthrough mode if the input/output formats are the same.
Additionally we need to implement various traits on the Rgb2Gray struct, which will later be used to override virtual methods of the various parent classes of our element. For now we can keep the trait implementations empty, except for `ObjectImpl` trait which should simply call the `glib_object_impl!()` macro for some boilerplate code. There is one trait implementation required per parent class.
Additionally we need to implement various traits on the Rgb2Gray struct, which will later be used to override virtual methods of the various parent classes of our element. For now we can keep the trait implementations empty. There is one trait implementation required per parent class.
```rust
impl ObjectImpl for Rgb2Gray {
glib_object_impl!();
}
impl ObjectImpl for Rgb2Gray {}
impl ElementImpl for Rgb2Gray {}
impl BaseTransformImpl for Rgb2Gray {}
```
@ -287,9 +285,7 @@ impl ObjectSubclass for Rgb2Gray {
glib_object_subclass!();
}
impl ObjectImpl for Rgb2Gray {
glib_object_impl!();
}
impl ObjectImpl for Rgb2Gray {}
impl ElementImpl for Rgb2Gray {}

View file

@ -230,9 +230,6 @@ impl ObjectSubclass for SineSrc {
}
impl ObjectImpl for SineSrc {
// This macro provides some boilerplate.
glib_object_impl!();
// Called right after construction of a new instance
fn constructed(&self, obj: &glib::Object) {
// Call the parent class' ::constructed() implementation first

View file

@ -19,7 +19,7 @@ use super::super::Aggregator;
use super::super::AggregatorClass;
use super::super::AggregatorPad;
pub trait AggregatorImpl: AggregatorImplExt + ElementImpl + Send + Sync + 'static {
pub trait AggregatorImpl: AggregatorImplExt + ElementImpl {
fn flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> {
self.parent_flush(aggregator)
}
@ -98,7 +98,9 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl + Send + Sync + 'stati
&self,
aggregator: &Aggregator,
timeout: bool,
) -> Result<gst::FlowSuccess, gst::FlowError>;
) -> Result<gst::FlowSuccess, gst::FlowError> {
self.parent_aggregate(aggregator, timeout)
}
fn start(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> {
self.parent_start(aggregator)
@ -239,10 +241,10 @@ pub trait AggregatorImplExt {
fn parent_negotiate(&self, aggregator: &Aggregator) -> bool;
}
impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class)
@ -260,7 +262,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
buffer: gst::Buffer,
) -> Option<gst::Buffer> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
match (*parent_class).clip {
@ -280,7 +282,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
buffer: gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -298,7 +300,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
event: gst::Event,
) -> bool {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -319,7 +321,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
event: gst::Event,
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -341,7 +343,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
query: &mut gst::QueryRef,
) -> bool {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -362,7 +364,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
query: &mut gst::QueryRef,
) -> bool {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -378,7 +380,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_src_event(&self, aggregator: &Aggregator, event: gst::Event) -> bool {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -390,7 +392,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_src_query(&self, aggregator: &Aggregator, query: &mut gst::QueryRef) -> bool {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -407,7 +409,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
active: bool,
) -> Result<(), gst::LoggableError> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
match (*parent_class).src_activate {
@ -431,7 +433,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
timeout: bool,
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -444,7 +446,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_start(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class)
@ -465,7 +467,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_stop(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class)
@ -486,7 +488,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_get_next_time(&self, aggregator: &Aggregator) -> gst::ClockTime {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class)
@ -504,7 +506,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
caps: Option<&gst::Caps>,
) -> Option<AggregatorPad> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -525,7 +527,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
caps: &gst::Caps,
) -> Result<gst::Caps, gst::FlowError> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class)
@ -544,7 +546,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_fixate_src_caps(&self, aggregator: &Aggregator, caps: gst::Caps) -> gst::Caps {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
@ -561,7 +563,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
caps: &gst::Caps,
) -> Result<(), gst::LoggableError> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class)
@ -579,7 +581,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_negotiate(&self, aggregator: &Aggregator) -> bool {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class)
@ -590,7 +592,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
}
}
unsafe impl<T: ObjectSubclass + AggregatorImpl> IsSubclassable<T> for AggregatorClass
unsafe impl<T: AggregatorImpl> IsSubclassable<T> for AggregatorClass
where
<T as ObjectSubclass>::Instance: PanicPoison,
{
@ -602,9 +604,7 @@ where
klass.clip = Some(aggregator_clip::<T>);
klass.finish_buffer = Some(aggregator_finish_buffer::<T>);
klass.sink_event = Some(aggregator_sink_event::<T>);
klass.sink_event_pre_queue = Some(aggregator_sink_event_pre_queue::<T>);
klass.sink_query = Some(aggregator_sink_query::<T>);
klass.sink_query_pre_queue = Some(aggregator_sink_query_pre_queue::<T>);
klass.src_event = Some(aggregator_src_event::<T>);
klass.src_query = Some(aggregator_src_query::<T>);
klass.src_activate = Some(aggregator_src_activate::<T>);
@ -616,16 +616,19 @@ where
klass.update_src_caps = Some(aggregator_update_src_caps::<T>);
klass.fixate_src_caps = Some(aggregator_fixate_src_caps::<T>);
klass.negotiated_src_caps = Some(aggregator_negotiated_src_caps::<T>);
klass.negotiate = Some(aggregator_negotiate::<T>);
{
klass.sink_event_pre_queue = Some(aggregator_sink_event_pre_queue::<T>);
klass.sink_query_pre_queue = Some(aggregator_sink_query_pre_queue::<T>);
klass.negotiate = Some(aggregator_negotiate::<T>);
}
}
}
}
unsafe extern "C" fn aggregator_flush<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_flush<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
) -> gst_sys::GstFlowReturn
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -638,13 +641,12 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_clip<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_clip<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
buffer: *mut gst_sys::GstBuffer,
) -> *mut gst_sys::GstBuffer
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -662,12 +664,11 @@ where
ret.map(|r| r.into_ptr()).unwrap_or(ptr::null_mut())
}
unsafe extern "C" fn aggregator_finish_buffer<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_finish_buffer<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
buffer: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -680,13 +681,12 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_sink_event<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_sink_event<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -703,13 +703,12 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_sink_event_pre_queue<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_sink_event_pre_queue<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
event: *mut gst_sys::GstEvent,
) -> gst_sys::GstFlowReturn
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -727,13 +726,12 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_sink_query<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_sink_query<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -750,13 +748,12 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_sink_query_pre_queue<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_sink_query_pre_queue<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -773,12 +770,11 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_src_event<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_src_event<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -791,12 +787,11 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_src_query<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_src_query<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -809,13 +804,12 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_src_activate<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_src_activate<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
mode: gst_sys::GstPadMode,
active: glib_sys::gboolean,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -834,12 +828,11 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_aggregate<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_aggregate<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
timeout: glib_sys::gboolean,
) -> gst_sys::GstFlowReturn
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -852,11 +845,10 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_start<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_start<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -875,11 +867,10 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_stop<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_stop<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -898,11 +889,10 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_get_next_time<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_get_next_time<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
) -> gst_sys::GstClockTime
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -915,14 +905,13 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_create_new_pad<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_create_new_pad<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
templ: *mut gst_sys::GstPadTemplate,
req_name: *const libc::c_char,
caps: *const gst_sys::GstCaps,
) -> *mut gst_base_sys::GstAggregatorPad
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -944,13 +933,12 @@ where
.to_glib_full()
}
unsafe extern "C" fn aggregator_update_src_caps<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_update_src_caps<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
caps: *mut gst_sys::GstCaps,
res: *mut *mut gst_sys::GstCaps,
) -> gst_sys::GstFlowReturn
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -971,12 +959,11 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_fixate_src_caps<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_fixate_src_caps<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
caps: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -989,12 +976,11 @@ where
.into_ptr()
}
unsafe extern "C" fn aggregator_negotiated_src_caps<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_negotiated_src_caps<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
caps: *mut gst_sys::GstCaps,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);
@ -1013,11 +999,10 @@ where
.to_glib()
}
unsafe extern "C" fn aggregator_negotiate<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_negotiate<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator,
) -> glib_sys::gboolean
where
T: AggregatorImpl,
T::Instance: PanicPoison,
{
let instance = &*(ptr as *mut T::Instance);

View file

@ -17,7 +17,7 @@ use super::super::Aggregator;
use super::super::AggregatorPad;
use super::super::AggregatorPadClass;
pub trait AggregatorPadImpl: AggregatorPadImplExt + PadImpl + Send + Sync + 'static {
pub trait AggregatorPadImpl: AggregatorPadImplExt + PadImpl {
fn flush(
&self,
aggregator_pad: &AggregatorPad,
@ -51,14 +51,14 @@ pub trait AggregatorPadImplExt {
) -> bool;
}
impl<T: AggregatorPadImpl + ObjectImpl> AggregatorPadImplExt for T {
impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
fn parent_flush(
&self,
aggregator_pad: &AggregatorPad,
aggregator: &Aggregator,
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorPadClass;
(*parent_class)
@ -81,7 +81,7 @@ impl<T: AggregatorPadImpl + ObjectImpl> AggregatorPadImplExt for T {
buffer: &gst::Buffer,
) -> bool {
unsafe {
let data = self.get_type_data();
let data = T::type_data();
let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorPadClass;
(*parent_class)
@ -97,7 +97,7 @@ impl<T: AggregatorPadImpl + ObjectImpl> AggregatorPadImplExt for T {
}
}
}
unsafe impl<T: ObjectSubclass + AggregatorPadImpl> IsSubclassable<T> for AggregatorPadClass {
unsafe impl<T: AggregatorPadImpl> IsSubclassable<T> for AggregatorPadClass {
fn override_vfuncs(&mut self) {
<gst::PadClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe {
@ -108,13 +108,10 @@ unsafe impl<T: ObjectSubclass + AggregatorPadImpl> IsSubclassable<T> for Aggrega
}
}
unsafe extern "C" fn aggregator_pad_flush<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_pad_flush<T: AggregatorPadImpl>(
ptr: *mut gst_base_sys::GstAggregatorPad,
aggregator: *mut gst_base_sys::GstAggregator,
) -> gst_sys::GstFlowReturn
where
T: AggregatorPadImpl,
{
) -> gst_sys::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl();
let wrap: Borrowed<AggregatorPad> = from_glib_borrow(ptr);
@ -123,14 +120,11 @@ where
res.to_glib()
}
unsafe extern "C" fn aggregator_pad_skip_buffer<T: ObjectSubclass>(
unsafe extern "C" fn aggregator_pad_skip_buffer<T: AggregatorPadImpl>(
ptr: *mut gst_base_sys::GstAggregatorPad,
aggregator: *mut gst_base_sys::GstAggregator,
buffer: *mut gst_sys::GstBuffer,
) -> glib_sys::gboolean
where
T: AggregatorPadImpl,
{
) -> glib_sys::gboolean {
let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl();
let wrap: Borrowed<AggregatorPad> = from_glib_borrow(ptr);

View file

@ -314,8 +314,6 @@ impl ObjectSubclass for FallbackSrc {
}
impl ObjectImpl for FallbackSrc {
glib_object_impl!();
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];
let element = obj.downcast_ref::<gst::Bin>().unwrap();
@ -2235,8 +2233,6 @@ mod custom_source {
}
impl ObjectImpl for CustomSource {
glib_object_impl!();
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];
let element = obj.downcast_ref::<gst::Bin>().unwrap();

View file

@ -477,8 +477,6 @@ impl ObjectSubclass for FallbackSwitch {
}
impl ObjectImpl for FallbackSwitch {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -1606,8 +1606,6 @@ impl ObjectSubclass for ToggleRecord {
}
impl ObjectImpl for ToggleRecord {
glib_object_impl!();
fn set_property(&self, obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];
let element = obj.downcast_ref::<gst::Element>().unwrap();

View file

@ -80,9 +80,7 @@ impl ObjectSubclass for CdgDec {
}
}
impl ObjectImpl for CdgDec {
glib_object_impl!();
}
impl ObjectImpl for CdgDec {}
impl ElementImpl for CdgDec {}

View file

@ -83,9 +83,7 @@ impl ObjectSubclass for CdgParse {
}
}
impl ObjectImpl for CdgParse {
glib_object_impl!();
}
impl ObjectImpl for CdgParse {}
impl ElementImpl for CdgParse {}

View file

@ -460,8 +460,6 @@ impl ObjectSubclass for Cea608Overlay {
}
impl ObjectImpl for Cea608Overlay {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -461,8 +461,6 @@ impl ObjectSubclass for Cea608ToTt {
}
impl ObjectImpl for Cea608ToTt {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -571,8 +571,6 @@ impl ObjectSubclass for MccEnc {
}
impl ObjectImpl for MccEnc {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -1241,8 +1241,6 @@ impl ObjectSubclass for MccParse {
}
impl ObjectImpl for MccParse {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -416,8 +416,6 @@ impl ObjectSubclass for SccEnc {
}
impl ObjectImpl for SccEnc {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -500,8 +500,6 @@ impl ObjectSubclass for SccParse {
}
impl ObjectImpl for SccParse {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -874,8 +874,6 @@ impl ObjectSubclass for TtToCea608 {
}
impl ObjectImpl for TtToCea608 {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -405,9 +405,7 @@ impl ObjectSubclass for Dav1dDec {
}
}
impl ObjectImpl for Dav1dDec {
glib_object_impl!();
}
impl ObjectImpl for Dav1dDec {}
impl ElementImpl for Dav1dDec {}

View file

@ -274,8 +274,6 @@ impl ObjectSubclass for FlvDemux {
}
impl ObjectImpl for FlvDemux {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj);

View file

@ -212,8 +212,6 @@ impl ObjectSubclass for GifEnc {
}
impl ObjectImpl for GifEnc {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -370,8 +370,6 @@ impl ObjectSubclass for Rav1Enc {
}
impl ObjectImpl for Rav1Enc {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];

View file

@ -10,7 +10,7 @@ use std::{io, io::Write, sync::Arc};
use glib::subclass;
use glib::subclass::prelude::*;
use glib::{glib_object_impl, glib_object_subclass, GEnum};
use glib::{glib_object_subclass, GEnum};
use gst::prelude::*;
use gst::subclass::prelude::*;
@ -323,8 +323,6 @@ impl ObjectSubclass for PngEncoder {
}
impl ObjectImpl for PngEncoder {
glib_object_impl!();
fn set_property(&self, _obj: &glib::Object, id: usize, value: &glib::Value) {
let prop = &PROPERTIES[id];