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

View file

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

View file

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

View file

@ -54,7 +54,7 @@ impl<T: AudioAggregatorImpl> AudioAggregatorImplExt for T {
.expect("Missing parent function `create_output_buffer`"); .expect("Missing parent function `create_output_buffer`");
from_glib_full(f( from_glib_full(f(
self.instance() self.obj()
.unsafe_cast_ref::<AudioAggregator>() .unsafe_cast_ref::<AudioAggregator>()
.to_glib_none() .to_glib_none()
.0, .0,
@ -80,7 +80,7 @@ impl<T: AudioAggregatorImpl> AudioAggregatorImplExt for T {
.expect("Missing parent function `aggregate_one_buffer`"); .expect("Missing parent function `aggregate_one_buffer`");
from_glib(f( from_glib(f(
self.instance() self.obj()
.unsafe_cast_ref::<AudioAggregator>() .unsafe_cast_ref::<AudioAggregator>()
.to_glib_none() .to_glib_none()
.0, .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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstAudioAggregatorPadClass;
if let Some(f) = (*parent_class).update_conversion_info { if let Some(f) = (*parent_class).update_conversion_info {
f(self f(self
.instance() .obj()
.unsafe_cast_ref::<AudioAggregatorPad>() .unsafe_cast_ref::<AudioAggregatorPad>()
.to_glib_none() .to_glib_none()
.0); .0);
@ -65,7 +65,7 @@ impl<T: AudioAggregatorPadImpl> AudioAggregatorPadImplExt for T {
.convert_buffer .convert_buffer
.expect("Missing parent function `convert_buffer`"); .expect("Missing parent function `convert_buffer`");
from_glib_full(f( from_glib_full(f(
self.instance() self.obj()
.unsafe_cast_ref::<AudioAggregatorPad>() .unsafe_cast_ref::<AudioAggregatorPad>()
.to_glib_none() .to_glib_none()
.0, .0,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -82,10 +82,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.map(|f| { .map(|f| {
result_from_gboolean!( result_from_gboolean!(
f( f(
self.instance() self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0,
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0,
incaps.to_glib_none().0, incaps.to_glib_none().0,
outcaps.to_glib_none().0, outcaps.to_glib_none().0,
), ),
@ -107,10 +104,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.map(|f| { .map(|f| {
result_from_gboolean!( result_from_gboolean!(
f( f(
self.instance() self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0,
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0,
input.to_glib_none().0, input.to_glib_none().0,
output.to_glib_none().0, output.to_glib_none().0,
), ),
@ -136,10 +130,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.map(|f| { .map(|f| {
result_from_gboolean!( result_from_gboolean!(
f( f(
self.instance() self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0,
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0,
input.to_glib_none().0, input.to_glib_none().0,
output.to_glib_none().0, output.to_glib_none().0,
), ),
@ -160,11 +151,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.init_fbo .init_fbo
.map(|f| { .map(|f| {
result_from_gboolean!( result_from_gboolean!(
f(self f(self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0),
.instance()
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0),
CAT_RUST, CAT_RUST,
"Parent function `init_fbo` failed" "Parent function `init_fbo` failed"
) )
@ -187,10 +174,7 @@ impl<T: GLFilterImpl> GLFilterImplExt for T {
.expect("Missing parent function `transform_internal_caps`"); .expect("Missing parent function `transform_internal_caps`");
from_glib_full(f( from_glib_full(f(
self.instance() self.obj().unsafe_cast_ref::<GLFilter>().to_glib_none().0,
.unsafe_cast_ref::<GLFilter>()
.to_glib_none()
.0,
direction.into_glib(), direction.into_glib(),
caps.to_glib_none().0, caps.to_glib_none().0,
filter_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 { impl<T: AudioVisualizerImpl> AudioVisualizerImplExt for T {
fn parent_setup(&self, token: &AudioVisualizerSetupToken) -> Result<(), LoggableError> { fn parent_setup(&self, token: &AudioVisualizerSetupToken) -> Result<(), LoggableError> {
assert_eq!( 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 token.0.as_ptr() as *mut ffi::GstAudioVisualizer
); );
@ -60,7 +60,7 @@ impl<T: AudioVisualizerImpl> AudioVisualizerImplExt for T {
.map(|f| { .map(|f| {
result_from_gboolean!( result_from_gboolean!(
f(self f(self
.instance() .obj()
.unsafe_cast_ref::<AudioVisualizer>() .unsafe_cast_ref::<AudioVisualizer>()
.to_glib_none() .to_glib_none()
.0,), .0,),
@ -85,7 +85,7 @@ impl<T: AudioVisualizerImpl> AudioVisualizerImplExt for T {
.map(|f| { .map(|f| {
result_from_gboolean!( result_from_gboolean!(
f( f(
self.instance() self.obj()
.unsafe_cast_ref::<AudioVisualizer>() .unsafe_cast_ref::<AudioVisualizer>()
.to_glib_none() .to_glib_none()
.0, .0,
@ -112,7 +112,7 @@ impl<T: AudioVisualizerImpl> AudioVisualizerImplExt for T {
.map(|f| { .map(|f| {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f( f(
self.instance() self.obj()
.unsafe_cast_ref::<AudioVisualizer>() .unsafe_cast_ref::<AudioVisualizer>()
.to_glib_none() .to_glib_none()
.0, .0,
@ -144,7 +144,7 @@ unsafe extern "C" fn audio_visualizer_setup<T: AudioVisualizerImpl>(
let imp = instance.imp(); let imp = instance.imp();
gst::panic_to_error!(imp, false, { gst::panic_to_error!(imp, false, {
let instance = imp.instance(); let instance = imp.obj();
let instance = instance.unsafe_cast_ref::<AudioVisualizer>(); let instance = instance.unsafe_cast_ref::<AudioVisualizer>();
let token = AudioVisualizerSetupToken(instance); let token = AudioVisualizerSetupToken(instance);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -264,10 +264,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
.expect("No `create_rtpbin` virtual method implementation in parent class"); .expect("No `create_rtpbin` virtual method implementation in parent class");
from_glib_full(f( from_glib_full(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
media.to_glib_none().0, media.to_glib_none().0,
)) ))
} }
@ -288,10 +285,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
media.to_glib_none().0, media.to_glib_none().0,
stream.to_glib_none().0, stream.to_glib_none().0,
ctx.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"); .expect("No `params_set` virtual method implementation in parent class");
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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"); .expect("No `params_get` virtual method implementation in parent class");
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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"); .expect("No `make_path_from_uri` virtual method implementation in parent class");
from_glib_full(f( from_glib_full(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
url.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 data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).closed { if let Some(f) = (*parent_class).closed {
f(self f(self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0);
.instance()
.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).new_session { if let Some(f) = (*parent_class).new_session {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
session.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).options_request { if let Some(f) = (*parent_class).options_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).describe_request { if let Some(f) = (*parent_class).describe_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).setup_request { if let Some(f) = (*parent_class).setup_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).play_request { if let Some(f) = (*parent_class).play_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pause_request { if let Some(f) = (*parent_class).pause_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).teardown_request { if let Some(f) = (*parent_class).teardown_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).set_parameter_request { if let Some(f) = (*parent_class).set_parameter_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).get_parameter_request { if let Some(f) = (*parent_class).get_parameter_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).announce_request { if let Some(f) = (*parent_class).announce_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).record_request { if let Some(f) = (*parent_class).record_request {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).handle_response { if let Some(f) = (*parent_class).handle_response {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
); );
} }
@ -582,10 +527,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
media.to_glib_none().0, media.to_glib_none().0,
sdp as *const _ as *mut _ 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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).check_requirements { if let Some(f) = (*parent_class).check_requirements {
from_glib_full(f( from_glib_full(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
arr.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_options_request { if let Some(f) = (*parent_class).pre_options_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -643,10 +579,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_describe_request { if let Some(f) = (*parent_class).pre_describe_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -661,10 +594,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_setup_request { if let Some(f) = (*parent_class).pre_setup_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -679,10 +609,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_play_request { if let Some(f) = (*parent_class).pre_play_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -697,10 +624,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_pause_request { if let Some(f) = (*parent_class).pre_pause_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -715,10 +639,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_teardown_request { if let Some(f) = (*parent_class).pre_teardown_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -736,10 +657,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_set_parameter_request { if let Some(f) = (*parent_class).pre_set_parameter_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -757,10 +675,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_get_parameter_request { if let Some(f) = (*parent_class).pre_get_parameter_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -775,10 +690,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_announce_request { if let Some(f) = (*parent_class).pre_announce_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -793,10 +705,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_record_request { if let Some(f) = (*parent_class).pre_record_request {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
)) ))
} else { } else {
@ -817,10 +726,7 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPClientClass;
if let Some(f) = (*parent_class).adjust_error_code { if let Some(f) = (*parent_class).adjust_error_code {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPClient>().to_glib_none().0,
.unsafe_cast_ref::<RTSPClient>()
.to_glib_none()
.0,
ctx.to_glib_none().0, ctx.to_glib_none().0,
status_code.into_glib(), 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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).handle_message { if let Some(f) = (*parent_class).handle_message {
from_glib(f( from_glib(f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
message.as_ptr() as *mut _, message.as_ptr() as *mut _,
)) ))
} else { } else {
@ -153,10 +150,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
if let Some(f) = (*parent_class).prepare { if let Some(f) = (*parent_class).prepare {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
thread.to_glib_none().0 thread.to_glib_none().0
), ),
gst::CAT_RUST, 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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepare { if let Some(f) = (*parent_class).unprepare {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f(self f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0),
.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0),
gst::CAT_RUST, gst::CAT_RUST,
"Parent function `unprepare` failed" "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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).suspend { if let Some(f) = (*parent_class).suspend {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f(self f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0),
.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0),
gst::CAT_RUST, gst::CAT_RUST,
"Parent function `suspend` failed" "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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unsuspend { if let Some(f) = (*parent_class).unsuspend {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f(self f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0),
.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0),
gst::CAT_RUST, gst::CAT_RUST,
"Parent function `unsuspend` failed" "Parent function `unsuspend` failed"
) )
@ -239,10 +221,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
if let Some(f) = (*parent_class).query_position { if let Some(f) = (*parent_class).query_position {
let mut position = mem::MaybeUninit::uninit(); let mut position = mem::MaybeUninit::uninit();
if f( if f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
position.as_mut_ptr(), position.as_mut_ptr(),
) == glib::ffi::GFALSE ) == glib::ffi::GFALSE
{ {
@ -265,10 +244,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
if let Some(f) = (*parent_class).query_stop { if let Some(f) = (*parent_class).query_stop {
let mut stop = mem::MaybeUninit::uninit(); let mut stop = mem::MaybeUninit::uninit();
if f( if f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
stop.as_mut_ptr(), stop.as_mut_ptr(),
) == glib::ffi::GFALSE ) == glib::ffi::GFALSE
{ {
@ -291,7 +267,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
.expect("No `create_rtpbin` virtual method implementation in parent class"); .expect("No `create_rtpbin` virtual method implementation in parent class");
from_glib_none(f(self from_glib_none(f(self
.instance() .obj()
.unsafe_cast_ref::<RTSPMedia>() .unsafe_cast_ref::<RTSPMedia>()
.to_glib_none() .to_glib_none()
.0)) .0))
@ -310,10 +286,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let res = gst::result_from_gboolean!( let res = gst::result_from_gboolean!(
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
ptr ptr
), ),
gst::CAT_RUST, gst::CAT_RUST,
@ -348,10 +321,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
sdp as *mut _ as *mut gst_sdp::ffi::GstSDPMessage, sdp as *mut _ as *mut gst_sdp::ffi::GstSDPMessage,
info.0.as_ptr() 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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_stream { if let Some(f) = (*parent_class).new_stream {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
stream.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).removed_stream { if let Some(f) = (*parent_class).removed_stream {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
stream.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 data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).prepared { if let Some(f) = (*parent_class).prepared {
f(self f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0);
.instance()
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0);
} }
} }
} }
@ -412,11 +372,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
let data = Self::type_data(); let data = Self::type_data();
let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepared { if let Some(f) = (*parent_class).unprepared {
f(self f(self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0);
.instance()
.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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).target_state { if let Some(f) = (*parent_class).target_state {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
state.into_glib(), 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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_state { if let Some(f) = (*parent_class).new_state {
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
state.into_glib(), state.into_glib(),
); );
} }
@ -463,10 +413,7 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
gst::result_from_gboolean!( gst::result_from_gboolean!(
f( f(
self.instance() self.obj().unsafe_cast_ref::<RTSPMedia>().to_glib_none().0,
.unsafe_cast_ref::<RTSPMedia>()
.to_glib_none()
.0,
sdp as *const _ as *mut gst_sdp::ffi::GstSDPMessage sdp as *const _ as *mut gst_sdp::ffi::GstSDPMessage
), ),
gst::CAT_RUST, gst::CAT_RUST,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -61,7 +61,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
.expect("Missing parent function `update_caps`"); .expect("Missing parent function `update_caps`");
Option::<_>::from_glib_full(f( Option::<_>::from_glib_full(f(
self.instance() self.obj()
.unsafe_cast_ref::<VideoAggregator>() .unsafe_cast_ref::<VideoAggregator>()
.to_glib_none() .to_glib_none()
.0, .0,
@ -79,7 +79,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
outbuf: &mut gst::BufferRef, outbuf: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
assert_eq!( 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 token.0.as_ptr() as *mut ffi::GstVideoAggregator
); );
@ -91,7 +91,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
.expect("Missing parent function `aggregate_frames`"); .expect("Missing parent function `aggregate_frames`");
try_from_glib(f( try_from_glib(f(
self.instance() self.obj()
.unsafe_cast_ref::<VideoAggregator>() .unsafe_cast_ref::<VideoAggregator>()
.to_glib_none() .to_glib_none()
.0, .0,
@ -111,7 +111,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
let mut buffer = ptr::null_mut(); let mut buffer = ptr::null_mut();
try_from_glib(f( try_from_glib(f(
self.instance() self.obj()
.unsafe_cast_ref::<VideoAggregator>() .unsafe_cast_ref::<VideoAggregator>()
.to_glib_none() .to_glib_none()
.0, .0,
@ -136,7 +136,7 @@ impl<T: VideoAggregatorImpl> VideoAggregatorImplExt for T {
let mut at_least_one_alpha = glib::ffi::GFALSE; let mut at_least_one_alpha = glib::ffi::GFALSE;
f( f(
self.instance() self.obj()
.unsafe_cast_ref::<VideoAggregator>() .unsafe_cast_ref::<VideoAggregator>()
.to_glib_none() .to_glib_none()
.0, .0,
@ -196,7 +196,7 @@ unsafe extern "C" fn video_aggregator_aggregate_frames<T: VideoAggregatorImpl>(
let imp = instance.imp(); let imp = instance.imp();
gst::panic_to_error!(imp, gst::FlowReturn::Error, { gst::panic_to_error!(imp, gst::FlowReturn::Error, {
let instance = imp.instance(); let instance = imp.obj();
let instance = instance.unsafe_cast_ref::<VideoAggregator>(); let instance = instance.unsafe_cast_ref::<VideoAggregator>();
let token = AggregateFramesToken(instance); 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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstVideoAggregatorPadClass;
if let Some(f) = (*parent_class).update_conversion_info { if let Some(f) = (*parent_class).update_conversion_info {
f(self f(self
.instance() .obj()
.unsafe_cast_ref::<VideoAggregatorPad>() .unsafe_cast_ref::<VideoAggregatorPad>()
.to_glib_none() .to_glib_none()
.0); .0);
@ -87,7 +87,7 @@ impl<T: VideoAggregatorPadImpl> VideoAggregatorPadImplExt for T {
let mut prepared_frame = mem::MaybeUninit::zeroed(); let mut prepared_frame = mem::MaybeUninit::zeroed();
f( f(
self.instance() self.obj()
.unsafe_cast_ref::<VideoAggregatorPad>() .unsafe_cast_ref::<VideoAggregatorPad>()
.to_glib_none() .to_glib_none()
.0, .0,
@ -130,7 +130,7 @@ impl<T: VideoAggregatorPadImpl> VideoAggregatorPadImplExt for T {
}; };
f( f(
self.instance() self.obj()
.unsafe_cast_ref::<VideoAggregatorPad>() .unsafe_cast_ref::<VideoAggregatorPad>()
.to_glib_none() .to_glib_none()
.0, .0,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -44,10 +44,7 @@ impl<T: ChildProxyImpl> ChildProxyImplExt for T {
.get_child_by_name .get_child_by_name
.expect("no parent \"child_by_name\" implementation"); .expect("no parent \"child_by_name\" implementation");
let ret = func( let ret = func(
self.instance() self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0,
.unsafe_cast_ref::<ChildProxy>()
.to_glib_none()
.0,
name.to_glib_none().0, name.to_glib_none().0,
); );
from_glib_full(ret) from_glib_full(ret)
@ -64,10 +61,7 @@ impl<T: ChildProxyImpl> ChildProxyImplExt for T {
.get_child_by_index .get_child_by_index
.expect("no parent \"child_by_index\" implementation"); .expect("no parent \"child_by_index\" implementation");
let ret = func( let ret = func(
self.instance() self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0,
.unsafe_cast_ref::<ChildProxy>()
.to_glib_none()
.0,
index, index,
); );
from_glib_full(ret) from_glib_full(ret)
@ -83,12 +77,7 @@ impl<T: ChildProxyImpl> ChildProxyImplExt for T {
let func = (*parent_iface) let func = (*parent_iface)
.get_children_count .get_children_count
.expect("no parent \"children_count\" implementation"); .expect("no parent \"children_count\" implementation");
func( func(self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0)
self.instance()
.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 { if let Some(func) = (*parent_iface).child_added {
func( func(
self.instance() self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0,
.unsafe_cast_ref::<ChildProxy>()
.to_glib_none()
.0,
child.to_glib_none().0, child.to_glib_none().0,
name.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 { if let Some(func) = (*parent_iface).child_removed {
func( func(
self.instance() self.obj().unsafe_cast_ref::<ChildProxy>().to_glib_none().0,
.unsafe_cast_ref::<ChildProxy>()
.to_glib_none()
.0,
child.to_glib_none().0, child.to_glib_none().0,
name.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 { if let Some(func) = (*parent_class).change_resolution {
try_from_glib(func( 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(), old_resolution.into_glib(),
new_resolution.into_glib(), new_resolution.into_glib(),
)) ))
@ -90,7 +90,7 @@ impl<T: ClockImpl> ClockImplExt for T {
try_from_glib( try_from_glib(
(*parent_class) (*parent_class)
.get_resolution .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), .unwrap_or(1),
) )
.expect("undefined resolution") .expect("undefined resolution")
@ -105,7 +105,7 @@ impl<T: ClockImpl> ClockImplExt for T {
try_from_glib( try_from_glib(
(*parent_class) (*parent_class)
.get_internal_time .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), .unwrap_or(0),
) )
.expect("undefined internal_time") .expect("undefined internal_time")
@ -124,7 +124,7 @@ impl<T: ClockImpl> ClockImplExt for T {
.wait .wait
.map(|f| { .map(|f| {
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, id.as_ptr() as *mut ffi::GstClockEntry,
&mut jitter, &mut jitter,
) )
@ -145,7 +145,7 @@ impl<T: ClockImpl> ClockImplExt for T {
.wait_async .wait_async
.map(|f| { .map(|f| {
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, 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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstClockClass;
if let Some(func) = (*parent_class).unschedule { if let Some(func) = (*parent_class).unschedule {
func( 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, id.as_ptr() as *mut ffi::GstClockEntry,
); );
} }
@ -168,7 +168,7 @@ impl<T: ClockImpl> ClockImplExt for T {
} }
fn wake_id(&self, id: &ClockId) { fn wake_id(&self, id: &ClockId) {
let clock = self.instance(); let clock = self.obj();
let clock = unsafe { clock.unsafe_cast_ref::<Clock>() }; let clock = unsafe { clock.unsafe_cast_ref::<Clock>() };
cfg_if::cfg_if! { 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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceClass;
if let Some(f) = (*parent_class).create_element { if let Some(f) = (*parent_class).create_element {
let ptr = f( 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, name.to_glib_none().0,
); );
@ -66,7 +66,7 @@ impl<T: DeviceImpl> DeviceImplExt for T {
})?; })?;
result_from_gboolean!( result_from_gboolean!(
f( 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 element.to_glib_none().0
), ),
crate::CAT_RUST, 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; let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass;
if let Some(f) = (*parent_class).probe { if let Some(f) = (*parent_class).probe {
FromGlibPtrContainer::from_glib_full(f(self FromGlibPtrContainer::from_glib_full(f(self
.instance() .obj()
.unsafe_cast_ref::<DeviceProvider>() .unsafe_cast_ref::<DeviceProvider>()
.to_glib_none() .to_glib_none()
.0)) .0))
@ -120,7 +120,7 @@ impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
})?; })?;
result_from_gboolean!( result_from_gboolean!(
f(self f(self
.instance() .obj()
.unsafe_cast_ref::<DeviceProvider>() .unsafe_cast_ref::<DeviceProvider>()
.to_glib_none() .to_glib_none()
.0), .0),
@ -136,7 +136,7 @@ impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass; let parent_class = data.as_ref().parent_class() as *mut ffi::GstDeviceProviderClass;
if let Some(f) = (*parent_class).stop { if let Some(f) = (*parent_class).stop {
f(self f(self
.instance() .obj()
.unsafe_cast_ref::<DeviceProvider>() .unsafe_cast_ref::<DeviceProvider>()
.to_glib_none() .to_glib_none()
.0); .0);

View file

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

View file

@ -33,7 +33,7 @@ impl<T: PadImpl> PadImplExt for T {
.linked .linked
.map(|f| { .map(|f| {
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, peer.to_glib_none().0,
) )
}) })
@ -50,7 +50,7 @@ impl<T: PadImpl> PadImplExt for T {
.unlinked .unlinked
.map(|f| { .map(|f| {
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, peer.to_glib_none().0,
) )
}) })

View file

@ -326,7 +326,7 @@ mod tests {
pool.cleanup(); pool.cleanup();
let imp = imp::TestPool::from_instance(&pool); let imp = pool.imp();
assert!(imp.prepared.load(atomic::Ordering::SeqCst)); assert!(imp.prepared.load(atomic::Ordering::SeqCst));
assert!(imp.cleaned_up.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),* $($cb_arg: $cb_arg_ty),*
) { ) {
let $this = Tracer::from_glib_borrow($this); 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 $impl
} }
( (
@ -119,7 +119,7 @@ macro_rules! define_tracer_hooks {
},)* },)*
}; };
unsafe { unsafe {
let instance = self.instance(); let instance = self.obj();
ffi::gst_tracing_register_hook( ffi::gst_tracing_register_hook(
instance.to_glib_none().0 as *mut ffi::GstTracer, instance.to_glib_none().0 as *mut ffi::GstTracer,
hook_type.as_ptr() as *const _, hook_type.as_ptr() as *const _,

View file

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