Move from imp.instance() to imp.obj()

It's doing the same thing and is shorter.
This commit is contained in:
Sebastian Dröge 2022-10-23 22:59:23 +03:00
parent 87ea535bc1
commit 90b8ee2022
52 changed files with 403 additions and 918 deletions

View file

@ -164,14 +164,14 @@ mod cairo_compositor {
name: Option<&str>,
caps: Option<&gst::Caps>,
) -> Option<gst::Pad> {
let element = self.instance();
let element = self.obj();
let pad = self.parent_request_new_pad(templ, name, caps)?;
element.child_added(&pad, &pad.name());
Some(pad)
}
fn release_pad(&self, pad: &gst::Pad) {
let element = self.instance();
let element = self.obj();
element.child_removed(pad, &pad.name());
self.parent_release_pad(pad);
}
@ -239,7 +239,7 @@ mod cairo_compositor {
token: &gst_video::subclass::AggregateFramesToken,
outbuf: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> {
let element = self.instance();
let element = self.obj();
let pads = element.sink_pads();
// Map the output frame writable.
@ -306,12 +306,12 @@ mod cairo_compositor {
// This allows accessing the pads and their properties from e.g. gst-launch.
impl ChildProxyImpl for CairoCompositor {
fn children_count(&self) -> u32 {
let object = self.instance();
let object = self.obj();
object.num_pads() as u32
}
fn child_by_name(&self, name: &str) -> Option<glib::Object> {
let object = self.instance();
let object = self.obj();
object
.pads()
.into_iter()
@ -320,7 +320,7 @@ mod cairo_compositor {
}
fn child_by_index(&self, index: u32) -> Option<glib::Object> {
let object = self.instance();
let object = self.obj();
object
.pads()
.into_iter()

View file

@ -124,7 +124,7 @@ mod mirror {
}
impl GLBaseFilterImpl for GLMirrorFilter {
fn gl_start(&self) -> Result<(), gst::LoggableError> {
let filter = self.instance();
let filter = self.obj();
// Create a shader when GL is started, knowing that the OpenGL context is
// available.
@ -141,7 +141,7 @@ mod mirror {
input: &gst_gl::GLMemory,
output: &gst_gl::GLMemory,
) -> Result<(), gst::LoggableError> {
let filter = self.instance();
let filter = self.obj();
let shader = self.shader.lock().unwrap();
// Use the underlying filter implementation to transform the input texture into

View file

@ -108,7 +108,7 @@ mod media_factory {
fn constructed(&self) {
self.parent_constructed();
let factory = self.instance();
let factory = self.obj();
// All media created by this factory are our custom media type. This would
// not require a media factory subclass and can also be called on the normal
// RTSPMediaFactory.
@ -239,7 +239,7 @@ mod server {
// Implementation of gst_rtsp_server::RTSPServer virtual methods
impl RTSPServerImpl for Server {
fn create_client(&self) -> Option<gst_rtsp_server::RTSPClient> {
let server = self.instance();
let server = self.obj();
let client = super::client::Client::default();
// Duplicated from the default implementation
@ -300,7 +300,7 @@ mod client {
// Implementation of gst_rtsp_server::RTSPClient virtual methods
impl RTSPClientImpl for Client {
fn closed(&self) {
let client = self.instance();
let client = self.obj();
self.parent_closed();
println!("Client {:?} closed", client);
}

View file

@ -54,7 +54,7 @@ impl<T: AudioAggregatorImpl> AudioAggregatorImplExt for T {
.expect("Missing parent function `create_output_buffer`");
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioAggregator>()
.to_glib_none()
.0,
@ -80,7 +80,7 @@ impl<T: AudioAggregatorImpl> AudioAggregatorImplExt for T {
.expect("Missing parent function `aggregate_one_buffer`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioAggregator>()
.to_glib_none()
.0,

View file

@ -44,7 +44,7 @@ impl<T: AudioAggregatorPadImpl> AudioAggregatorPadImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioAggregatorPadClass;
if let Some(f) = (*parent_class).update_conversion_info {
f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioAggregatorPad>()
.to_glib_none()
.0);
@ -65,7 +65,7 @@ impl<T: AudioAggregatorPadImpl> AudioAggregatorPadImplExt for T {
.convert_buffer
.expect("Missing parent function `convert_buffer`");
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioAggregatorPad>()
.to_glib_none()
.0,

View file

@ -144,7 +144,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.open
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0))
@ -169,7 +169,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.close
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0))
@ -194,7 +194,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.start
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0))
@ -219,7 +219,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.stop
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0))
@ -245,7 +245,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -269,7 +269,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
let mut offset = mem::MaybeUninit::uninit();
let mut len = mem::MaybeUninit::uninit();
gst::FlowSuccess::try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -300,7 +300,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.handle_frame
.map(|f| {
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -320,7 +320,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
if let Some(f) = (*parent_class).pre_push {
let mut buffer = buffer.into_glib_ptr();
gst::FlowSuccess::try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -341,7 +341,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.flush
.map(|f| {
f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -361,7 +361,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0),
@ -381,7 +381,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.getcaps
.map(|f| {
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -389,7 +389,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
))
})
.unwrap_or_else(|| {
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.proxy_getcaps(None, filter)
})
@ -404,7 +404,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.sink_event
.expect("Missing parent function `sink_event`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -421,7 +421,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.sink_query
.expect("Missing parent function `sink_query`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -438,7 +438,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.src_event
.expect("Missing parent function `src_event`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -455,7 +455,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.src_query
.expect("Missing parent function `src_query`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -476,7 +476,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,
@ -502,7 +502,7 @@ impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioDecoder>()
.to_glib_none()
.0,

View file

@ -138,7 +138,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.open
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0))
@ -163,7 +163,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.close
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0))
@ -188,7 +188,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.start
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0))
@ -213,7 +213,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.stop
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0))
@ -239,7 +239,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,
@ -264,7 +264,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.handle_frame
.map(|f| {
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,
@ -284,7 +284,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
if let Some(f) = (*parent_class).pre_push {
let mut buffer = buffer.into_glib_ptr();
gst::FlowSuccess::try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,
@ -305,7 +305,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.flush
.map(|f| {
f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0)
@ -323,7 +323,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0),
@ -343,7 +343,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.getcaps
.map(|f| {
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,
@ -351,7 +351,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
))
})
.unwrap_or_else(|| {
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.proxy_getcaps(None, filter)
})
@ -366,7 +366,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.sink_event
.expect("Missing parent function `sink_event`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,
@ -383,7 +383,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.sink_query
.expect("Missing parent function `sink_query`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,
@ -400,7 +400,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.src_event
.expect("Missing parent function `src_event`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,
@ -417,7 +417,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.src_query
.expect("Missing parent function `src_query`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,
@ -438,7 +438,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,
@ -464,7 +464,7 @@ impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioEncoder>()
.to_glib_none()
.0,

View file

@ -60,11 +60,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
Some(f) => f,
};
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<AudioSink>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0),
gst::CAT_RUST,
"Failed to close element using the parent function"
)
@ -79,11 +75,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
Some(f) => f,
None => return 0,
};
f(self
.instance()
.unsafe_cast_ref::<AudioSink>()
.to_glib_none()
.0)
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0)
}
}
@ -96,11 +88,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
None => return Ok(()),
};
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<AudioSink>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0),
gst::CAT_RUST,
"Failed to open element using the parent function"
)
@ -117,10 +105,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
};
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<AudioSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0,
&mut spec.0
),
gst::CAT_RUST,
@ -143,11 +128,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
}
};
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<AudioSink>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0),
gst::CAT_RUST,
"Failed to unprepare element using the parent function"
)
@ -164,10 +145,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
};
let buffer_ptr = buffer.as_ptr() as *const _ as *mut _;
let ret = f(
self.instance()
.unsafe_cast_ref::<AudioSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0,
buffer_ptr,
buffer.len() as u32,
);
@ -187,11 +165,7 @@ impl<T: AudioSinkImpl> AudioSinkImplExt for T {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSinkClass;
if let Some(f) = (*parent_class).reset {
f(self
.instance()
.unsafe_cast_ref::<AudioSink>()
.to_glib_none()
.0)
f(self.obj().unsafe_cast_ref::<AudioSink>().to_glib_none().0)
}
}
}

View file

@ -65,11 +65,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
Some(f) => f,
};
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<AudioSrc>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0),
gst::CAT_RUST,
"Failed to close element using the parent function"
)
@ -84,11 +80,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
Some(f) => f,
None => return 0,
};
f(self
.instance()
.unsafe_cast_ref::<AudioSrc>()
.to_glib_none()
.0)
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0)
}
}
@ -101,11 +93,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
None => return Ok(()),
};
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<AudioSrc>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0),
gst::CAT_RUST,
"Failed to open element using the parent function"
)
@ -122,10 +110,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
};
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<AudioSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0,
&mut spec.0
),
gst::CAT_RUST,
@ -148,11 +133,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
}
};
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<AudioSrc>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0),
gst::CAT_RUST,
"Failed to unprepare element using the parent function"
)
@ -173,10 +154,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
let buffer_ptr = buffer.as_mut_ptr() as *mut _;
let mut timestamp = mem::MaybeUninit::uninit();
let ret = f(
self.instance()
.unsafe_cast_ref::<AudioSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0,
buffer_ptr,
buffer.len() as u32,
timestamp.as_mut_ptr(),
@ -197,11 +175,7 @@ impl<T: AudioSrcImpl> AudioSrcImplExt for T {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioSrcClass;
if let Some(f) = (*parent_class).reset {
f(self
.instance()
.unsafe_cast_ref::<AudioSrc>()
.to_glib_none()
.0)
f(self.obj().unsafe_cast_ref::<AudioSrc>().to_glib_none().0)
}
}
}

View file

@ -238,7 +238,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.flush
.map(|f| {
try_from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0))
@ -258,10 +258,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
match (*parent_class).clip {
None => Some(buffer),
Some(ref func) => from_glib_full(func(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
aggregator_pad.to_glib_none().0,
buffer.into_glib_ptr(),
)),
@ -280,10 +277,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.finish_buffer
.expect("Missing parent function `finish_buffer`");
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
buffer.into_glib_ptr(),
))
}
@ -302,10 +296,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.finish_buffer_list
.expect("Missing parent function `finish_buffer_list`");
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
buffer_list.into_glib_ptr(),
))
}
@ -319,10 +310,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.sink_event
.expect("Missing parent function `sink_event`");
from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
aggregator_pad.to_glib_none().0,
event.into_glib_ptr(),
))
@ -343,10 +331,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.sink_event_pre_queue
.expect("Missing parent function `sink_event_pre_queue`");
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
aggregator_pad.to_glib_none().0,
event.into_glib_ptr(),
))
@ -361,10 +346,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.sink_query
.expect("Missing parent function `sink_query`");
from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
aggregator_pad.to_glib_none().0,
query.as_mut_ptr(),
))
@ -385,10 +367,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.sink_query_pre_queue
.expect("Missing parent function `sink_query`");
from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
aggregator_pad.to_glib_none().0,
query.as_mut_ptr(),
))
@ -403,10 +382,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.src_event
.expect("Missing parent function `src_event`");
from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
event.into_glib_ptr(),
))
}
@ -420,10 +396,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.src_query
.expect("Missing parent function `src_query`");
from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
query.as_mut_ptr(),
))
}
@ -441,10 +414,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
None => Ok(()),
Some(f) => gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
mode.into_glib(),
active.into_glib()
),
@ -463,10 +433,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.aggregate
.expect("Missing parent function `aggregate`");
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
timeout.into_glib(),
))
}
@ -480,7 +447,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.start
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0))
@ -505,7 +472,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.stop
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0))
@ -530,7 +497,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.get_next_time
.map(|f| {
from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0))
@ -552,10 +519,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.create_new_pad
.expect("Missing parent function `create_new_pad`");
from_glib_full(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
templ.to_glib_none().0,
req_name.to_glib_none().0,
caps.to_glib_none().0,
@ -573,10 +537,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
let mut out_caps = ptr::null_mut();
gst::FlowSuccess::try_from_glib(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
caps.as_mut_ptr(),
&mut out_caps,
))
@ -593,10 +554,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.fixate_src_caps
.expect("Missing parent function `fixate_src_caps`");
from_glib_full(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
caps.into_glib_ptr(),
))
}
@ -611,10 +569,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
caps.to_glib_none().0
),
gst::CAT_RUST,
@ -639,10 +594,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
pad.to_glib_none().0,
decide_query
.as_ref()
@ -670,10 +622,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
query.as_mut_ptr(),
),
gst::CAT_RUST,
@ -694,7 +643,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.negotiate
.map(|f| {
from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0))
@ -713,10 +662,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
.peek_next_sample
.map(|f| {
from_glib_full(f(
self.instance()
.unsafe_cast_ref::<Aggregator>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Aggregator>().to_glib_none().0,
pad.to_glib_none().0,
))
})

View file

@ -33,7 +33,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
.flush
.map(|f| {
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AggregatorPad>()
.to_glib_none()
.0,
@ -52,7 +52,7 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
.skip_buffer
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<AggregatorPad>()
.to_glib_none()
.0,

View file

@ -67,7 +67,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
.start
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<BaseParse>()
.to_glib_none()
.0))
@ -92,7 +92,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
.stop
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<BaseParse>()
.to_glib_none()
.0))
@ -118,10 +118,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<BaseParse>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseParse>().to_glib_none().0,
caps.to_glib_none().0,
),
gst::CAT_RUST,
@ -144,10 +141,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
.handle_frame
.map(|f| {
let res = try_from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseParse>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseParse>().to_glib_none().0,
frame.to_glib_none().0,
&mut skipsize,
));
@ -169,10 +163,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
let mut dest_val = mem::MaybeUninit::uninit();
let res = from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseParse>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseParse>().to_glib_none().0,
src_val.format().into_glib(),
src_val.into_raw_value(),
dest_format.into_glib(),
@ -267,7 +258,7 @@ unsafe extern "C" fn base_parse_handle_frame<T: BaseParseImpl>(
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
let imp = instance.imp();
let instance = imp.instance();
let instance = imp.obj();
let instance = instance.unsafe_cast_ref::<BaseParse>();
let wrap_frame = BaseParseFrame::new(frame, instance);

View file

@ -117,12 +117,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
(*parent_class)
.start
.map(|f| {
if from_glib(f(self
.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0))
{
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0)) {
Ok(())
} else {
Err(gst::error_msg!(
@ -142,12 +137,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
(*parent_class)
.stop
.map(|f| {
if from_glib(f(self
.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0))
{
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0)) {
Ok(())
} else {
Err(gst::error_msg!(
@ -168,10 +158,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
.render
.map(|f| {
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
buffer.to_glib_none().0,
))
})
@ -187,10 +174,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
.prepare
.map(|f| {
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
buffer.to_glib_none().0,
))
})
@ -209,10 +193,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
.render_list
.map(|f| {
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
list.to_glib_none().0,
))
})
@ -236,10 +217,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
.prepare_list
.map(|f| {
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
list.to_glib_none().0,
))
})
@ -260,10 +238,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
.query
.map(|f| {
from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
query.as_mut_ptr(),
))
})
@ -279,10 +254,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
.event
.map(|f| {
from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
event.into_glib_ptr(),
))
})
@ -299,10 +271,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
.get_caps
.map(|f| {
from_glib_full(f(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
filter.to_glib_none().0,
))
})
@ -319,10 +288,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
caps.to_glib_none().0
),
gst::CAT_RUST,
@ -340,10 +306,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
match (*parent_class).fixate {
Some(fixate) => from_glib_full(fixate(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
caps.into_glib_ptr(),
)),
None => caps,
@ -358,12 +321,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
(*parent_class)
.unlock
.map(|f| {
if from_glib(f(self
.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0))
{
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0)) {
Ok(())
} else {
Err(gst::error_msg!(
@ -383,12 +341,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
(*parent_class)
.unlock_stop
.map(|f| {
if from_glib(f(self
.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0))
{
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0)) {
Ok(())
} else {
Err(gst::error_msg!(
@ -413,10 +366,7 @@ impl<T: BaseSinkImpl> BaseSinkImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<BaseSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSink>().to_glib_none().0,
query.as_mut_ptr(),
),
gst::CAT_RUST,

View file

@ -176,12 +176,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
(*parent_class)
.start
.map(|f| {
if from_glib(f(self
.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0))
{
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)) {
Ok(())
} else {
Err(gst::error_msg!(
@ -201,12 +196,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
(*parent_class)
.stop
.map(|f| {
if from_glib(f(self
.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0))
{
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)) {
Ok(())
} else {
Err(gst::error_msg!(
@ -225,13 +215,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseSrcClass;
(*parent_class)
.is_seekable
.map(|f| {
from_glib(f(self
.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0))
})
.map(|f| from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)))
.unwrap_or(false)
}
}
@ -245,10 +229,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
.map(|f| {
let mut size = mem::MaybeUninit::uninit();
if from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
size.as_mut_ptr(),
)) {
Some(size.assume_init())
@ -273,10 +254,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
let mut start = mem::MaybeUninit::uninit();
let mut stop = mem::MaybeUninit::uninit();
f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
buffer.as_mut_ptr(),
start.as_mut_ptr(),
stop.as_mut_ptr(),
@ -303,10 +281,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
.fill
.map(|f| {
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
offset,
length,
buffer.as_mut_ptr(),
@ -330,10 +305,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
let buffer_ref = &mut buffer_ptr as *mut _ as *mut gst::ffi::GstBuffer;
gst::FlowSuccess::try_from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
offset,
length,
buffer_ref,
@ -356,7 +328,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
(*parent_class)
.create
.map(|f| {
let instance = self.instance();
let instance = self.obj();
let instance = instance.unsafe_cast_ref::<BaseSrc>();
let orig_buffer_ptr = buffer
.as_mut()
@ -468,10 +440,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
.do_seek
.map(|f| {
from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
segment.to_glib_none_mut().0,
))
})
@ -487,10 +456,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
.query
.map(|f| {
from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
query.as_mut_ptr(),
))
})
@ -506,10 +472,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
.event
.map(|f| {
from_glib(f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
event.to_glib_none().0,
))
})
@ -526,10 +489,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
.get_caps
.map(|f| {
from_glib_full(f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
filter.to_glib_none().0,
))
})
@ -545,11 +505,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
.negotiate
.map(|f| {
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0),
gst::CAT_RUST,
"Parent function `negotiate` failed"
)
@ -567,10 +523,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
caps.to_glib_none().0
),
gst::CAT_RUST,
@ -588,10 +541,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
match (*parent_class).fixate {
Some(fixate) => from_glib_full(fixate(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
caps.into_glib_ptr(),
)),
None => caps,
@ -606,12 +556,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
(*parent_class)
.unlock
.map(|f| {
if from_glib(f(self
.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0))
{
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)) {
Ok(())
} else {
Err(gst::error_msg!(
@ -631,12 +576,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
(*parent_class)
.unlock_stop
.map(|f| {
if from_glib(f(self
.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0))
{
if from_glib(f(self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0)) {
Ok(())
} else {
Err(gst::error_msg!(
@ -661,10 +601,7 @@ impl<T: BaseSrcImpl> BaseSrcImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<BaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<BaseSrc>().to_glib_none().0,
query.as_mut_ptr(),
),
gst::CAT_RUST,
@ -840,7 +777,7 @@ unsafe extern "C" fn base_src_create<T: BaseSrcImpl>(
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
let imp = instance.imp();
let instance = imp.instance();
let instance = imp.obj();
let instance = instance.unsafe_cast_ref::<BaseSrc>();
// FIXME: Wrong signature in -sys bindings
// https://gitlab.freedesktop.org/gstreamer/gstreamer-rs-sys/issues/3

View file

@ -277,7 +277,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.start
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0))
@ -302,7 +302,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.stop
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0))
@ -332,7 +332,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.transform_caps
.map(|f| {
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -356,7 +356,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
match (*parent_class).fixate_caps {
Some(f) => from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -382,7 +382,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -405,7 +405,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.accept_caps
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -425,7 +425,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.query
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -452,7 +452,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.map(|f| {
let mut othersize = mem::MaybeUninit::uninit();
let res: bool = from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -477,11 +477,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class).get_unit_size.unwrap_or_else(|| {
if !self
.instance()
.unsafe_cast_ref::<BaseTransform>()
.is_in_place()
{
if !self.obj().unsafe_cast_ref::<BaseTransform>().is_in_place() {
unimplemented!(concat!(
"Missing parent function `get_unit_size`. Required because ",
"transform doesn't operate in-place"
@ -495,7 +491,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
let mut size = mem::MaybeUninit::uninit();
if from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -517,7 +513,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.sink_event
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -536,7 +532,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.src_event
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -564,7 +560,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
let mut outbuf: *mut gst::ffi::GstBuffer = ptr::null_mut();
// FIXME: Wrong signature in FFI
gst::FlowSuccess::try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -595,7 +591,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.transform
.map(|f| {
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -604,11 +600,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
))
})
.unwrap_or_else(|| {
if !self
.instance()
.unsafe_cast_ref::<BaseTransform>()
.is_in_place()
{
if !self.obj().unsafe_cast_ref::<BaseTransform>().is_in_place() {
Err(gst::FlowError::NotSupported)
} else {
unreachable!(concat!(
@ -627,11 +619,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class).transform_ip.unwrap_or_else(|| {
if self
.instance()
.unsafe_cast_ref::<BaseTransform>()
.is_in_place()
{
if self.obj().unsafe_cast_ref::<BaseTransform>().is_in_place() {
panic!(concat!(
"Missing parent function `transform_ip`. Required because ",
"transform operates in-place"
@ -644,7 +632,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
});
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -661,11 +649,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
let f = (*parent_class).transform_ip.unwrap_or_else(|| {
if self
.instance()
.unsafe_cast_ref::<BaseTransform>()
.is_in_place()
{
if self.obj().unsafe_cast_ref::<BaseTransform>().is_in_place() {
panic!(concat!(
"Missing parent function `transform_ip`. Required because ",
"transform operates in-place (passthrough mode)"
@ -681,7 +665,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
// FIXME: Wrong signature in FFI
let buf: *mut gst::ffi::GstBuffer = buf.to_glib_none().0;
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -703,7 +687,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -733,7 +717,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -758,7 +742,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
if let Some(ref f) = (*parent_class).copy_metadata {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -787,7 +771,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.transform_meta
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -806,7 +790,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBaseTransformClass;
if let Some(ref f) = (*parent_class).before_transform {
f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -829,7 +813,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
.expect("Missing parent function `submit_input_buffer`");
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -849,7 +833,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
let mut outbuf = ptr::null_mut();
gst::FlowSuccess::try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<BaseTransform>()
.to_glib_none()
.0,
@ -873,7 +857,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>,
{
unsafe {
let instance = self.instance();
let instance = self.obj();
let ptr: *mut ffi::GstBaseTransform =
instance.unsafe_cast_ref::<BaseTransform>().to_glib_none().0;
let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad);
@ -890,7 +874,7 @@ impl<T: BaseTransformImpl> BaseTransformImplExt for T {
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>,
{
unsafe {
let instance = self.instance();
let instance = self.obj();
let ptr: *mut ffi::GstBaseTransform =
instance.unsafe_cast_ref::<BaseTransform>().to_glib_none().0;
let sinkpad: Borrowed<gst::Pad> = from_glib_borrow((*ptr).sinkpad);
@ -1328,7 +1312,7 @@ unsafe extern "C" fn base_transform_copy_metadata<T: BaseTransformImpl>(
let imp = instance.imp();
if gst::ffi::gst_mini_object_is_writable(outbuf as *mut _) == glib::ffi::GFALSE {
let instance = imp.instance();
let instance = imp.obj();
let obj = instance.unsafe_cast_ref::<BaseTransform>();
gst::warning!(gst::CAT_RUST, obj: obj, "buffer {:?} not writable", outbuf);
return glib::ffi::GFALSE;

View file

@ -45,10 +45,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
.fill
.map(|f| {
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<PushSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<PushSrc>().to_glib_none().0,
buffer.as_mut_ptr(),
))
})
@ -70,10 +67,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
let buffer_ref = &mut buffer_ptr as *mut _ as *mut gst::ffi::GstBuffer;
gst::FlowSuccess::try_from_glib(f(
self.instance()
.unsafe_cast_ref::<PushSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<PushSrc>().to_glib_none().0,
buffer_ref,
))
.map(|_| from_glib_full(buffer_ref))
@ -92,7 +86,7 @@ impl<T: PushSrcImpl> PushSrcImplExt for T {
(*parent_class)
.create
.map(|f| {
let instance = self.instance();
let instance = self.obj();
let instance = instance.unsafe_cast_ref::<PushSrc>();
let orig_buffer_ptr = buffer
.as_mut()
@ -322,8 +316,7 @@ unsafe extern "C" fn push_src_create<T: PushSrcImpl>(
}
Ok(CreateSuccess::NewBufferList(new_buffer_list)) => {
if buffer.is_some()
|| imp.instance().unsafe_cast_ref::<PushSrc>().src_pad().mode()
== gst::PadMode::Pull
|| imp.obj().unsafe_cast_ref::<PushSrc>().src_pad().mode() == gst::PadMode::Pull
{
panic!("Buffer lists can only be returned in push mode");
}

View file

@ -43,7 +43,7 @@ impl<T: GLBaseFilterImpl> GLBaseFilterImplExt for T {
.map(|f| {
result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<GLBaseFilter>()
.to_glib_none()
.0,
@ -68,7 +68,7 @@ impl<T: GLBaseFilterImpl> GLBaseFilterImplExt for T {
.map(|f| {
result_from_gboolean!(
f(self
.instance()
.obj()
.unsafe_cast_ref::<GLBaseFilter>()
.to_glib_none()
.0),
@ -87,7 +87,7 @@ impl<T: GLBaseFilterImpl> GLBaseFilterImplExt for T {
if let Some(f) = (*parent_class).gl_stop {
f(self
.instance()
.obj()
.unsafe_cast_ref::<GLBaseFilter>()
.to_glib_none()
.0)

View file

@ -43,11 +43,7 @@ impl<T: GLBaseSrcImpl> GLBaseSrcImplExt for T {
.gl_start
.map(|f| {
result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<GLBaseSrc>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<GLBaseSrc>().to_glib_none().0),
CAT_RUST,
"Parent function `gl_start` failed",
)
@ -62,11 +58,7 @@ impl<T: GLBaseSrcImpl> GLBaseSrcImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstGLBaseSrcClass;
if let Some(f) = (*parent_class).gl_stop {
f(self
.instance()
.unsafe_cast_ref::<GLBaseSrc>()
.to_glib_none()
.0)
f(self.obj().unsafe_cast_ref::<GLBaseSrc>().to_glib_none().0)
}
}
}
@ -81,10 +73,7 @@ impl<T: GLBaseSrcImpl> GLBaseSrcImplExt for T {
.map(|f| {
result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<GLBaseSrc>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<GLBaseSrc>().to_glib_none().0,
mut_override(memory.to_glib_none().0),
),
CAT_RUST,

View file

@ -82,10 +82,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.map(|f| {
result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0,
incaps.to_glib_none().0,
outcaps.to_glib_none().0,
),
@ -107,10 +104,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.map(|f| {
result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0,
input.to_glib_none().0,
output.to_glib_none().0,
),
@ -136,10 +130,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.map(|f| {
result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0,
input.to_glib_none().0,
output.to_glib_none().0,
),
@ -160,11 +151,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.init_fbo
.map(|f| {
result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0),
CAT_RUST,
"Parent function `init_fbo` failed"
)
@ -187,10 +174,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.expect("Missing parent function `transform_internal_caps`");
from_glib_full(f(
self.instance()
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0,
direction.into_glib(),
caps.to_glib_none().0,
filter_caps.to_glib_none().0,

View file

@ -48,7 +48,7 @@ pub trait AudioVisualizerImplExt: ObjectSubclass {
impl<T: AudioVisualizerImpl> AudioVisualizerImplExt for T {
fn parent_setup(&self, token: &AudioVisualizerSetupToken) -> Result<(), LoggableError> {
assert_eq!(
self.instance().as_ptr() as *mut ffi::GstAudioVisualizer,
self.obj().as_ptr() as *mut ffi::GstAudioVisualizer,
token.0.as_ptr() as *mut ffi::GstAudioVisualizer
);
@ -60,7 +60,7 @@ impl<T: AudioVisualizerImpl> AudioVisualizerImplExt for T {
.map(|f| {
result_from_gboolean!(
f(self
.instance()
.obj()
.unsafe_cast_ref::<AudioVisualizer>()
.to_glib_none()
.0,),
@ -85,7 +85,7 @@ impl<T: AudioVisualizerImpl> AudioVisualizerImplExt for T {
.map(|f| {
result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioVisualizer>()
.to_glib_none()
.0,
@ -112,7 +112,7 @@ impl<T: AudioVisualizerImpl> AudioVisualizerImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<AudioVisualizer>()
.to_glib_none()
.0,
@ -144,7 +144,7 @@ unsafe extern "C" fn audio_visualizer_setup<T: AudioVisualizerImpl>(
let imp = instance.imp();
gst::panic_to_error!(imp, false, {
let instance = imp.instance();
let instance = imp.obj();
let instance = instance.unsafe_cast_ref::<AudioVisualizer>();
let token = AudioVisualizerSetupToken(instance);

View file

@ -33,7 +33,7 @@ impl<T: PlayVideoRendererImpl> PlayVideoRendererImplExt for T {
.create_video_sink
.expect("no parent \"create_video_sink\" implementation");
let ret = func(
self.instance()
self.obj()
.unsafe_cast_ref::<PlayVideoRenderer>()
.to_glib_none()
.0,

View file

@ -33,7 +33,7 @@ impl<T: PlayerVideoRendererImpl> PlayerVideoRendererImplExt for T {
.create_video_sink
.expect("no parent \"create_video_sink\" implementation");
let ret = func(
self.instance()
self.obj()
.unsafe_cast_ref::<PlayerVideoRenderer>()
.to_glib_none()
.0,

View file

@ -52,7 +52,7 @@ impl<T: RTPBaseDepayloadImpl> RTPBaseDepayloadImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBaseDepayload>()
.to_glib_none()
.0,
@ -74,7 +74,7 @@ impl<T: RTPBaseDepayloadImpl> RTPBaseDepayloadImplExt for T {
.handle_event
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBaseDepayload>()
.to_glib_none()
.0,
@ -93,7 +93,7 @@ impl<T: RTPBaseDepayloadImpl> RTPBaseDepayloadImplExt for T {
.packet_lost
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBaseDepayload>()
.to_glib_none()
.0,
@ -117,7 +117,7 @@ impl<T: RTPBaseDepayloadImpl> RTPBaseDepayloadImplExt for T {
.expect("no parent \"process\" implementation");
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::RTPBaseDepayload>()
.to_glib_none()
.0,

View file

@ -57,7 +57,7 @@ impl<T: RTPBasePayloadImpl> RTPBasePayloadImplExt for T {
.get_caps
.expect("Missing parent function `get_caps`");
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBasePayload>()
.to_glib_none()
.0,
@ -76,7 +76,7 @@ impl<T: RTPBasePayloadImpl> RTPBasePayloadImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBasePayload>()
.to_glib_none()
.0,
@ -88,7 +88,7 @@ impl<T: RTPBasePayloadImpl> RTPBasePayloadImplExt for T {
})
.unwrap_or_else(|| {
// Trigger negotiation as the base class does
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBasePayload>()
.set_outcaps(None)
.map_err(|_| gst::loggable_error!(gst::CAT_RUST, "Failed to negotiate"))
@ -107,7 +107,7 @@ impl<T: RTPBasePayloadImpl> RTPBasePayloadImplExt for T {
.handle_buffer
.map(|f| {
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBasePayload>()
.to_glib_none()
.0,
@ -126,7 +126,7 @@ impl<T: RTPBasePayloadImpl> RTPBasePayloadImplExt for T {
.query
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBasePayload>()
.to_glib_none()
.0,
@ -146,7 +146,7 @@ impl<T: RTPBasePayloadImpl> RTPBasePayloadImplExt for T {
.sink_event
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBasePayload>()
.to_glib_none()
.0,
@ -165,7 +165,7 @@ impl<T: RTPBasePayloadImpl> RTPBasePayloadImplExt for T {
.src_event
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTPBasePayload>()
.to_glib_none()
.0,

View file

@ -97,7 +97,7 @@ impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {
.get_supported_flags
.expect("no parent \"get_supported_flags\" implementation");
from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.to_glib_none()
.0))
@ -112,7 +112,7 @@ impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {
.get_max_size
.expect("no parent \"get_max_size\" implementation");
f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.to_glib_none()
.0,
@ -136,7 +136,7 @@ impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {
.expect("no parent \"write\" implementation");
let res = f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.to_glib_none()
.0,
@ -173,7 +173,7 @@ impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.to_glib_none()
.0,
@ -195,7 +195,7 @@ impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {
if let Some(f) = (*parent_class).set_non_rtp_sink_caps {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.to_glib_none()
.0,
@ -220,7 +220,7 @@ impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {
if let Some(f) = (*parent_class).update_non_rtp_src_caps {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.to_glib_none()
.0,
@ -246,7 +246,7 @@ impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {
if let Some(f) = (*parent_class).set_attributes {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.to_glib_none()
.0,
@ -275,7 +275,7 @@ impl<T: RTPHeaderExtensionImpl> RTPHeaderExtensionImplExt for T {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::RTPHeaderExtension>()
.to_glib_none()
.0,

View file

@ -264,10 +264,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
.expect("No `create_rtpbin` virtual method implementation in parent class");
from_glib_full(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
media.to_glib_none().0,
))
}
@ -288,10 +285,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
media.to_glib_none().0,
stream.to_glib_none().0,
ctx.to_glib_none().0
@ -313,10 +307,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
.expect("No `params_set` virtual method implementation in parent class");
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
}
@ -331,10 +322,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
.expect("No `params_get` virtual method implementation in parent class");
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
}
@ -349,10 +337,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
.expect("No `make_path_from_uri` virtual method implementation in parent class");
from_glib_full(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
url.to_glib_none().0,
))
}
@ -363,11 +348,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).closed {
f(self
.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0);
f(self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0);
}
}
}
@ -378,10 +359,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).new_session {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
session.to_glib_none().0,
);
}
@ -394,10 +372,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).options_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -410,10 +385,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).describe_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -426,10 +398,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).setup_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -442,10 +411,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).play_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -458,10 +424,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pause_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -474,10 +437,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).teardown_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -490,10 +450,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).set_parameter_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -506,10 +463,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).get_parameter_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -522,10 +476,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).announce_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -538,10 +489,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).record_request {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -554,10 +502,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).handle_response {
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
);
}
@ -582,10 +527,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
media.to_glib_none().0,
sdp as *const _ as *mut _
@ -606,10 +548,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).check_requirements {
from_glib_full(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
arr.to_glib_none().0,
))
@ -625,10 +564,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_options_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -643,10 +579,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_describe_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -661,10 +594,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_setup_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -679,10 +609,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_play_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -697,10 +624,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_pause_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -715,10 +639,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_teardown_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -736,10 +657,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_set_parameter_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -757,10 +675,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_get_parameter_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -775,10 +690,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_announce_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -793,10 +705,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_record_request {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
))
} else {
@ -817,10 +726,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).adjust_error_code {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
ctx.to_glib_none().0,
status_code.into_glib(),
))

View file

@ -134,10 +134,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).handle_message {
from_glib(f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
message.as_ptr() as *mut _,
))
} else {
@ -153,10 +150,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
if let Some(f) = (*parent_class).prepare {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
thread.to_glib_none().0
),
gst::CAT_RUST,
@ -174,11 +168,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepare {
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0),
gst::CAT_RUST,
"Parent function `unprepare` failed"
)
@ -194,11 +184,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).suspend {
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0),
gst::CAT_RUST,
"Parent function `suspend` failed"
)
@ -214,11 +200,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unsuspend {
gst::result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0),
f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0),
gst::CAT_RUST,
"Parent function `unsuspend` failed"
)
@ -239,10 +221,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
if let Some(f) = (*parent_class).query_position {
let mut position = mem::MaybeUninit::uninit();
if f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
position.as_mut_ptr(),
) == glib::ffi::GFALSE
{
@ -265,10 +244,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
if let Some(f) = (*parent_class).query_stop {
let mut stop = mem::MaybeUninit::uninit();
if f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
stop.as_mut_ptr(),
) == glib::ffi::GFALSE
{
@ -291,7 +267,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
.expect("No `create_rtpbin` virtual method implementation in parent class");
from_glib_none(f(self
.instance()
.obj()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0))
@ -310,10 +286,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let res = gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
ptr
),
gst::CAT_RUST,
@ -348,10 +321,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
sdp as *mut _ as *mut gst_sdp::ffi::GstSDPMessage,
info.0.as_ptr()
),
@ -367,10 +337,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_stream {
f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
stream.to_glib_none().0,
);
}
@ -383,10 +350,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).removed_stream {
f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
stream.to_glib_none().0,
);
}
@ -398,11 +362,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).prepared {
f(self
.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0);
f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0);
}
}
}
@ -412,11 +372,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepared {
f(self
.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0);
f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0);
}
}
}
@ -427,10 +383,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).target_state {
f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
state.into_glib(),
);
}
@ -443,10 +396,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_state {
f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
state.into_glib(),
);
}
@ -463,10 +413,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
sdp as *const _ as *mut gst_sdp::ffi::GstSDPMessage
),
gst::CAT_RUST,

View file

@ -62,7 +62,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
.gen_key
.map(|f| {
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTSPMediaFactory>()
.to_glib_none()
.0,
@ -81,7 +81,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
.create_element
.map(|f| {
from_glib_none(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTSPMediaFactory>()
.to_glib_none()
.0,
@ -100,7 +100,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
.construct
.map(|f| {
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTSPMediaFactory>()
.to_glib_none()
.0,
@ -119,7 +119,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
.create_pipeline
.map(|f| {
let ptr = f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTSPMediaFactory>()
.to_glib_none()
.0,
@ -142,7 +142,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).configure {
f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTSPMediaFactory>()
.to_glib_none()
.0,
@ -158,7 +158,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).media_constructed {
f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTSPMediaFactory>()
.to_glib_none()
.0,
@ -174,7 +174,7 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).media_configure {
f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTSPMediaFactory>()
.to_glib_none()
.0,

View file

@ -26,7 +26,7 @@ impl<T: RTSPMountPointsImpl> RTSPMountPointsImplExt for T {
.make_path
.expect("No `make_path` virtual method implementation in parent class");
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<RTSPMountPoints>()
.to_glib_none()
.0,

View file

@ -29,7 +29,7 @@ impl<T: RTSPOnvifMediaFactoryImpl> RTSPOnvifMediaFactoryImplExt for T {
.has_backchannel_support
.map(|f| {
from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<RTSPOnvifMediaFactory>()
.to_glib_none()
.0))

View file

@ -31,7 +31,7 @@ impl<T: RTSPServerImpl> RTSPServerImplExt for T {
.create_client
.expect("No `create_client` virtual method implementation in parent class");
from_glib_full(f(self
.instance()
.obj()
.unsafe_cast_ref::<RTSPServer>()
.to_glib_none()
.0))
@ -44,10 +44,7 @@ impl<T: RTSPServerImpl> RTSPServerImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPServerClass;
if let Some(f) = (*parent_class).client_connected {
f(
self.instance()
.unsafe_cast_ref::<RTSPServer>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<RTSPServer>().to_glib_none().0,
client.to_glib_none().0,
)
}

View file

@ -44,10 +44,7 @@ impl<T: NavigationImpl> NavigationImplExt for T {
};
func(
self.instance()
.unsafe_cast_ref::<Navigation>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Navigation>().to_glib_none().0,
structure.into_glib_ptr(),
);
}
@ -67,10 +64,7 @@ impl<T: NavigationImpl> NavigationImplExt for T {
};
func(
self.instance()
.unsafe_cast_ref::<Navigation>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Navigation>().to_glib_none().0,
event.into_glib_ptr(),
);
}

View file

@ -61,7 +61,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
.expect("Missing parent function `update_caps`");
Option::<_>::from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoAggregator>()
.to_glib_none()
.0,
@ -79,7 +79,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
outbuf: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> {
assert_eq!(
self.instance().as_ptr() as *mut ffi::GstVideoAggregator,
self.obj().as_ptr() as *mut ffi::GstVideoAggregator,
token.0.as_ptr() as *mut ffi::GstVideoAggregator
);
@ -91,7 +91,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
.expect("Missing parent function `aggregate_frames`");
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoAggregator>()
.to_glib_none()
.0,
@ -111,7 +111,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
let mut buffer = ptr::null_mut();
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoAggregator>()
.to_glib_none()
.0,
@ -136,7 +136,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
let mut at_least_one_alpha = glib::ffi::GFALSE;
f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoAggregator>()
.to_glib_none()
.0,
@ -196,7 +196,7 @@ unsafe extern "C" fn video_aggregator_aggregate_frames<T: VideoAggregatorImpl>(
let imp = instance.imp();
gst::panic_to_error!(imp, gst::FlowReturn::Error, {
let instance = imp.instance();
let instance = imp.obj();
let instance = instance.unsafe_cast_ref::<VideoAggregator>();
let token = AggregateFramesToken(instance);

View file

@ -61,7 +61,7 @@ impl<T: VideoAggregatorPadImpl> VideoAggregatorPadImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoAggregatorPadClass;
if let Some(f) = (*parent_class).update_conversion_info {
f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoAggregatorPad>()
.to_glib_none()
.0);
@ -87,7 +87,7 @@ impl<T: VideoAggregatorPadImpl> VideoAggregatorPadImplExt for T {
let mut prepared_frame = mem::MaybeUninit::zeroed();
f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoAggregatorPad>()
.to_glib_none()
.0,
@ -130,7 +130,7 @@ impl<T: VideoAggregatorPadImpl> VideoAggregatorPadImplExt for T {
};
f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoAggregatorPad>()
.to_glib_none()
.0,

View file

@ -179,7 +179,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.open
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0))
@ -204,7 +204,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.close
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0))
@ -229,7 +229,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.start
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0))
@ -254,7 +254,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.stop
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0))
@ -279,7 +279,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.finish
.map(|f| {
try_from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0))
@ -296,7 +296,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.drain
.map(|f| {
try_from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0))
@ -317,7 +317,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -344,7 +344,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.parse
.map(|f| {
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -368,7 +368,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.handle_frame
.map(|f| {
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -387,7 +387,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.flush
.map(|f| {
from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0))
@ -405,7 +405,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0),
@ -425,7 +425,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.getcaps
.map(|f| {
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -433,7 +433,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
))
})
.unwrap_or_else(|| {
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.proxy_getcaps(None, filter)
})
@ -448,7 +448,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.sink_event
.expect("Missing parent function `sink_event`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -465,7 +465,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.sink_query
.expect("Missing parent function `sink_query`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -482,7 +482,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.src_event
.expect("Missing parent function `src_event`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -499,7 +499,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.src_query
.expect("Missing parent function `src_query`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -520,7 +520,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -546,7 +546,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -574,7 +574,7 @@ impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
.handle_missing_data
.map(|f| {
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoDecoder>()
.to_glib_none()
.0,
@ -736,7 +736,7 @@ unsafe extern "C" fn video_decoder_parse<T: VideoDecoderImpl>(
let instance = &*(ptr as *mut T::Instance);
let imp = instance.imp();
ffi::gst_video_codec_frame_ref(frame);
let instance = imp.instance();
let instance = imp.obj();
let instance = instance.unsafe_cast_ref::<VideoDecoder>();
let wrap_frame = VideoCodecFrame::new(frame, instance);
let wrap_adapter: Borrowed<gst_base::Adapter> = from_glib_borrow(adapter);
@ -754,7 +754,7 @@ unsafe extern "C" fn video_decoder_handle_frame<T: VideoDecoderImpl>(
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
let imp = instance.imp();
let instance = imp.instance();
let instance = imp.obj();
let instance = instance.unsafe_cast_ref::<VideoDecoder>();
let wrap_frame = VideoCodecFrame::new(frame, instance);

View file

@ -139,7 +139,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.open
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0))
@ -164,7 +164,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.close
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0))
@ -189,7 +189,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.start
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0))
@ -214,7 +214,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.stop
.map(|f| {
if from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0))
@ -239,7 +239,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.finish
.map(|f| {
try_from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0))
@ -260,7 +260,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0,
@ -285,7 +285,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.handle_frame
.map(|f| {
try_from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0,
@ -304,7 +304,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.flush
.map(|f| {
from_glib(f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0))
@ -322,7 +322,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(self
.instance()
.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0),
@ -342,7 +342,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.getcaps
.map(|f| {
from_glib_full(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0,
@ -350,7 +350,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
))
})
.unwrap_or_else(|| {
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.proxy_getcaps(None, filter)
})
@ -365,7 +365,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.sink_event
.expect("Missing parent function `sink_event`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0,
@ -382,7 +382,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.sink_query
.expect("Missing parent function `sink_query`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0,
@ -399,7 +399,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.src_event
.expect("Missing parent function `src_event`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0,
@ -416,7 +416,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.src_query
.expect("Missing parent function `src_query`");
from_glib(f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0,
@ -437,7 +437,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0,
@ -463,7 +463,7 @@ impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
self.obj()
.unsafe_cast_ref::<VideoEncoder>()
.to_glib_none()
.0,
@ -609,7 +609,7 @@ unsafe extern "C" fn video_encoder_handle_frame<T: VideoEncoderImpl>(
) -> gst::ffi::GstFlowReturn {
let instance = &*(ptr as *mut T::Instance);
let imp = instance.imp();
let instance = imp.instance();
let instance = imp.obj();
let instance = instance.unsafe_cast_ref::<VideoEncoder>();
let wrap_frame = VideoCodecFrame::new(frame, instance);

View file

@ -85,10 +85,7 @@ impl<T: VideoFilterImpl> VideoFilterImplExt for T {
.map(|f| {
gst::result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<VideoFilter>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<VideoFilter>().to_glib_none().0,
incaps.to_glib_none().0,
mut_override(in_info.to_glib_none().0),
outcaps.to_glib_none().0,
@ -114,17 +111,14 @@ impl<T: VideoFilterImpl> VideoFilterImplExt for T {
.transform_frame
.map(|f| {
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<VideoFilter>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<VideoFilter>().to_glib_none().0,
mut_override(inframe.as_ptr()),
outframe.as_mut_ptr(),
))
})
.unwrap_or_else(|| {
if !self
.instance()
.obj()
.unsafe_cast_ref::<gst_base::BaseTransform>()
.is_in_place()
{
@ -147,7 +141,7 @@ impl<T: VideoFilterImpl> VideoFilterImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoFilterClass;
let f = (*parent_class).transform_frame_ip.unwrap_or_else(|| {
if self
.instance()
.obj()
.unsafe_cast_ref::<gst_base::BaseTransform>()
.is_in_place()
{
@ -163,10 +157,7 @@ impl<T: VideoFilterImpl> VideoFilterImplExt for T {
});
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<VideoFilter>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<VideoFilter>().to_glib_none().0,
frame.as_mut_ptr(),
))
}
@ -181,7 +172,7 @@ impl<T: VideoFilterImpl> VideoFilterImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoFilterClass;
let f = (*parent_class).transform_frame_ip.unwrap_or_else(|| {
if self
.instance()
.obj()
.unsafe_cast_ref::<gst_base::BaseTransform>()
.is_in_place()
{
@ -198,10 +189,7 @@ impl<T: VideoFilterImpl> VideoFilterImplExt for T {
});
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<VideoFilter>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<VideoFilter>().to_glib_none().0,
mut_override(frame.as_ptr()),
))
}

View file

@ -26,10 +26,7 @@ impl<T: VideoSinkImpl> VideoSinkImplExt for T {
.show_frame
.map(|f| {
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<VideoSink>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<VideoSink>().to_glib_none().0,
buffer.to_glib_none().0,
))
})

View file

@ -1519,74 +1519,74 @@ macro_rules! element_info(
macro_rules! element_imp_error(
($imp:expr, $err:expr, ($msg:expr), [$debug:expr]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, ($msg), [$debug]);
}};
($imp:expr, $err:expr, ($msg:expr)) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, ($msg));
}};
($imp:expr, $err:expr, [$debug:expr]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, [$debug]);
}};
($imp:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, ($($msg)*), [$($debug)*]);
}};
($imp:expr, $err:expr, ($($msg:tt)*)) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, ($($msg)*));
}};
($imp:expr, $err:expr, [$($debug:tt)*]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, [$($debug)*]);
}};
($imp:expr, $err:expr, ($msg:expr), [$debug:expr], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, ($msg), [$debug], details: $details);
}};
($imp:expr, $err:expr, ($msg:expr), details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, ($msg), details: $details);
}};
($imp:expr, $err:expr, [$debug:expr], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, [$debug], details: $details);
}};
($imp:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, ($($msg)*), [$($debug)*], details: $details);
}};
($imp:expr, $err:expr, ($($msg:tt)*), details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, ($($msg)*), details: $details);
}};
($imp:expr, $err:expr, [$($debug:tt)*], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_error!(obj, $err, [$($debug)*], details: $details);
}};
@ -1598,74 +1598,74 @@ macro_rules! element_imp_error(
macro_rules! element_imp_warning(
($imp:expr, $err:expr, ($msg:expr), [$debug:expr]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, ($msg), [$debug]);
}};
($imp:expr, $err:expr, ($msg:expr)) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, ($msg));
}};
($imp:expr, $err:expr, [$debug:expr]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, [$debug]);
}};
($imp:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, ($($msg)*), [$($debug)*]);
}};
($imp:expr, $err:expr, ($($msg:tt)*)) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, ($($msg)*));
}};
($imp:expr, $err:expr, [$($debug:tt)*]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, [$($debug)*]);
}};
($imp:expr, $err:expr, ($msg:expr), [$debug:expr], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, ($msg), [$debug], details: $details);
}};
($imp:expr, $err:expr, ($msg:expr), details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, ($msg), details: $details);
}};
($imp:expr, $err:expr, [$debug:expr], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, [$debug], details: $details);
}};
($imp:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, ($($msg)*), [$($debug)*], details: $details);
}};
($imp:expr, $err:expr, ($($msg:tt)*), details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, ($($msg)*), details: $details);
}};
($imp:expr, $err:expr, [$($debug:tt)*], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_warning!(obj, $err, [$($debug)*], details: $details);
}};
@ -1677,74 +1677,74 @@ macro_rules! element_imp_warning(
macro_rules! element_imp_info(
($imp:expr, $err:expr, ($msg:expr), [$debug:expr]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, ($msg), [$debug]);
}};
($imp:expr, $err:expr, ($msg:expr)) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, ($msg));
}};
($imp:expr, $err:expr, [$debug:expr]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, [$debug]);
}};
($imp:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, ($($msg)*), [$($debug)*]);
}};
($imp:expr, $err:expr, ($($msg:tt)*)) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, ($($msg)*));
}};
($imp:expr, $err:expr, [$($debug:tt)*]) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, [$($debug)*]);
}};
($imp:expr, $err:expr, ($msg:expr), [$debug:expr], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, ($msg), [$debug], details: $details);
}};
($imp:expr, $err:expr, ($msg:expr), details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, ($msg), details: $details);
}};
($imp:expr, $err:expr, [$debug:expr], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, [$debug], details: $details);
}};
($imp:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, ($($msg)*), [$($debug)*], details: $details);
}};
($imp:expr, $err:expr, ($($msg:tt)*), details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, ($($msg)*), details: $details);
}};
($imp:expr, $err:expr, [$($debug:tt)*], details: $details:expr) => { {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
let obj = obj.dynamic_cast_ref::<$crate::Element>().unwrap();
$crate::element_info!(obj, $err, [$($debug)*], details: $details);
}};

View file

@ -149,7 +149,7 @@ impl LoggableError {
use glib::subclass::prelude::*;
self.category.log(
Some(unsafe { imp.instance().unsafe_cast_ref::<glib::Object>() }),
Some(unsafe { imp.obj().unsafe_cast_ref::<glib::Object>() }),
crate::DebugLevel::Error,
self.bool_error.filename,
self.bool_error.function,

View file

@ -505,7 +505,7 @@ macro_rules! log_with_level(
if $level <= $cat.threshold() {
use $crate::glib::Cast;
let obj = $imp.instance();
let obj = $imp.obj();
#[allow(unused_unsafe)]
let obj = unsafe { obj.unsafe_cast_ref::<$crate::glib::Object>() };
$crate::DebugCategory::log_unfiltered($cat.clone(), Some(obj),

View file

@ -52,10 +52,7 @@ impl<T: BinImpl> BinImplExt for T {
})?;
result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<crate::Bin>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<crate::Bin>().to_glib_none().0,
element.to_glib_none().0
),
crate::CAT_RUST,
@ -76,10 +73,7 @@ impl<T: BinImpl> BinImplExt for T {
})?;
result_from_gboolean!(
f(
self.instance()
.unsafe_cast_ref::<crate::Bin>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<crate::Bin>().to_glib_none().0,
element.to_glib_none().0
),
crate::CAT_RUST,
@ -99,11 +93,7 @@ impl<T: BinImpl> BinImplExt for T {
)
})?;
result_from_gboolean!(
f(self
.instance()
.unsafe_cast_ref::<crate::Bin>()
.to_glib_none()
.0,),
f(self.obj().unsafe_cast_ref::<crate::Bin>().to_glib_none().0,),
crate::CAT_RUST,
"Failed to update latency using the parent function"
)
@ -116,10 +106,7 @@ impl<T: BinImpl> BinImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBinClass;
if let Some(ref f) = (*parent_class).handle_message {
f(
self.instance()
.unsafe_cast_ref::<crate::Bin>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<crate::Bin>().to_glib_none().0,
message.into_glib_ptr(),
);
}

View file

@ -103,7 +103,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let mut buffer = std::ptr::null_mut();
let result = f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0,
@ -130,7 +130,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let mut buffer = std::ptr::null_mut();
let result = f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0,
@ -151,7 +151,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBufferPoolClass;
if let Some(f) = (*parent_class).free_buffer {
f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0,
@ -167,7 +167,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBufferPoolClass;
if let Some(f) = (*parent_class).release_buffer {
f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0,
@ -183,7 +183,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBufferPoolClass;
if let Some(f) = (*parent_class).reset_buffer {
f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0,
@ -199,7 +199,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBufferPoolClass;
if let Some(f) = (*parent_class).start {
let result = f(self
.instance()
.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0);
@ -217,7 +217,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBufferPoolClass;
if let Some(f) = (*parent_class).stop {
let result = f(self
.instance()
.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0);
@ -235,7 +235,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBufferPoolClass;
if let Some(f) = (*parent_class).set_config {
let result = f(
self.instance()
self.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0,
@ -255,7 +255,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBufferPoolClass;
if let Some(f) = (*parent_class).flush_start {
f(self
.instance()
.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0)
@ -269,7 +269,7 @@ impl<T: BufferPoolImpl> BufferPoolImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstBufferPoolClass;
if let Some(f) = (*parent_class).flush_stop {
f(self
.instance()
.obj()
.unsafe_cast_ref::<crate::BufferPool>()
.to_glib_none()
.0)

View file

@ -44,10 +44,7 @@ impl<T: ChildProxyImpl> ChildProxyImplExt for T {
.get_child_by_name
.expect("no parent \"child_by_name\" implementation");
let ret = func(
self.instance()
.unsafe_cast_ref::<ChildProxy>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0,
name.to_glib_none().0,
);
from_glib_full(ret)
@ -64,10 +61,7 @@ impl<T: ChildProxyImpl> ChildProxyImplExt for T {
.get_child_by_index
.expect("no parent \"child_by_index\" implementation");
let ret = func(
self.instance()
.unsafe_cast_ref::<ChildProxy>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0,
index,
);
from_glib_full(ret)
@ -83,12 +77,7 @@ impl<T: ChildProxyImpl> ChildProxyImplExt for T {
let func = (*parent_iface)
.get_children_count
.expect("no parent \"children_count\" implementation");
func(
self.instance()
.unsafe_cast_ref::<ChildProxy>()
.to_glib_none()
.0,
)
func(self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0)
}
}
@ -100,10 +89,7 @@ impl<T: ChildProxyImpl> ChildProxyImplExt for T {
if let Some(func) = (*parent_iface).child_added {
func(
self.instance()
.unsafe_cast_ref::<ChildProxy>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0,
child.to_glib_none().0,
name.to_glib_none().0,
);
@ -119,10 +105,7 @@ impl<T: ChildProxyImpl> ChildProxyImplExt for T {
if let Some(func) = (*parent_iface).child_removed {
func(
self.instance()
.unsafe_cast_ref::<ChildProxy>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0,
child.to_glib_none().0,
name.to_glib_none().0,
);

View file

@ -71,7 +71,7 @@ impl<T: ClockImpl> ClockImplExt for T {
if let Some(func) = (*parent_class).change_resolution {
try_from_glib(func(
self.instance().unsafe_cast_ref::<Clock>().to_glib_none().0,
self.obj().unsafe_cast_ref::<Clock>().to_glib_none().0,
old_resolution.into_glib(),
new_resolution.into_glib(),
))
@ -90,7 +90,7 @@ impl<T: ClockImpl> ClockImplExt for T {
try_from_glib(
(*parent_class)
.get_resolution
.map(|f| f(self.instance().unsafe_cast_ref::<Clock>().to_glib_none().0))
.map(|f| f(self.obj().unsafe_cast_ref::<Clock>().to_glib_none().0))
.unwrap_or(1),
)
.expect("undefined resolution")
@ -105,7 +105,7 @@ impl<T: ClockImpl> ClockImplExt for T {
try_from_glib(
(*parent_class)
.get_internal_time
.map(|f| f(self.instance().unsafe_cast_ref::<Clock>().to_glib_none().0))
.map(|f| f(self.obj().unsafe_cast_ref::<Clock>().to_glib_none().0))
.unwrap_or(0),
)
.expect("undefined internal_time")
@ -124,7 +124,7 @@ impl<T: ClockImpl> ClockImplExt for T {
.wait
.map(|f| {
f(
self.instance().unsafe_cast_ref::<Clock>().to_glib_none().0,
self.obj().unsafe_cast_ref::<Clock>().to_glib_none().0,
id.as_ptr() as *mut ffi::GstClockEntry,
&mut jitter,
)
@ -145,7 +145,7 @@ impl<T: ClockImpl> ClockImplExt for T {
.wait_async
.map(|f| {
f(
self.instance().unsafe_cast_ref::<Clock>().to_glib_none().0,
self.obj().unsafe_cast_ref::<Clock>().to_glib_none().0,
id.as_ptr() as *mut ffi::GstClockEntry,
)
})
@ -160,7 +160,7 @@ impl<T: ClockImpl> ClockImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass;
if let Some(func) = (*parent_class).unschedule {
func(
self.instance().unsafe_cast_ref::<Clock>().to_glib_none().0,
self.obj().unsafe_cast_ref::<Clock>().to_glib_none().0,
id.as_ptr() as *mut ffi::GstClockEntry,
);
}
@ -168,7 +168,7 @@ impl<T: ClockImpl> ClockImplExt for T {
}
fn wake_id(&self, id: &ClockId) {
let clock = self.instance();
let clock = self.obj();
let clock = unsafe { clock.unsafe_cast_ref::<Clock>() };
cfg_if::cfg_if! {

View file

@ -34,7 +34,7 @@ impl<T: DeviceImpl> DeviceImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceClass;
if let Some(f) = (*parent_class).create_element {
let ptr = f(
self.instance().unsafe_cast_ref::<Device>().to_glib_none().0,
self.obj().unsafe_cast_ref::<Device>().to_glib_none().0,
name.to_glib_none().0,
);
@ -66,7 +66,7 @@ impl<T: DeviceImpl> DeviceImplExt for T {
})?;
result_from_gboolean!(
f(
self.instance().unsafe_cast_ref::<Device>().to_glib_none().0,
self.obj().unsafe_cast_ref::<Device>().to_glib_none().0,
element.to_glib_none().0
),
crate::CAT_RUST,

View file

@ -101,7 +101,7 @@ impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass;
if let Some(f) = (*parent_class).probe {
FromGlibPtrContainer::from_glib_full(f(self
.instance()
.obj()
.unsafe_cast_ref::<DeviceProvider>()
.to_glib_none()
.0))
@ -120,7 +120,7 @@ impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
})?;
result_from_gboolean!(
f(self
.instance()
.obj()
.unsafe_cast_ref::<DeviceProvider>()
.to_glib_none()
.0),
@ -136,7 +136,7 @@ impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass;
if let Some(f) = (*parent_class).stop {
f(self
.instance()
.obj()
.unsafe_cast_ref::<DeviceProvider>()
.to_glib_none()
.0);

View file

@ -186,10 +186,7 @@ impl<T: ElementImpl> ElementImplExt for T {
.change_state
.expect("Missing parent function `change_state`");
try_from_glib(f(
self.instance()
.unsafe_cast_ref::<Element>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Element>().to_glib_none().0,
transition.into_glib(),
))
}
@ -209,10 +206,7 @@ impl<T: ElementImpl> ElementImplExt for T {
.request_new_pad
.map(|f| {
from_glib_none(f(
self.instance()
.unsafe_cast_ref::<Element>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Element>().to_glib_none().0,
templ.to_glib_none().0,
name.to_glib_full(),
caps.to_glib_none().0,
@ -231,10 +225,7 @@ impl<T: ElementImpl> ElementImplExt for T {
.release_pad
.map(|f| {
f(
self.instance()
.unsafe_cast_ref::<Element>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Element>().to_glib_none().0,
pad.to_glib_none().0,
)
})
@ -251,10 +242,7 @@ impl<T: ElementImpl> ElementImplExt for T {
.send_event
.map(|f| {
from_glib(f(
self.instance()
.unsafe_cast_ref::<Element>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Element>().to_glib_none().0,
event.into_glib_ptr(),
))
})
@ -271,10 +259,7 @@ impl<T: ElementImpl> ElementImplExt for T {
.query
.map(|f| {
from_glib(f(
self.instance()
.unsafe_cast_ref::<Element>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Element>().to_glib_none().0,
query.as_mut_ptr(),
))
})
@ -291,10 +276,7 @@ impl<T: ElementImpl> ElementImplExt for T {
.set_context
.map(|f| {
f(
self.instance()
.unsafe_cast_ref::<Element>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Element>().to_glib_none().0,
context.to_glib_none().0,
)
})
@ -311,10 +293,7 @@ impl<T: ElementImpl> ElementImplExt for T {
.set_clock
.map(|f| {
from_glib(f(
self.instance()
.unsafe_cast_ref::<Element>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Element>().to_glib_none().0,
clock.to_glib_none().0,
))
})
@ -330,11 +309,7 @@ impl<T: ElementImpl> ElementImplExt for T {
(*parent_class)
.provide_clock
.map(|f| {
from_glib_none(f(self
.instance()
.unsafe_cast_ref::<Element>()
.to_glib_none()
.0))
from_glib_none(f(self.obj().unsafe_cast_ref::<Element>().to_glib_none().0))
})
.unwrap_or(None)
}
@ -347,10 +322,7 @@ impl<T: ElementImpl> ElementImplExt for T {
if let Some(f) = (*parent_class).post_message {
from_glib(f(
self.instance()
.unsafe_cast_ref::<Element>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<Element>().to_glib_none().0,
msg.into_glib_ptr(),
))
} else {
@ -398,7 +370,7 @@ impl<T: ElementImpl> ElementImplExt for T {
fn post_error_message(&self, msg: crate::ErrorMessage) {
unsafe {
self.instance()
self.obj()
.unsafe_cast_ref::<Element>()
.post_error_message(msg)
}
@ -695,7 +667,7 @@ mod tests {
fn constructed(&self) {
self.parent_constructed();
let element = self.instance();
let element = self.obj();
element.add_pad(&self.sinkpad).unwrap();
element.add_pad(&self.srcpad).unwrap();
}

View file

@ -33,7 +33,7 @@ impl<T: PadImpl> PadImplExt for T {
.linked
.map(|f| {
f(
self.instance().unsafe_cast_ref::<Pad>().to_glib_none().0,
self.obj().unsafe_cast_ref::<Pad>().to_glib_none().0,
peer.to_glib_none().0,
)
})
@ -50,7 +50,7 @@ impl<T: PadImpl> PadImplExt for T {
.unlinked
.map(|f| {
f(
self.instance().unsafe_cast_ref::<Pad>().to_glib_none().0,
self.obj().unsafe_cast_ref::<Pad>().to_glib_none().0,
peer.to_glib_none().0,
)
})

View file

@ -326,7 +326,7 @@ mod tests {
pool.cleanup();
let imp = imp::TestPool::from_instance(&pool);
let imp = pool.imp();
assert!(imp.prepared.load(atomic::Ordering::SeqCst));
assert!(imp.cleaned_up.load(atomic::Ordering::SeqCst));
}

View file

@ -109,7 +109,7 @@ macro_rules! define_tracer_hooks {
$($cb_arg: $cb_arg_ty),*
) {
let $this = Tracer::from_glib_borrow($this);
let $this = T::from_instance($this.unsafe_cast_ref());
let $this = T::from_obj($this.unsafe_cast_ref());
$impl
}
(
@ -119,7 +119,7 @@ macro_rules! define_tracer_hooks {
},)*
};
unsafe {
let instance = self.instance();
let instance = self.obj();
ffi::gst_tracing_register_hook(
instance.to_glib_none().0 as *mut ffi::GstTracer,
hook_type.as_ptr() as *const _,

View file

@ -47,12 +47,7 @@ impl<T: URIHandlerImpl> URIHandlerImplExt for T {
let func = (*parent_iface)
.get_uri
.expect("no parent \"uri\" implementation");
let ret = func(
self.instance()
.unsafe_cast_ref::<URIHandler>()
.to_glib_none()
.0,
);
let ret = func(self.obj().unsafe_cast_ref::<URIHandler>().to_glib_none().0);
from_glib_full(ret)
}
}
@ -69,10 +64,7 @@ impl<T: URIHandlerImpl> URIHandlerImplExt for T {
let mut err = ptr::null_mut();
func(
self.instance()
.unsafe_cast_ref::<URIHandler>()
.to_glib_none()
.0,
self.obj().unsafe_cast_ref::<URIHandler>().to_glib_none().0,
uri.to_glib_none().0,
&mut err,
);