Update for removal of ObjectImpl::get_type_data()

This commit is contained in:
Sebastian Dröge 2020-07-25 11:02:04 +03:00
parent 3adc3d9337
commit 4f5b2f5060
33 changed files with 665 additions and 1075 deletions

View file

@ -14,7 +14,6 @@ extern crate gstreamer_sdp as gst_sdp;
use gst_rtsp_server::prelude::*; use gst_rtsp_server::prelude::*;
use glib::glib_object_impl;
use glib::glib_object_subclass; use glib::glib_object_subclass;
use glib::glib_object_wrapper; use glib::glib_object_wrapper;
use glib::glib_wrapper; use glib::glib_wrapper;
@ -123,9 +122,6 @@ mod media_factory {
// Implementation of glib::Object virtual methods // Implementation of glib::Object virtual methods
impl ObjectImpl for Factory { impl ObjectImpl for Factory {
// This macro provides some boilerplate.
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) { fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj); self.parent_constructed(obj);
@ -238,10 +234,7 @@ mod media {
} }
// Implementation of glib::Object virtual methods // Implementation of glib::Object virtual methods
impl ObjectImpl for Media { impl ObjectImpl for Media {}
// This macro provides some boilerplate.
glib_object_impl!();
}
// Implementation of gst_rtsp_server::RTSPMedia virtual methods // Implementation of gst_rtsp_server::RTSPMedia virtual methods
impl RTSPMediaImpl for Media { impl RTSPMediaImpl for Media {
@ -320,10 +313,7 @@ mod server {
} }
// Implementation of glib::Object virtual methods // Implementation of glib::Object virtual methods
impl ObjectImpl for Server { impl ObjectImpl for Server {}
// This macro provides some boilerplate.
glib_object_impl!();
}
// Implementation of gst_rtsp_server::RTSPServer virtual methods // Implementation of gst_rtsp_server::RTSPServer virtual methods
impl RTSPServerImpl for Server { impl RTSPServerImpl for Server {
@ -422,10 +412,7 @@ mod client {
} }
// Implementation of glib::Object virtual methods // Implementation of glib::Object virtual methods
impl ObjectImpl for Client { impl ObjectImpl for Client {}
// This macro provides some boilerplate.
glib_object_impl!();
}
// Implementation of gst_rtsp_server::RTSPClient virtual methods // Implementation of gst_rtsp_server::RTSPClient virtual methods
impl RTSPClientImpl for Client { impl RTSPClientImpl for Client {

View file

@ -6,7 +6,6 @@
// Our filter can only handle F32 mono and acts as a FIR filter. The filter impulse response / // Our filter can only handle F32 mono and acts as a FIR filter. The filter impulse response /
// coefficients are provided via Rust API on the filter as a Vec<f32>. // coefficients are provided via Rust API on the filter as a Vec<f32>.
use glib::glib_object_impl;
use glib::glib_object_subclass; use glib::glib_object_subclass;
use glib::glib_object_wrapper; use glib::glib_object_wrapper;
use glib::glib_wrapper; use glib::glib_wrapper;
@ -160,10 +159,7 @@ mod fir_filter {
} }
// Implementation of glib::Object virtual methods // Implementation of glib::Object virtual methods
impl ObjectImpl for FirFilter { impl ObjectImpl for FirFilter {}
// This macro provides some boilerplate.
glib_object_impl!();
}
// Implementation of gst::Element virtual methods // Implementation of gst::Element virtual methods
impl ElementImpl for FirFilter {} impl ElementImpl for FirFilter {}

View file

@ -25,7 +25,7 @@ use crate::prelude::*;
use AudioDecoder; use AudioDecoder;
use AudioDecoderClass; use AudioDecoderClass;
pub trait AudioDecoderImpl: AudioDecoderImplExt + ElementImpl + Send + Sync + 'static { pub trait AudioDecoderImpl: AudioDecoderImplExt + ElementImpl {
fn open(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> { fn open(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
self.parent_open(element) self.parent_open(element)
} }
@ -179,10 +179,10 @@ pub trait AudioDecoderImplExt {
) -> Result<(), gst::ErrorMessage>; ) -> Result<(), gst::ErrorMessage>;
} }
impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T { impl<T: AudioDecoderImpl> AudioDecoderImplExt for T {
fn parent_open(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -203,7 +203,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_close(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -224,7 +224,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_start(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -245,7 +245,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_stop(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &AudioDecoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -270,7 +270,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -292,7 +292,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
adapter: &gst_base::Adapter, adapter: &gst_base::Adapter,
) -> Result<(u32, u32), gst::FlowError> { ) -> Result<(u32, u32), gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -328,7 +328,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
buffer: Option<&gst::Buffer>, buffer: Option<&gst::Buffer>,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -352,7 +352,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
buffer: gst::Buffer, buffer: gst::Buffer,
) -> Result<Option<gst::Buffer>, gst::FlowError> { ) -> Result<Option<gst::Buffer>, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
if let Some(f) = (*parent_class).pre_push { if let Some(f) = (*parent_class).pre_push {
@ -371,7 +371,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_flush(&self, element: &AudioDecoder, hard: bool) { fn parent_flush(&self, element: &AudioDecoder, hard: bool) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -383,7 +383,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_negotiate(&self, element: &AudioDecoder) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &AudioDecoder) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -401,7 +401,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_get_caps(&self, element: &AudioDecoder, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_get_caps(&self, element: &AudioDecoder, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -413,7 +413,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_sink_event(&self, element: &AudioDecoder, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &AudioDecoder, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -425,7 +425,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_sink_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -437,7 +437,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_src_event(&self, element: &AudioDecoder, event: gst::Event) -> bool { fn parent_src_event(&self, element: &AudioDecoder, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -449,7 +449,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
fn parent_src_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &AudioDecoder, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -465,7 +465,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -490,7 +490,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioDecoderClass;
(*parent_class) (*parent_class)
@ -510,7 +510,7 @@ impl<T: AudioDecoderImpl + ObjectImpl> AudioDecoderImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + AudioDecoderImpl> IsSubclassable<T> for AudioDecoderClass unsafe impl<T: AudioDecoderImpl> IsSubclassable<T> for AudioDecoderClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -539,11 +539,10 @@ where
} }
} }
unsafe extern "C" fn audio_decoder_open<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_open<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -562,11 +561,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_close<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_close<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -585,11 +583,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_start<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_start<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -608,11 +605,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_stop<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_stop<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -631,12 +627,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_set_format<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_set_format<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -655,14 +650,13 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_parse<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_parse<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
adapter: *mut gst_base_sys::GstAdapter, adapter: *mut gst_base_sys::GstAdapter,
offset: *mut i32, offset: *mut i32,
len: *mut i32, len: *mut i32,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -685,12 +679,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_handle_frame<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_handle_frame<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
buffer: *mut *mut gst_sys::GstBuffer, buffer: *mut *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
// FIXME: Misgenerated in gstreamer-audio-sys // FIXME: Misgenerated in gstreamer-audio-sys
@ -709,12 +702,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_pre_push<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_pre_push<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
buffer: *mut *mut gst_sys::GstBuffer, buffer: *mut *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -738,11 +730,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_flush<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_flush<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
hard: glib_sys::gboolean, hard: glib_sys::gboolean,
) where ) where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -754,11 +745,10 @@ unsafe extern "C" fn audio_decoder_flush<T: ObjectSubclass>(
}) })
} }
unsafe extern "C" fn audio_decoder_negotiate<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_negotiate<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -777,12 +767,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_getcaps<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_getcaps<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
filter: *mut gst_sys::GstCaps, filter: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -801,12 +790,11 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn audio_decoder_sink_event<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_sink_event<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -819,12 +807,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_sink_query<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_sink_query<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -837,12 +824,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_src_event<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_src_event<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -855,12 +841,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_src_query<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_src_query<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -873,12 +858,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_propose_allocation<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_propose_allocation<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -898,12 +882,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_decoder_decide_allocation<T: ObjectSubclass>( unsafe extern "C" fn audio_decoder_decide_allocation<T: AudioDecoderImpl>(
ptr: *mut gst_audio_sys::GstAudioDecoder, ptr: *mut gst_audio_sys::GstAudioDecoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -24,7 +24,7 @@ use AudioEncoder;
use AudioEncoderClass; use AudioEncoderClass;
use AudioInfo; use AudioInfo;
pub trait AudioEncoderImpl: AudioEncoderImplExt + ElementImpl + Send + Sync + 'static { pub trait AudioEncoderImpl: AudioEncoderImplExt + ElementImpl {
fn open(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> { fn open(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
self.parent_open(element) self.parent_open(element)
} }
@ -164,10 +164,10 @@ pub trait AudioEncoderImplExt {
) -> Result<(), gst::ErrorMessage>; ) -> Result<(), gst::ErrorMessage>;
} }
impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T { impl<T: AudioEncoderImpl> AudioEncoderImplExt for T {
fn parent_open(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -188,7 +188,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_close(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -209,7 +209,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_start(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -230,7 +230,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_stop(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &AudioEncoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -255,7 +255,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
info: &AudioInfo, info: &AudioInfo,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -277,7 +277,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
buffer: Option<&gst::Buffer>, buffer: Option<&gst::Buffer>,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -301,7 +301,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
buffer: gst::Buffer, buffer: gst::Buffer,
) -> Result<Option<gst::Buffer>, gst::FlowError> { ) -> Result<Option<gst::Buffer>, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
if let Some(f) = (*parent_class).pre_push { if let Some(f) = (*parent_class).pre_push {
@ -320,7 +320,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_flush(&self, element: &AudioEncoder) { fn parent_flush(&self, element: &AudioEncoder) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -332,7 +332,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_negotiate(&self, element: &AudioEncoder) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &AudioEncoder) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -350,7 +350,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_get_caps(&self, element: &AudioEncoder, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_get_caps(&self, element: &AudioEncoder, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -362,7 +362,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_sink_event(&self, element: &AudioEncoder, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &AudioEncoder, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -374,7 +374,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_sink_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -386,7 +386,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_src_event(&self, element: &AudioEncoder, event: gst::Event) -> bool { fn parent_src_event(&self, element: &AudioEncoder, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -398,7 +398,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
fn parent_src_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &AudioEncoder, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -414,7 +414,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -439,7 +439,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioEncoderClass;
(*parent_class) (*parent_class)
@ -459,7 +459,7 @@ impl<T: AudioEncoderImpl + ObjectImpl> AudioEncoderImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + AudioEncoderImpl> IsSubclassable<T> for AudioEncoderClass unsafe impl<T: AudioEncoderImpl> IsSubclassable<T> for AudioEncoderClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -487,11 +487,10 @@ where
} }
} }
unsafe extern "C" fn audio_encoder_open<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_open<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -510,11 +509,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_close<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_close<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -533,11 +531,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_start<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_start<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -556,11 +553,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_stop<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_stop<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -579,12 +575,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_set_format<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_set_format<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
info: *mut gst_audio_sys::GstAudioInfo, info: *mut gst_audio_sys::GstAudioInfo,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -603,12 +598,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_handle_frame<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_handle_frame<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
buffer: *mut *mut gst_sys::GstBuffer, buffer: *mut *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
// FIXME: Misgenerated in gstreamer-audio-sys // FIXME: Misgenerated in gstreamer-audio-sys
@ -627,12 +621,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_pre_push<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_pre_push<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
buffer: *mut *mut gst_sys::GstBuffer, buffer: *mut *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -656,10 +649,9 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_flush<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_flush<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
) where ) where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -671,11 +663,10 @@ unsafe extern "C" fn audio_encoder_flush<T: ObjectSubclass>(
}) })
} }
unsafe extern "C" fn audio_encoder_negotiate<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_negotiate<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -694,12 +685,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_getcaps<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_getcaps<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
filter: *mut gst_sys::GstCaps, filter: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -718,12 +708,11 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn audio_encoder_sink_event<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_sink_event<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -736,12 +725,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_sink_query<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_sink_query<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -754,12 +742,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_src_event<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_src_event<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -772,12 +759,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_src_query<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_src_query<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -790,12 +776,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_propose_allocation<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_propose_allocation<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -815,12 +800,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audio_encoder_decide_allocation<T: ObjectSubclass>( unsafe extern "C" fn audio_encoder_decide_allocation<T: AudioEncoderImpl>(
ptr: *mut gst_audio_sys::GstAudioEncoder, ptr: *mut gst_audio_sys::GstAudioEncoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -12,7 +12,7 @@ use AudioRingBufferSpec;
use AudioSink; use AudioSink;
use AudioSinkClass; use AudioSinkClass;
pub trait AudioSinkImpl: AudioSinkImplExt + BaseSinkImpl + Send + Sync + 'static { pub trait AudioSinkImpl: AudioSinkImplExt + BaseSinkImpl {
fn close(&self, sink: &AudioSink) -> Result<(), LoggableError> { fn close(&self, sink: &AudioSink) -> Result<(), LoggableError> {
self.parent_close(sink) self.parent_close(sink)
} }
@ -60,10 +60,10 @@ pub trait AudioSinkImplExt {
fn parent_reset(&self, sink: &AudioSink); fn parent_reset(&self, sink: &AudioSink);
} }
impl<T: AudioSinkImpl + ObjectImpl> AudioSinkImplExt for T { impl<T: AudioSinkImpl> AudioSinkImplExt for T {
fn parent_close(&self, sink: &AudioSink) -> Result<(), LoggableError> { fn parent_close(&self, sink: &AudioSink) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass;
let f = match (*parent_class).close { let f = match (*parent_class).close {
@ -80,7 +80,7 @@ impl<T: AudioSinkImpl + ObjectImpl> AudioSinkImplExt for T {
fn parent_delay(&self, sink: &AudioSink) -> u32 { fn parent_delay(&self, sink: &AudioSink) -> u32 {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass;
let f = match (*parent_class).delay { let f = match (*parent_class).delay {
@ -93,7 +93,7 @@ impl<T: AudioSinkImpl + ObjectImpl> AudioSinkImplExt for T {
fn parent_open(&self, sink: &AudioSink) -> Result<(), LoggableError> { fn parent_open(&self, sink: &AudioSink) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass;
let f = match (*parent_class).open { let f = match (*parent_class).open {
@ -114,7 +114,7 @@ impl<T: AudioSinkImpl + ObjectImpl> AudioSinkImplExt for T {
spec: &mut AudioRingBufferSpec, spec: &mut AudioRingBufferSpec,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass;
let f = match (*parent_class).prepare { let f = match (*parent_class).prepare {
@ -131,7 +131,7 @@ impl<T: AudioSinkImpl + ObjectImpl> AudioSinkImplExt for T {
fn parent_unprepare(&self, sink: &AudioSink) -> Result<(), LoggableError> { fn parent_unprepare(&self, sink: &AudioSink) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass;
let f = match (*parent_class).unprepare { let f = match (*parent_class).unprepare {
@ -153,7 +153,7 @@ impl<T: AudioSinkImpl + ObjectImpl> AudioSinkImplExt for T {
fn parent_write(&self, sink: &AudioSink, buffer: &[u8]) -> Result<i32, LoggableError> { fn parent_write(&self, sink: &AudioSink, buffer: &[u8]) -> Result<i32, LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass;
let f = match (*parent_class).write { let f = match (*parent_class).write {
@ -175,7 +175,7 @@ impl<T: AudioSinkImpl + ObjectImpl> AudioSinkImplExt for T {
fn parent_reset(&self, sink: &AudioSink) { fn parent_reset(&self, sink: &AudioSink) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSinkClass;
if let Some(f) = (*parent_class).reset { if let Some(f) = (*parent_class).reset {
@ -185,7 +185,7 @@ impl<T: AudioSinkImpl + ObjectImpl> AudioSinkImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + AudioSinkImpl + BaseSinkImpl> IsSubclassable<T> for AudioSinkClass unsafe impl<T: AudioSinkImpl> IsSubclassable<T> for AudioSinkClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -204,11 +204,10 @@ where
} }
} }
unsafe extern "C" fn audiosink_close<T: ObjectSubclass>( unsafe extern "C" fn audiosink_close<T: AudioSinkImpl>(
ptr: *mut gst_audio_sys::GstAudioSink, ptr: *mut gst_audio_sys::GstAudioSink,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -227,11 +226,8 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audiosink_delay<T: ObjectSubclass>( unsafe extern "C" fn audiosink_delay<T: AudioSinkImpl>(ptr: *mut gst_audio_sys::GstAudioSink) -> u32
ptr: *mut gst_audio_sys::GstAudioSink,
) -> u32
where where
T: AudioSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -241,11 +237,10 @@ where
gst_panic_to_error!(&wrap, &instance.panicked(), 0, { imp.delay(&wrap) }) gst_panic_to_error!(&wrap, &instance.panicked(), 0, { imp.delay(&wrap) })
} }
unsafe extern "C" fn audiosink_open<T: ObjectSubclass>( unsafe extern "C" fn audiosink_open<T: AudioSinkImpl>(
ptr: *mut gst_audio_sys::GstAudioSink, ptr: *mut gst_audio_sys::GstAudioSink,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -264,12 +259,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audiosink_prepare<T: ObjectSubclass>( unsafe extern "C" fn audiosink_prepare<T: AudioSinkImpl>(
ptr: *mut gst_audio_sys::GstAudioSink, ptr: *mut gst_audio_sys::GstAudioSink,
spec: *mut gst_audio_sys::GstAudioRingBufferSpec, spec: *mut gst_audio_sys::GstAudioRingBufferSpec,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -290,11 +284,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audiosink_unprepare<T: ObjectSubclass>( unsafe extern "C" fn audiosink_unprepare<T: AudioSinkImpl>(
ptr: *mut gst_audio_sys::GstAudioSink, ptr: *mut gst_audio_sys::GstAudioSink,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -313,13 +306,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audiosink_write<T: ObjectSubclass>( unsafe extern "C" fn audiosink_write<T: AudioSinkImpl>(
ptr: *mut gst_audio_sys::GstAudioSink, ptr: *mut gst_audio_sys::GstAudioSink,
data: glib_sys::gpointer, data: glib_sys::gpointer,
length: u32, length: u32,
) -> i32 ) -> i32
where where
T: AudioSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -332,9 +324,8 @@ where
}) })
} }
unsafe extern "C" fn audiosink_reset<T: ObjectSubclass>(ptr: *mut gst_audio_sys::GstAudioSink) unsafe extern "C" fn audiosink_reset<T: AudioSinkImpl>(ptr: *mut gst_audio_sys::GstAudioSink)
where where
T: AudioSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -14,7 +14,7 @@ use AudioRingBufferSpec;
use AudioSrc; use AudioSrc;
use AudioSrcClass; use AudioSrcClass;
pub trait AudioSrcImpl: AudioSrcImplExt + BaseSrcImpl + Send + Sync + 'static { pub trait AudioSrcImpl: AudioSrcImplExt + BaseSrcImpl {
fn close(&self, src: &AudioSrc) -> Result<(), LoggableError> { fn close(&self, src: &AudioSrc) -> Result<(), LoggableError> {
self.parent_close(src) self.parent_close(src)
} }
@ -66,10 +66,10 @@ pub trait AudioSrcImplExt {
fn parent_reset(&self, src: &AudioSrc); fn parent_reset(&self, src: &AudioSrc);
} }
impl<T: AudioSrcImpl + ObjectImpl> AudioSrcImplExt for T { impl<T: AudioSrcImpl> AudioSrcImplExt for T {
fn parent_close(&self, src: &AudioSrc) -> Result<(), LoggableError> { fn parent_close(&self, src: &AudioSrc) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass;
let f = match (*parent_class).close { let f = match (*parent_class).close {
@ -86,7 +86,7 @@ impl<T: AudioSrcImpl + ObjectImpl> AudioSrcImplExt for T {
fn parent_delay(&self, src: &AudioSrc) -> u32 { fn parent_delay(&self, src: &AudioSrc) -> u32 {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass;
let f = match (*parent_class).delay { let f = match (*parent_class).delay {
@ -99,7 +99,7 @@ impl<T: AudioSrcImpl + ObjectImpl> AudioSrcImplExt for T {
fn parent_open(&self, src: &AudioSrc) -> Result<(), LoggableError> { fn parent_open(&self, src: &AudioSrc) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass;
let f = match (*parent_class).open { let f = match (*parent_class).open {
@ -120,7 +120,7 @@ impl<T: AudioSrcImpl + ObjectImpl> AudioSrcImplExt for T {
spec: &mut AudioRingBufferSpec, spec: &mut AudioRingBufferSpec,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass;
let f = match (*parent_class).prepare { let f = match (*parent_class).prepare {
@ -137,7 +137,7 @@ impl<T: AudioSrcImpl + ObjectImpl> AudioSrcImplExt for T {
fn parent_unprepare(&self, src: &AudioSrc) -> Result<(), LoggableError> { fn parent_unprepare(&self, src: &AudioSrc) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass;
let f = match (*parent_class).unprepare { let f = match (*parent_class).unprepare {
@ -163,7 +163,7 @@ impl<T: AudioSrcImpl + ObjectImpl> AudioSrcImplExt for T {
buffer: &mut [u8], buffer: &mut [u8],
) -> Result<(u32, gst::ClockTime), LoggableError> { ) -> Result<(u32, gst::ClockTime), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass;
let f = match (*parent_class).read { let f = match (*parent_class).read {
@ -191,7 +191,7 @@ impl<T: AudioSrcImpl + ObjectImpl> AudioSrcImplExt for T {
fn parent_reset(&self, src: &AudioSrc) { fn parent_reset(&self, src: &AudioSrc) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass; data.as_ref().get_parent_class() as *mut gst_audio_sys::GstAudioSrcClass;
if let Some(f) = (*parent_class).reset { if let Some(f) = (*parent_class).reset {
@ -201,7 +201,7 @@ impl<T: AudioSrcImpl + ObjectImpl> AudioSrcImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + AudioSrcImpl + BaseSrcImpl> IsSubclassable<T> for AudioSrcClass unsafe impl<T: AudioSrcImpl> IsSubclassable<T> for AudioSrcClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -220,11 +220,10 @@ where
} }
} }
unsafe extern "C" fn audiosrc_close<T: ObjectSubclass>( unsafe extern "C" fn audiosrc_close<T: AudioSrcImpl>(
ptr: *mut gst_audio_sys::GstAudioSrc, ptr: *mut gst_audio_sys::GstAudioSrc,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -243,9 +242,8 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audiosrc_delay<T: ObjectSubclass>(ptr: *mut gst_audio_sys::GstAudioSrc) -> u32 unsafe extern "C" fn audiosrc_delay<T: AudioSrcImpl>(ptr: *mut gst_audio_sys::GstAudioSrc) -> u32
where where
T: AudioSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -255,11 +253,10 @@ where
gst_panic_to_error!(&wrap, &instance.panicked(), 0, { imp.delay(&wrap) }) gst_panic_to_error!(&wrap, &instance.panicked(), 0, { imp.delay(&wrap) })
} }
unsafe extern "C" fn audiosrc_open<T: ObjectSubclass>( unsafe extern "C" fn audiosrc_open<T: AudioSrcImpl>(
ptr: *mut gst_audio_sys::GstAudioSrc, ptr: *mut gst_audio_sys::GstAudioSrc,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -278,12 +275,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audiosrc_prepare<T: ObjectSubclass>( unsafe extern "C" fn audiosrc_prepare<T: AudioSrcImpl>(
ptr: *mut gst_audio_sys::GstAudioSrc, ptr: *mut gst_audio_sys::GstAudioSrc,
spec: *mut gst_audio_sys::GstAudioRingBufferSpec, spec: *mut gst_audio_sys::GstAudioRingBufferSpec,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -304,11 +300,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audiosrc_unprepare<T: ObjectSubclass>( unsafe extern "C" fn audiosrc_unprepare<T: AudioSrcImpl>(
ptr: *mut gst_audio_sys::GstAudioSrc, ptr: *mut gst_audio_sys::GstAudioSrc,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AudioSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -327,14 +322,13 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn audiosrc_read<T: ObjectSubclass>( unsafe extern "C" fn audiosrc_read<T: AudioSrcImpl>(
ptr: *mut gst_audio_sys::GstAudioSrc, ptr: *mut gst_audio_sys::GstAudioSrc,
data: glib_sys::gpointer, data: glib_sys::gpointer,
length: u32, length: u32,
timestamp: *mut gst_sys::GstClockTime, timestamp: *mut gst_sys::GstClockTime,
) -> u32 ) -> u32
where where
T: AudioSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -352,9 +346,8 @@ where
}) })
} }
unsafe extern "C" fn audiosrc_reset<T: ObjectSubclass>(ptr: *mut gst_audio_sys::GstAudioSrc) unsafe extern "C" fn audiosrc_reset<T: AudioSrcImpl>(ptr: *mut gst_audio_sys::GstAudioSrc)
where where
T: AudioSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -24,7 +24,7 @@ use Aggregator;
use AggregatorClass; use AggregatorClass;
use AggregatorPad; use AggregatorPad;
pub trait AggregatorImpl: AggregatorImplExt + ElementImpl + Send + Sync + 'static { pub trait AggregatorImpl: AggregatorImplExt + ElementImpl {
fn flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> { fn flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> {
self.parent_flush(aggregator) self.parent_flush(aggregator)
} }
@ -252,10 +252,10 @@ pub trait AggregatorImplExt {
fn parent_negotiate(&self, aggregator: &Aggregator) -> bool; fn parent_negotiate(&self, aggregator: &Aggregator) -> bool;
} }
impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T { impl<T: AggregatorImpl> AggregatorImplExt for T {
fn parent_flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_flush(&self, aggregator: &Aggregator) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class) (*parent_class)
@ -273,7 +273,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
buffer: gst::Buffer, buffer: gst::Buffer,
) -> Option<gst::Buffer> { ) -> Option<gst::Buffer> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
match (*parent_class).clip { match (*parent_class).clip {
@ -293,7 +293,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
buffer: gst::Buffer, buffer: gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -311,7 +311,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
event: gst::Event, event: gst::Event,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -333,7 +333,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
event: gst::Event, event: gst::Event,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -355,7 +355,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -377,7 +377,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -393,7 +393,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_src_event(&self, aggregator: &Aggregator, event: gst::Event) -> bool { fn parent_src_event(&self, aggregator: &Aggregator, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -405,7 +405,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_src_query(&self, aggregator: &Aggregator, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, aggregator: &Aggregator, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -422,7 +422,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
active: bool, active: bool,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
match (*parent_class).src_activate { match (*parent_class).src_activate {
@ -446,7 +446,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
timeout: bool, timeout: bool,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -459,7 +459,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_start(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class) (*parent_class)
@ -480,7 +480,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_stop(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, aggregator: &Aggregator) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class) (*parent_class)
@ -501,7 +501,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_get_next_time(&self, aggregator: &Aggregator) -> gst::ClockTime { fn parent_get_next_time(&self, aggregator: &Aggregator) -> gst::ClockTime {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class) (*parent_class)
@ -519,7 +519,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
caps: Option<&gst::Caps>, caps: Option<&gst::Caps>,
) -> Option<AggregatorPad> { ) -> Option<AggregatorPad> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -540,7 +540,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<gst::Caps, gst::FlowError> { ) -> Result<gst::Caps, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
let f = (*parent_class) let f = (*parent_class)
@ -559,7 +559,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
fn parent_fixate_src_caps(&self, aggregator: &Aggregator, caps: gst::Caps) -> gst::Caps { fn parent_fixate_src_caps(&self, aggregator: &Aggregator, caps: gst::Caps) -> gst::Caps {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
@ -576,7 +576,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class) (*parent_class)
@ -595,7 +595,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
fn parent_negotiate(&self, aggregator: &Aggregator) -> bool { fn parent_negotiate(&self, aggregator: &Aggregator) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstAggregatorClass;
(*parent_class) (*parent_class)
@ -606,7 +606,7 @@ impl<T: AggregatorImpl + ObjectImpl> AggregatorImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + AggregatorImpl> IsSubclassable<T> for AggregatorClass unsafe impl<T: AggregatorImpl> IsSubclassable<T> for AggregatorClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -640,11 +640,10 @@ where
} }
} }
unsafe extern "C" fn aggregator_flush<T: ObjectSubclass>( unsafe extern "C" fn aggregator_flush<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -657,13 +656,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_clip<T: ObjectSubclass>( unsafe extern "C" fn aggregator_clip<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad, aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
buffer: *mut gst_sys::GstBuffer, buffer: *mut gst_sys::GstBuffer,
) -> *mut gst_sys::GstBuffer ) -> *mut gst_sys::GstBuffer
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -681,12 +679,11 @@ where
ret.map(|r| r.into_ptr()).unwrap_or(ptr::null_mut()) ret.map(|r| r.into_ptr()).unwrap_or(ptr::null_mut())
} }
unsafe extern "C" fn aggregator_finish_buffer<T: ObjectSubclass>( unsafe extern "C" fn aggregator_finish_buffer<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
buffer: *mut gst_sys::GstBuffer, buffer: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -699,13 +696,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_sink_event<T: ObjectSubclass>( unsafe extern "C" fn aggregator_sink_event<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad, aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -723,13 +719,12 @@ where
} }
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
unsafe extern "C" fn aggregator_sink_event_pre_queue<T: ObjectSubclass>( unsafe extern "C" fn aggregator_sink_event_pre_queue<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad, aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -747,13 +742,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_sink_query<T: ObjectSubclass>( unsafe extern "C" fn aggregator_sink_query<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad, aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -771,13 +765,12 @@ where
} }
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
unsafe extern "C" fn aggregator_sink_query_pre_queue<T: ObjectSubclass>( unsafe extern "C" fn aggregator_sink_query_pre_queue<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
aggregator_pad: *mut gst_base_sys::GstAggregatorPad, aggregator_pad: *mut gst_base_sys::GstAggregatorPad,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -794,12 +787,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_src_event<T: ObjectSubclass>( unsafe extern "C" fn aggregator_src_event<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -812,12 +804,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_src_query<T: ObjectSubclass>( unsafe extern "C" fn aggregator_src_query<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -830,13 +821,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_src_activate<T: ObjectSubclass>( unsafe extern "C" fn aggregator_src_activate<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
mode: gst_sys::GstPadMode, mode: gst_sys::GstPadMode,
active: glib_sys::gboolean, active: glib_sys::gboolean,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -855,12 +845,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_aggregate<T: ObjectSubclass>( unsafe extern "C" fn aggregator_aggregate<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
timeout: glib_sys::gboolean, timeout: glib_sys::gboolean,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -873,11 +862,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_start<T: ObjectSubclass>( unsafe extern "C" fn aggregator_start<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -896,11 +884,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_stop<T: ObjectSubclass>( unsafe extern "C" fn aggregator_stop<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -919,11 +906,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_get_next_time<T: ObjectSubclass>( unsafe extern "C" fn aggregator_get_next_time<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
) -> gst_sys::GstClockTime ) -> gst_sys::GstClockTime
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -936,14 +922,13 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_create_new_pad<T: ObjectSubclass>( unsafe extern "C" fn aggregator_create_new_pad<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
templ: *mut gst_sys::GstPadTemplate, templ: *mut gst_sys::GstPadTemplate,
req_name: *const libc::c_char, req_name: *const libc::c_char,
caps: *const gst_sys::GstCaps, caps: *const gst_sys::GstCaps,
) -> *mut gst_base_sys::GstAggregatorPad ) -> *mut gst_base_sys::GstAggregatorPad
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -965,13 +950,12 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn aggregator_update_src_caps<T: ObjectSubclass>( unsafe extern "C" fn aggregator_update_src_caps<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
res: *mut *mut gst_sys::GstCaps, res: *mut *mut gst_sys::GstCaps,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -992,12 +976,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn aggregator_fixate_src_caps<T: ObjectSubclass>( unsafe extern "C" fn aggregator_fixate_src_caps<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1010,12 +993,11 @@ where
.into_ptr() .into_ptr()
} }
unsafe extern "C" fn aggregator_negotiated_src_caps<T: ObjectSubclass>( unsafe extern "C" fn aggregator_negotiated_src_caps<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1035,11 +1017,10 @@ where
} }
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
unsafe extern "C" fn aggregator_negotiate<T: ObjectSubclass>( unsafe extern "C" fn aggregator_negotiate<T: AggregatorImpl>(
ptr: *mut gst_base_sys::GstAggregator, ptr: *mut gst_base_sys::GstAggregator,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: AggregatorImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

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

View file

@ -23,7 +23,7 @@ use BaseParse;
use BaseParseClass; use BaseParseClass;
use BaseParseFrame; use BaseParseFrame;
pub trait BaseParseImpl: BaseParseImplExt + ElementImpl + Send + Sync + 'static { pub trait BaseParseImpl: BaseParseImplExt + ElementImpl {
fn start(&self, element: &BaseParse) -> Result<(), gst::ErrorMessage> { fn start(&self, element: &BaseParse) -> Result<(), gst::ErrorMessage> {
self.parent_start(element) self.parent_start(element)
} }
@ -83,10 +83,10 @@ pub trait BaseParseImplExt {
) -> Option<gst::GenericFormattedValue>; ) -> Option<gst::GenericFormattedValue>;
} }
impl<T: BaseParseImpl + ObjectImpl> BaseParseImplExt for T { impl<T: BaseParseImpl> BaseParseImplExt for T {
fn parent_start(&self, element: &BaseParse) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &BaseParse) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass;
(*parent_class) (*parent_class)
@ -107,7 +107,7 @@ impl<T: BaseParseImpl + ObjectImpl> BaseParseImplExt for T {
fn parent_stop(&self, element: &BaseParse) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &BaseParse) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass;
(*parent_class) (*parent_class)
@ -132,7 +132,7 @@ impl<T: BaseParseImpl + ObjectImpl> BaseParseImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass;
(*parent_class) (*parent_class)
@ -157,7 +157,7 @@ impl<T: BaseParseImpl + ObjectImpl> BaseParseImplExt for T {
frame: BaseParseFrame, frame: BaseParseFrame,
) -> Result<(gst::FlowSuccess, u32), gst::FlowError> { ) -> Result<(gst::FlowSuccess, u32), gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass;
let mut skipsize = 0; let mut skipsize = 0;
@ -187,7 +187,7 @@ impl<T: BaseParseImpl + ObjectImpl> BaseParseImplExt for T {
dest_format: gst::Format, dest_format: gst::Format,
) -> Option<gst::GenericFormattedValue> { ) -> Option<gst::GenericFormattedValue> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseParseClass;
let src_val = src_val.into(); let src_val = src_val.into();
@ -215,7 +215,7 @@ impl<T: BaseParseImpl + ObjectImpl> BaseParseImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + BaseParseImpl> IsSubclassable<T> for BaseParseClass unsafe impl<T: BaseParseImpl> IsSubclassable<T> for BaseParseClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -232,11 +232,10 @@ where
} }
} }
unsafe extern "C" fn base_parse_start<T: ObjectSubclass>( unsafe extern "C" fn base_parse_start<T: BaseParseImpl>(
ptr: *mut gst_base_sys::GstBaseParse, ptr: *mut gst_base_sys::GstBaseParse,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseParseImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -255,11 +254,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_parse_stop<T: ObjectSubclass>( unsafe extern "C" fn base_parse_stop<T: BaseParseImpl>(
ptr: *mut gst_base_sys::GstBaseParse, ptr: *mut gst_base_sys::GstBaseParse,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseParseImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -278,12 +276,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_parse_set_sink_caps<T: ObjectSubclass>( unsafe extern "C" fn base_parse_set_sink_caps<T: BaseParseImpl>(
ptr: *mut gst_base_sys::GstBaseParse, ptr: *mut gst_base_sys::GstBaseParse,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseParseImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -303,13 +300,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_parse_handle_frame<T: ObjectSubclass>( unsafe extern "C" fn base_parse_handle_frame<T: BaseParseImpl>(
ptr: *mut gst_base_sys::GstBaseParse, ptr: *mut gst_base_sys::GstBaseParse,
frame: *mut gst_base_sys::GstBaseParseFrame, frame: *mut gst_base_sys::GstBaseParseFrame,
skipsize: *mut i32, skipsize: *mut i32,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseParseImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -331,7 +327,7 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_parse_convert<T: ObjectSubclass>( unsafe extern "C" fn base_parse_convert<T: BaseParseImpl>(
ptr: *mut gst_base_sys::GstBaseParse, ptr: *mut gst_base_sys::GstBaseParse,
source_format: gst_sys::GstFormat, source_format: gst_sys::GstFormat,
source_value: i64, source_value: i64,
@ -339,7 +335,6 @@ unsafe extern "C" fn base_parse_convert<T: ObjectSubclass>(
dest_value: *mut i64, dest_value: *mut i64,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseParseImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -21,7 +21,7 @@ use std::ptr;
use BaseSink; use BaseSink;
use BaseSinkClass; use BaseSinkClass;
pub trait BaseSinkImpl: BaseSinkImplExt + ElementImpl + Send + Sync + 'static { pub trait BaseSinkImpl: BaseSinkImplExt + ElementImpl {
fn start(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> { fn start(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> {
self.parent_start(element) self.parent_start(element)
} }
@ -139,10 +139,10 @@ pub trait BaseSinkImplExt {
fn parent_unlock_stop(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage>; fn parent_unlock_stop(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage>;
} }
impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T { impl<T: BaseSinkImpl> BaseSinkImplExt for T {
fn parent_start(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -163,7 +163,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
fn parent_stop(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -188,7 +188,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
buffer: &gst::Buffer, buffer: &gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -207,7 +207,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
buffer: &gst::Buffer, buffer: &gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -224,7 +224,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
list: &gst::BufferList, list: &gst::BufferList,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -248,7 +248,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
list: &gst::BufferList, list: &gst::BufferList,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -268,7 +268,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
fn parent_query(&self, element: &BaseSink, query: &mut gst::QueryRef) -> bool { fn parent_query(&self, element: &BaseSink, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -280,7 +280,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
fn parent_event(&self, element: &BaseSink, event: gst::Event) -> bool { fn parent_event(&self, element: &BaseSink, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -292,7 +292,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
fn parent_get_caps(&self, element: &BaseSink, filter: Option<&gst::Caps>) -> Option<gst::Caps> { fn parent_get_caps(&self, element: &BaseSink, filter: Option<&gst::Caps>) -> Option<gst::Caps> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
@ -309,7 +309,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -327,7 +327,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
fn parent_fixate(&self, element: &BaseSink, caps: gst::Caps) -> gst::Caps { fn parent_fixate(&self, element: &BaseSink, caps: gst::Caps) -> gst::Caps {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
@ -340,7 +340,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
fn parent_unlock(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> { fn parent_unlock(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -361,7 +361,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
fn parent_unlock_stop(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> { fn parent_unlock_stop(&self, element: &BaseSink) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSinkClass;
(*parent_class) (*parent_class)
@ -381,7 +381,7 @@ impl<T: BaseSinkImpl + ObjectImpl> BaseSinkImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + BaseSinkImpl> IsSubclassable<T> for BaseSinkClass unsafe impl<T: BaseSinkImpl> IsSubclassable<T> for BaseSinkClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -406,11 +406,10 @@ where
} }
} }
unsafe extern "C" fn base_sink_start<T: ObjectSubclass>( unsafe extern "C" fn base_sink_start<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -429,11 +428,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_stop<T: ObjectSubclass>( unsafe extern "C" fn base_sink_stop<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -452,12 +450,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_render<T: ObjectSubclass>( unsafe extern "C" fn base_sink_render<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
buffer: *mut gst_sys::GstBuffer, buffer: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -471,12 +468,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_prepare<T: ObjectSubclass>( unsafe extern "C" fn base_sink_prepare<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
buffer: *mut gst_sys::GstBuffer, buffer: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -490,12 +486,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_render_list<T: ObjectSubclass>( unsafe extern "C" fn base_sink_render_list<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
list: *mut gst_sys::GstBufferList, list: *mut gst_sys::GstBufferList,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -509,12 +504,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_prepare_list<T: ObjectSubclass>( unsafe extern "C" fn base_sink_prepare_list<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
list: *mut gst_sys::GstBufferList, list: *mut gst_sys::GstBufferList,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -528,12 +522,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_query<T: ObjectSubclass>( unsafe extern "C" fn base_sink_query<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
query_ptr: *mut gst_sys::GstQuery, query_ptr: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -547,12 +540,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_event<T: ObjectSubclass>( unsafe extern "C" fn base_sink_event<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
event_ptr: *mut gst_sys::GstEvent, event_ptr: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -565,12 +557,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_get_caps<T: ObjectSubclass>( unsafe extern "C" fn base_sink_get_caps<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
filter: *mut gst_sys::GstCaps, filter: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -585,12 +576,11 @@ where
.unwrap_or(ptr::null_mut()) .unwrap_or(ptr::null_mut())
} }
unsafe extern "C" fn base_sink_set_caps<T: ObjectSubclass>( unsafe extern "C" fn base_sink_set_caps<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -610,12 +600,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_fixate<T: ObjectSubclass>( unsafe extern "C" fn base_sink_fixate<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -629,11 +618,10 @@ where
.into_ptr() .into_ptr()
} }
unsafe extern "C" fn base_sink_unlock<T: ObjectSubclass>( unsafe extern "C" fn base_sink_unlock<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -652,11 +640,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_sink_unlock_stop<T: ObjectSubclass>( unsafe extern "C" fn base_sink_unlock_stop<T: BaseSinkImpl>(
ptr: *mut gst_base_sys::GstBaseSink, ptr: *mut gst_base_sys::GstBaseSink,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -28,7 +28,7 @@ pub enum CreateSuccess {
NewBuffer(gst::Buffer), NewBuffer(gst::Buffer),
} }
pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl + Send + Sync + 'static { pub trait BaseSrcImpl: BaseSrcImplExt + ElementImpl {
fn start(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> { fn start(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> {
self.parent_start(element) self.parent_start(element)
} }
@ -180,10 +180,10 @@ pub trait BaseSrcImplExt {
fn parent_unlock_stop(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage>; fn parent_unlock_stop(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage>;
} }
impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T { impl<T: BaseSrcImpl> BaseSrcImplExt for T {
fn parent_start(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -204,7 +204,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_stop(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -225,7 +225,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_is_seekable(&self, element: &BaseSrc) -> bool { fn parent_is_seekable(&self, element: &BaseSrc) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -237,7 +237,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_get_size(&self, element: &BaseSrc) -> Option<u64> { fn parent_get_size(&self, element: &BaseSrc) -> Option<u64> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -260,7 +260,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
buffer: &gst::BufferRef, buffer: &gst::BufferRef,
) -> (gst::ClockTime, gst::ClockTime) { ) -> (gst::ClockTime, gst::ClockTime) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -291,7 +291,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
buffer: &mut gst::BufferRef, buffer: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -316,7 +316,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
length: u32, length: u32,
) -> Result<gst::Buffer, gst::FlowError> { ) -> Result<gst::Buffer, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -348,7 +348,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
length: u32, length: u32,
) -> Result<CreateSuccess, gst::FlowError> { ) -> Result<CreateSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -427,7 +427,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_do_seek(&self, element: &BaseSrc, segment: &mut gst::Segment) -> bool { fn parent_do_seek(&self, element: &BaseSrc, segment: &mut gst::Segment) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -439,7 +439,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_query(&self, element: &BaseSrc, query: &mut gst::QueryRef) -> bool { fn parent_query(&self, element: &BaseSrc, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -451,7 +451,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_event(&self, element: &BaseSrc, event: &gst::Event) -> bool { fn parent_event(&self, element: &BaseSrc, event: &gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -463,7 +463,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_get_caps(&self, element: &BaseSrc, filter: Option<&gst::Caps>) -> Option<gst::Caps> { fn parent_get_caps(&self, element: &BaseSrc, filter: Option<&gst::Caps>) -> Option<gst::Caps> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
@ -476,7 +476,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_negotiate(&self, element: &BaseSrc) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &BaseSrc) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -498,7 +498,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -516,7 +516,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_fixate(&self, element: &BaseSrc, caps: gst::Caps) -> gst::Caps { fn parent_fixate(&self, element: &BaseSrc, caps: gst::Caps) -> gst::Caps {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
@ -529,7 +529,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_unlock(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> { fn parent_unlock(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -550,7 +550,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
fn parent_unlock_stop(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> { fn parent_unlock_stop(&self, element: &BaseSrc) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseSrcClass;
(*parent_class) (*parent_class)
@ -570,7 +570,7 @@ impl<T: BaseSrcImpl + ObjectImpl> BaseSrcImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + BaseSrcImpl> IsSubclassable<T> for BaseSrcClass unsafe impl<T: BaseSrcImpl> IsSubclassable<T> for BaseSrcClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -599,11 +599,10 @@ where
} }
} }
unsafe extern "C" fn base_src_start<T: ObjectSubclass>( unsafe extern "C" fn base_src_start<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -622,11 +621,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_stop<T: ObjectSubclass>( unsafe extern "C" fn base_src_stop<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -645,11 +643,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_is_seekable<T: ObjectSubclass>( unsafe extern "C" fn base_src_is_seekable<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -662,12 +659,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_get_size<T: ObjectSubclass>( unsafe extern "C" fn base_src_get_size<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
size: *mut u64, size: *mut u64,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -686,13 +682,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_get_times<T: ObjectSubclass>( unsafe extern "C" fn base_src_get_times<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
buffer: *mut gst_sys::GstBuffer, buffer: *mut gst_sys::GstBuffer,
start: *mut gst_sys::GstClockTime, start: *mut gst_sys::GstClockTime,
stop: *mut gst_sys::GstClockTime, stop: *mut gst_sys::GstClockTime,
) where ) where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -710,14 +705,13 @@ unsafe extern "C" fn base_src_get_times<T: ObjectSubclass>(
}); });
} }
unsafe extern "C" fn base_src_fill<T: ObjectSubclass>( unsafe extern "C" fn base_src_fill<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
offset: u64, offset: u64,
length: u32, length: u32,
buffer: *mut gst_sys::GstBuffer, buffer: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -731,14 +725,13 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_alloc<T: ObjectSubclass>( unsafe extern "C" fn base_src_alloc<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
offset: u64, offset: u64,
length: u32, length: u32,
buffer_ptr: *mut gst_sys::GstBuffer, buffer_ptr: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -760,14 +753,13 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_create<T: ObjectSubclass>( unsafe extern "C" fn base_src_create<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
offset: u64, offset: u64,
length: u32, length: u32,
buffer_ptr: *mut gst_sys::GstBuffer, buffer_ptr: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -845,12 +837,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_do_seek<T: ObjectSubclass>( unsafe extern "C" fn base_src_do_seek<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
segment: *mut gst_sys::GstSegment, segment: *mut gst_sys::GstSegment,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -867,12 +858,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_query<T: ObjectSubclass>( unsafe extern "C" fn base_src_query<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
query_ptr: *mut gst_sys::GstQuery, query_ptr: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -886,12 +876,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_event<T: ObjectSubclass>( unsafe extern "C" fn base_src_event<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
event_ptr: *mut gst_sys::GstEvent, event_ptr: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -904,12 +893,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_get_caps<T: ObjectSubclass>( unsafe extern "C" fn base_src_get_caps<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
filter: *mut gst_sys::GstCaps, filter: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -924,11 +912,10 @@ where
.unwrap_or(ptr::null_mut()) .unwrap_or(ptr::null_mut())
} }
unsafe extern "C" fn base_src_negotiate<T: ObjectSubclass>( unsafe extern "C" fn base_src_negotiate<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -947,12 +934,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_set_caps<T: ObjectSubclass>( unsafe extern "C" fn base_src_set_caps<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -972,12 +958,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_fixate<T: ObjectSubclass>( unsafe extern "C" fn base_src_fixate<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -991,11 +976,10 @@ where
.into_ptr() .into_ptr()
} }
unsafe extern "C" fn base_src_unlock<T: ObjectSubclass>( unsafe extern "C" fn base_src_unlock<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1014,11 +998,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_src_unlock_stop<T: ObjectSubclass>( unsafe extern "C" fn base_src_unlock_stop<T: BaseSrcImpl>(
ptr: *mut gst_base_sys::GstBaseSrc, ptr: *mut gst_base_sys::GstBaseSrc,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -23,7 +23,7 @@ use std::ptr;
use BaseTransform; use BaseTransform;
use BaseTransformClass; use BaseTransformClass;
pub trait BaseTransformImpl: BaseTransformImplExt + ElementImpl + Send + Sync + 'static { pub trait BaseTransformImpl: BaseTransformImplExt + ElementImpl {
fn start(&self, element: &BaseTransform) -> Result<(), gst::ErrorMessage> { fn start(&self, element: &BaseTransform) -> Result<(), gst::ErrorMessage> {
self.parent_start(element) self.parent_start(element)
} }
@ -297,10 +297,10 @@ pub trait BaseTransformImplExt {
<Self as ObjectSubclass>::ParentType: IsA<BaseTransform>; <Self as ObjectSubclass>::ParentType: IsA<BaseTransform>;
} }
impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T { impl<T: BaseTransformImpl> BaseTransformImplExt for T {
fn parent_start(&self, element: &BaseTransform) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &BaseTransform) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -321,7 +321,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
fn parent_stop(&self, element: &BaseTransform) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &BaseTransform) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -348,7 +348,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
filter: Option<&gst::Caps>, filter: Option<&gst::Caps>,
) -> Option<gst::Caps> { ) -> Option<gst::Caps> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -373,7 +373,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
othercaps: gst::Caps, othercaps: gst::Caps,
) -> gst::Caps { ) -> gst::Caps {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
match (*parent_class).fixate_caps { match (*parent_class).fixate_caps {
@ -395,7 +395,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
outcaps: &gst::Caps, outcaps: &gst::Caps,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -422,7 +422,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
caps: &gst::Caps, caps: &gst::Caps,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -445,7 +445,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -470,7 +470,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
othercaps: &gst::Caps, othercaps: &gst::Caps,
) -> Option<usize> { ) -> Option<usize> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -497,7 +497,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
fn parent_get_unit_size(&self, element: &BaseTransform, caps: &gst::Caps) -> Option<usize> { fn parent_get_unit_size(&self, element: &BaseTransform, caps: &gst::Caps) -> Option<usize> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
let f = (*parent_class).get_unit_size.unwrap_or_else(|| { let f = (*parent_class).get_unit_size.unwrap_or_else(|| {
@ -529,7 +529,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
fn parent_sink_event(&self, element: &BaseTransform, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &BaseTransform, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -541,7 +541,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
fn parent_src_event(&self, element: &BaseTransform, event: gst::Event) -> bool { fn parent_src_event(&self, element: &BaseTransform, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -557,7 +557,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
inbuf: &gst::BufferRef, inbuf: &gst::BufferRef,
) -> Result<PrepareOutputBufferSuccess, gst::FlowError> { ) -> Result<PrepareOutputBufferSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -593,7 +593,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
outbuf: &mut gst::BufferRef, outbuf: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -625,7 +625,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
buf: &mut gst::BufferRef, buf: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
let f = (*parent_class).transform_ip.unwrap_or_else(|| { let f = (*parent_class).transform_ip.unwrap_or_else(|| {
@ -653,7 +653,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
buf: &gst::Buffer, buf: &gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
let f = (*parent_class).transform_ip.unwrap_or_else(|| { let f = (*parent_class).transform_ip.unwrap_or_else(|| {
@ -683,7 +683,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
outbuf: &mut gst::BufferRef, outbuf: &mut gst::BufferRef,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
if let Some(ref f) = (*parent_class).copy_metadata { if let Some(ref f) = (*parent_class).copy_metadata {
@ -710,7 +710,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
inbuf: &'a gst::BufferRef, inbuf: &'a gst::BufferRef,
) -> bool { ) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
(*parent_class) (*parent_class)
@ -729,7 +729,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
fn parent_before_transform(&self, element: &BaseTransform, inbuf: &gst::BufferRef) { fn parent_before_transform(&self, element: &BaseTransform, inbuf: &gst::BufferRef) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
if let Some(ref f) = (*parent_class).before_transform { if let Some(ref f) = (*parent_class).before_transform {
@ -745,7 +745,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
inbuf: gst::Buffer, inbuf: gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
let f = (*parent_class) let f = (*parent_class)
@ -766,7 +766,7 @@ impl<T: BaseTransformImpl + ObjectImpl> BaseTransformImplExt for T {
element: &BaseTransform, element: &BaseTransform,
) -> Result<GenerateOutputSuccess, gst::FlowError> { ) -> Result<GenerateOutputSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstBaseTransformClass;
let f = (*parent_class) let f = (*parent_class)
@ -827,7 +827,7 @@ pub enum BaseTransformMode {
Both, Both,
} }
unsafe impl<T: ObjectSubclass + BaseTransformImpl> IsSubclassable<T> for BaseTransformClass unsafe impl<T: BaseTransformImpl> IsSubclassable<T> for BaseTransformClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -857,7 +857,7 @@ where
} }
pub unsafe trait BaseTransformClassSubclassExt: Sized + 'static { pub unsafe trait BaseTransformClassSubclassExt: Sized + 'static {
fn configure<T: ObjectSubclass + BaseTransformImpl>( fn configure<T: BaseTransformImpl>(
&mut self, &mut self,
mode: BaseTransformMode, mode: BaseTransformMode,
passthrough_on_same_caps: bool, passthrough_on_same_caps: bool,
@ -890,7 +890,7 @@ pub unsafe trait BaseTransformClassSubclassExt: Sized + 'static {
unsafe impl<T: ClassStruct> BaseTransformClassSubclassExt for T unsafe impl<T: ClassStruct> BaseTransformClassSubclassExt for T
where where
T::Type: ObjectSubclass + BaseTransformImpl, T::Type: BaseTransformImpl,
<T::Type as ObjectSubclass>::Instance: PanicPoison, <T::Type as ObjectSubclass>::Instance: PanicPoison,
{ {
} }
@ -908,11 +908,10 @@ pub enum PrepareOutputBufferSuccess {
InputBuffer, InputBuffer,
} }
unsafe extern "C" fn base_transform_start<T: ObjectSubclass>( unsafe extern "C" fn base_transform_start<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -931,11 +930,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_stop<T: ObjectSubclass>( unsafe extern "C" fn base_transform_stop<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -954,14 +952,13 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_transform_caps<T: ObjectSubclass>( unsafe extern "C" fn base_transform_transform_caps<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
direction: gst_sys::GstPadDirection, direction: gst_sys::GstPadDirection,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
filter: *mut gst_sys::GstCaps, filter: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -982,14 +979,13 @@ where
.unwrap_or(std::ptr::null_mut()) .unwrap_or(std::ptr::null_mut())
} }
unsafe extern "C" fn base_transform_fixate_caps<T: ObjectSubclass>( unsafe extern "C" fn base_transform_fixate_caps<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
direction: gst_sys::GstPadDirection, direction: gst_sys::GstPadDirection,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
othercaps: *mut gst_sys::GstCaps, othercaps: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1007,13 +1003,12 @@ where
.into_ptr() .into_ptr()
} }
unsafe extern "C" fn base_transform_set_caps<T: ObjectSubclass>( unsafe extern "C" fn base_transform_set_caps<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
incaps: *mut gst_sys::GstCaps, incaps: *mut gst_sys::GstCaps,
outcaps: *mut gst_sys::GstCaps, outcaps: *mut gst_sys::GstCaps,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1032,13 +1027,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_accept_caps<T: ObjectSubclass>( unsafe extern "C" fn base_transform_accept_caps<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
direction: gst_sys::GstPadDirection, direction: gst_sys::GstPadDirection,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1051,13 +1045,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_query<T: ObjectSubclass>( unsafe extern "C" fn base_transform_query<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
direction: gst_sys::GstPadDirection, direction: gst_sys::GstPadDirection,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1075,7 +1068,7 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_transform_size<T: ObjectSubclass>( unsafe extern "C" fn base_transform_transform_size<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
direction: gst_sys::GstPadDirection, direction: gst_sys::GstPadDirection,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
@ -1084,7 +1077,6 @@ unsafe extern "C" fn base_transform_transform_size<T: ObjectSubclass>(
othersize: *mut usize, othersize: *mut usize,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1109,13 +1101,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_get_unit_size<T: ObjectSubclass>( unsafe extern "C" fn base_transform_get_unit_size<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
caps: *mut gst_sys::GstCaps, caps: *mut gst_sys::GstCaps,
size: *mut usize, size: *mut usize,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1134,13 +1125,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_prepare_output_buffer<T: ObjectSubclass>( unsafe extern "C" fn base_transform_prepare_output_buffer<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
inbuf: *mut gst_sys::GstBuffer, inbuf: *mut gst_sys::GstBuffer,
outbuf: *mut gst_sys::GstBuffer, outbuf: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1166,12 +1156,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_sink_event<T: ObjectSubclass>( unsafe extern "C" fn base_transform_sink_event<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1184,12 +1173,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_src_event<T: ObjectSubclass>( unsafe extern "C" fn base_transform_src_event<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1202,13 +1190,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_transform<T: ObjectSubclass>( unsafe extern "C" fn base_transform_transform<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
inbuf: *mut gst_sys::GstBuffer, inbuf: *mut gst_sys::GstBuffer,
outbuf: *mut gst_sys::GstBuffer, outbuf: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1226,12 +1213,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_transform_ip<T: ObjectSubclass>( unsafe extern "C" fn base_transform_transform_ip<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
buf: *mut *mut gst_sys::GstBuffer, buf: *mut *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1253,14 +1239,13 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_transform_meta<T: ObjectSubclass>( unsafe extern "C" fn base_transform_transform_meta<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
outbuf: *mut gst_sys::GstBuffer, outbuf: *mut gst_sys::GstBuffer,
meta: *mut gst_sys::GstMeta, meta: *mut gst_sys::GstMeta,
inbuf: *mut gst_sys::GstBuffer, inbuf: *mut gst_sys::GstBuffer,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1280,13 +1265,12 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_copy_metadata<T: ObjectSubclass>( unsafe extern "C" fn base_transform_copy_metadata<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
inbuf: *mut gst_sys::GstBuffer, inbuf: *mut gst_sys::GstBuffer,
outbuf: *mut gst_sys::GstBuffer, outbuf: *mut gst_sys::GstBuffer,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1319,11 +1303,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_before_transform<T: ObjectSubclass>( unsafe extern "C" fn base_transform_before_transform<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
inbuf: *mut gst_sys::GstBuffer, inbuf: *mut gst_sys::GstBuffer,
) where ) where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1335,13 +1318,12 @@ unsafe extern "C" fn base_transform_before_transform<T: ObjectSubclass>(
}) })
} }
unsafe extern "C" fn base_transform_submit_input_buffer<T: ObjectSubclass>( unsafe extern "C" fn base_transform_submit_input_buffer<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
is_discont: glib_sys::gboolean, is_discont: glib_sys::gboolean,
buf: *mut gst_sys::GstBuffer, buf: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -1355,12 +1337,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn base_transform_generate_output<T: ObjectSubclass>( unsafe extern "C" fn base_transform_generate_output<T: BaseTransformImpl>(
ptr: *mut gst_base_sys::GstBaseTransform, ptr: *mut gst_base_sys::GstBaseTransform,
buf: *mut *mut gst_sys::GstBuffer, buf: *mut *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: BaseTransformImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -21,7 +21,7 @@ use super::base_src::BaseSrcImpl;
use PushSrc; use PushSrc;
use PushSrcClass; use PushSrcClass;
pub trait PushSrcImpl: PushSrcImplExt + BaseSrcImpl + Send + Sync + 'static { pub trait PushSrcImpl: PushSrcImplExt + BaseSrcImpl {
fn fill( fn fill(
&self, &self,
element: &PushSrc, element: &PushSrc,
@ -51,14 +51,14 @@ pub trait PushSrcImplExt {
fn parent_create(&self, element: &PushSrc) -> Result<gst::Buffer, gst::FlowError>; fn parent_create(&self, element: &PushSrc) -> Result<gst::Buffer, gst::FlowError>;
} }
impl<T: PushSrcImpl + ObjectImpl> PushSrcImplExt for T { impl<T: PushSrcImpl> PushSrcImplExt for T {
fn parent_fill( fn parent_fill(
&self, &self,
element: &PushSrc, element: &PushSrc,
buffer: &mut gst::BufferRef, buffer: &mut gst::BufferRef,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstPushSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstPushSrcClass;
(*parent_class) (*parent_class)
@ -73,7 +73,7 @@ impl<T: PushSrcImpl + ObjectImpl> PushSrcImplExt for T {
fn parent_alloc(&self, element: &PushSrc) -> Result<gst::Buffer, gst::FlowError> { fn parent_alloc(&self, element: &PushSrc) -> Result<gst::Buffer, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstPushSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstPushSrcClass;
(*parent_class) (*parent_class)
@ -94,7 +94,7 @@ impl<T: PushSrcImpl + ObjectImpl> PushSrcImplExt for T {
fn parent_create(&self, element: &PushSrc) -> Result<gst::Buffer, gst::FlowError> { fn parent_create(&self, element: &PushSrc) -> Result<gst::Buffer, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_base_sys::GstPushSrcClass; data.as_ref().get_parent_class() as *mut gst_base_sys::GstPushSrcClass;
(*parent_class) (*parent_class)
@ -114,7 +114,7 @@ impl<T: PushSrcImpl + ObjectImpl> PushSrcImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + PushSrcImpl> IsSubclassable<T> for PushSrcClass unsafe impl<T: PushSrcImpl> IsSubclassable<T> for PushSrcClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -129,12 +129,11 @@ where
} }
} }
unsafe extern "C" fn push_src_fill<T: ObjectSubclass>( unsafe extern "C" fn push_src_fill<T: PushSrcImpl>(
ptr: *mut gst_base_sys::GstPushSrc, ptr: *mut gst_base_sys::GstPushSrc,
buffer: *mut gst_sys::GstBuffer, buffer: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: PushSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -148,12 +147,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn push_src_alloc<T: ObjectSubclass>( unsafe extern "C" fn push_src_alloc<T: PushSrcImpl>(
ptr: *mut gst_base_sys::GstPushSrc, ptr: *mut gst_base_sys::GstPushSrc,
buffer_ptr: *mut gst_sys::GstBuffer, buffer_ptr: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: PushSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -175,12 +173,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn push_src_create<T: ObjectSubclass>( unsafe extern "C" fn push_src_create<T: PushSrcImpl>(
ptr: *mut gst_base_sys::GstPushSrc, ptr: *mut gst_base_sys::GstPushSrc,
buffer_ptr: *mut gst_sys::GstBuffer, buffer_ptr: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: PushSrcImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -16,7 +16,7 @@ use std::mem;
use RTSPClient; use RTSPClient;
use RTSPClientClass; use RTSPClientClass;
pub trait RTSPClientImpl: RTSPClientImplExt + ObjectImpl + Send + Sync + 'static { pub trait RTSPClientImpl: RTSPClientImplExt + ObjectImpl + Send + Sync {
fn create_sdp(&self, client: &RTSPClient, media: &::RTSPMedia) -> Option<gst_sdp::SDPMessage> { fn create_sdp(&self, client: &RTSPClient, media: &::RTSPMedia) -> Option<gst_sdp::SDPMessage> {
self.parent_create_sdp(client, media) self.parent_create_sdp(client, media)
} }
@ -336,14 +336,14 @@ pub trait RTSPClientImplExt {
) -> gst_rtsp::RTSPStatusCode; ) -> gst_rtsp::RTSPStatusCode;
} }
impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T { impl<T: RTSPClientImpl> RTSPClientImplExt for T {
fn parent_create_sdp( fn parent_create_sdp(
&self, &self,
client: &RTSPClient, client: &RTSPClient,
media: &::RTSPMedia, media: &::RTSPMedia,
) -> Option<gst_sdp::SDPMessage> { ) -> Option<gst_sdp::SDPMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
@ -362,7 +362,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
let f = (*parent_class).configure_client_media.expect( let f = (*parent_class).configure_client_media.expect(
@ -386,7 +386,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_params_set(&self, client: &RTSPClient, ctx: &::RTSPContext) -> gst_rtsp::RTSPResult { fn parent_params_set(&self, client: &RTSPClient, ctx: &::RTSPContext) -> gst_rtsp::RTSPResult {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
@ -399,7 +399,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_params_get(&self, client: &RTSPClient, ctx: &::RTSPContext) -> gst_rtsp::RTSPResult { fn parent_params_get(&self, client: &RTSPClient, ctx: &::RTSPContext) -> gst_rtsp::RTSPResult {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
@ -416,7 +416,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
url: &gst_rtsp::RTSPUrl, url: &gst_rtsp::RTSPUrl,
) -> Option<glib::GString> { ) -> Option<glib::GString> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
@ -429,7 +429,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_closed(&self, client: &RTSPClient) { fn parent_closed(&self, client: &RTSPClient) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).closed { if let Some(f) = (*parent_class).closed {
@ -440,7 +440,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_new_session(&self, client: &RTSPClient, session: &::RTSPSession) { fn parent_new_session(&self, client: &RTSPClient, session: &::RTSPSession) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).new_session { if let Some(f) = (*parent_class).new_session {
@ -451,7 +451,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_options_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_options_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).options_request { if let Some(f) = (*parent_class).options_request {
@ -462,7 +462,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_describe_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_describe_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).describe_request { if let Some(f) = (*parent_class).describe_request {
@ -473,7 +473,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_setup_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_setup_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).setup_request { if let Some(f) = (*parent_class).setup_request {
@ -484,7 +484,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_play_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_play_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).play_request { if let Some(f) = (*parent_class).play_request {
@ -495,7 +495,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_pause_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_pause_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pause_request { if let Some(f) = (*parent_class).pause_request {
@ -506,7 +506,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_teardown_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_teardown_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).teardown_request { if let Some(f) = (*parent_class).teardown_request {
@ -517,7 +517,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_set_parameter_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_set_parameter_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).set_parameter_request { if let Some(f) = (*parent_class).set_parameter_request {
@ -528,7 +528,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_get_parameter_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_get_parameter_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).get_parameter_request { if let Some(f) = (*parent_class).get_parameter_request {
@ -539,7 +539,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_announce_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_announce_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).announce_request { if let Some(f) = (*parent_class).announce_request {
@ -550,7 +550,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_record_request(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_record_request(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).record_request { if let Some(f) = (*parent_class).record_request {
@ -561,7 +561,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
fn parent_handle_response(&self, client: &RTSPClient, ctx: &::RTSPContext) { fn parent_handle_response(&self, client: &RTSPClient, ctx: &::RTSPContext) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).handle_response { if let Some(f) = (*parent_class).handle_response {
@ -581,7 +581,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
sdp: &gst_sdp::SDPMessageRef, sdp: &gst_sdp::SDPMessageRef,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
let f = (*parent_class) let f = (*parent_class)
@ -608,7 +608,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
arr: &[String], arr: &[String],
) -> Option<glib::GString> { ) -> Option<glib::GString> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).check_requirements { if let Some(f) = (*parent_class).check_requirements {
@ -629,7 +629,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_options_request { if let Some(f) = (*parent_class).pre_options_request {
@ -646,7 +646,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_describe_request { if let Some(f) = (*parent_class).pre_describe_request {
@ -663,7 +663,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_setup_request { if let Some(f) = (*parent_class).pre_setup_request {
@ -680,7 +680,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_play_request { if let Some(f) = (*parent_class).pre_play_request {
@ -697,7 +697,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_pause_request { if let Some(f) = (*parent_class).pre_pause_request {
@ -714,7 +714,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_teardown_request { if let Some(f) = (*parent_class).pre_teardown_request {
@ -731,7 +731,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_set_parameter_request { if let Some(f) = (*parent_class).pre_set_parameter_request {
@ -748,7 +748,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_get_parameter_request { if let Some(f) = (*parent_class).pre_get_parameter_request {
@ -765,7 +765,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_announce_request { if let Some(f) = (*parent_class).pre_announce_request {
@ -782,7 +782,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
ctx: &::RTSPContext, ctx: &::RTSPContext,
) -> gst_rtsp::RTSPStatusCode { ) -> gst_rtsp::RTSPStatusCode {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPClientClass;
if let Some(f) = (*parent_class).pre_record_request { if let Some(f) = (*parent_class).pre_record_request {
@ -793,7 +793,7 @@ impl<T: RTSPClientImpl + ObjectImpl> RTSPClientImplExt for T {
} }
} }
} }
unsafe impl<T: ObjectSubclass + RTSPClientImpl> IsSubclassable<T> for RTSPClientClass { unsafe impl<T: RTSPClientImpl> IsSubclassable<T> for RTSPClientClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
@ -832,13 +832,10 @@ unsafe impl<T: ObjectSubclass + RTSPClientImpl> IsSubclassable<T> for RTSPClient
} }
} }
unsafe extern "C" fn client_create_sdp<T: ObjectSubclass>( unsafe extern "C" fn client_create_sdp<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
media: *mut gst_rtsp_server_sys::GstRTSPMedia, media: *mut gst_rtsp_server_sys::GstRTSPMedia,
) -> *mut gst_sdp_sys::GstSDPMessage ) -> *mut gst_sdp_sys::GstSDPMessage {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -849,15 +846,12 @@ where
ptr as *mut _ ptr as *mut _
} }
unsafe extern "C" fn client_configure_client_media<T: ObjectSubclass>( unsafe extern "C" fn client_configure_client_media<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
media: *mut gst_rtsp_server_sys::GstRTSPMedia, media: *mut gst_rtsp_server_sys::GstRTSPMedia,
stream: *mut gst_rtsp_server_sys::GstRTSPStream, stream: *mut gst_rtsp_server_sys::GstRTSPStream,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -876,13 +870,10 @@ where
} }
} }
unsafe extern "C" fn client_params_set<T: ObjectSubclass>( unsafe extern "C" fn client_params_set<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPResult ) -> gst_rtsp_sys::GstRTSPResult {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -890,13 +881,10 @@ where
imp.params_set(&wrap, &from_glib_borrow(ctx)).to_glib() imp.params_set(&wrap, &from_glib_borrow(ctx)).to_glib()
} }
unsafe extern "C" fn client_params_get<T: ObjectSubclass>( unsafe extern "C" fn client_params_get<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPResult ) -> gst_rtsp_sys::GstRTSPResult {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -904,13 +892,10 @@ where
imp.params_get(&wrap, &from_glib_borrow(ctx)).to_glib() imp.params_get(&wrap, &from_glib_borrow(ctx)).to_glib()
} }
unsafe extern "C" fn client_make_path_from_uri<T: ObjectSubclass>( unsafe extern "C" fn client_make_path_from_uri<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
url: *const gst_rtsp_sys::GstRTSPUrl, url: *const gst_rtsp_sys::GstRTSPUrl,
) -> *mut std::os::raw::c_char ) -> *mut std::os::raw::c_char {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -919,10 +904,9 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn client_closed<T: ObjectSubclass>(ptr: *mut gst_rtsp_server_sys::GstRTSPClient) unsafe extern "C" fn client_closed<T: RTSPClientImpl>(
where ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
T: RTSPClientImpl, ) {
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -930,12 +914,10 @@ where
imp.closed(&wrap); imp.closed(&wrap);
} }
unsafe extern "C" fn client_new_session<T: ObjectSubclass>( unsafe extern "C" fn client_new_session<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
session: *mut gst_rtsp_server_sys::GstRTSPSession, session: *mut gst_rtsp_server_sys::GstRTSPSession,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -943,12 +925,10 @@ unsafe extern "C" fn client_new_session<T: ObjectSubclass>(
imp.new_session(&wrap, &from_glib_borrow(session)); imp.new_session(&wrap, &from_glib_borrow(session));
} }
unsafe extern "C" fn client_options_request<T: ObjectSubclass>( unsafe extern "C" fn client_options_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -956,12 +936,10 @@ unsafe extern "C" fn client_options_request<T: ObjectSubclass>(
imp.options_request(&wrap, &from_glib_borrow(ctx)); imp.options_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_describe_request<T: ObjectSubclass>( unsafe extern "C" fn client_describe_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -969,12 +947,10 @@ unsafe extern "C" fn client_describe_request<T: ObjectSubclass>(
imp.describe_request(&wrap, &from_glib_borrow(ctx)); imp.describe_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_setup_request<T: ObjectSubclass>( unsafe extern "C" fn client_setup_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -982,12 +958,10 @@ unsafe extern "C" fn client_setup_request<T: ObjectSubclass>(
imp.setup_request(&wrap, &from_glib_borrow(ctx)); imp.setup_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_play_request<T: ObjectSubclass>( unsafe extern "C" fn client_play_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -995,12 +969,10 @@ unsafe extern "C" fn client_play_request<T: ObjectSubclass>(
imp.play_request(&wrap, &from_glib_borrow(ctx)); imp.play_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_pause_request<T: ObjectSubclass>( unsafe extern "C" fn client_pause_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1008,12 +980,10 @@ unsafe extern "C" fn client_pause_request<T: ObjectSubclass>(
imp.pause_request(&wrap, &from_glib_borrow(ctx)); imp.pause_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_teardown_request<T: ObjectSubclass>( unsafe extern "C" fn client_teardown_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1021,12 +991,10 @@ unsafe extern "C" fn client_teardown_request<T: ObjectSubclass>(
imp.teardown_request(&wrap, &from_glib_borrow(ctx)); imp.teardown_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_set_parameter_request<T: ObjectSubclass>( unsafe extern "C" fn client_set_parameter_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1034,12 +1002,10 @@ unsafe extern "C" fn client_set_parameter_request<T: ObjectSubclass>(
imp.set_parameter_request(&wrap, &from_glib_borrow(ctx)); imp.set_parameter_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_get_parameter_request<T: ObjectSubclass>( unsafe extern "C" fn client_get_parameter_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1047,12 +1013,10 @@ unsafe extern "C" fn client_get_parameter_request<T: ObjectSubclass>(
imp.get_parameter_request(&wrap, &from_glib_borrow(ctx)); imp.get_parameter_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_announce_request<T: ObjectSubclass>( unsafe extern "C" fn client_announce_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1060,12 +1024,10 @@ unsafe extern "C" fn client_announce_request<T: ObjectSubclass>(
imp.announce_request(&wrap, &from_glib_borrow(ctx)); imp.announce_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_record_request<T: ObjectSubclass>( unsafe extern "C" fn client_record_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1073,12 +1035,10 @@ unsafe extern "C" fn client_record_request<T: ObjectSubclass>(
imp.record_request(&wrap, &from_glib_borrow(ctx)); imp.record_request(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_handle_response<T: ObjectSubclass>( unsafe extern "C" fn client_handle_response<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) where ) {
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1086,15 +1046,12 @@ unsafe extern "C" fn client_handle_response<T: ObjectSubclass>(
imp.handle_response(&wrap, &from_glib_borrow(ctx)); imp.handle_response(&wrap, &from_glib_borrow(ctx));
} }
unsafe extern "C" fn client_handle_sdp<T: ObjectSubclass>( unsafe extern "C" fn client_handle_sdp<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
media: *mut gst_rtsp_server_sys::GstRTSPMedia, media: *mut gst_rtsp_server_sys::GstRTSPMedia,
sdp: *mut gst_sdp_sys::GstSDPMessage, sdp: *mut gst_sdp_sys::GstSDPMessage,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1113,14 +1070,11 @@ where
} }
} }
unsafe extern "C" fn client_check_requirements<T: ObjectSubclass>( unsafe extern "C" fn client_check_requirements<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
arr: *mut *mut std::os::raw::c_char, arr: *mut *mut std::os::raw::c_char,
) -> *mut std::os::raw::c_char ) -> *mut std::os::raw::c_char {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1133,13 +1087,10 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn client_pre_options_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_options_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1148,13 +1099,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn client_pre_describe_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_describe_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1163,13 +1111,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn client_pre_setup_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_setup_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1178,13 +1123,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn client_pre_play_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_play_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1193,13 +1135,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn client_pre_pause_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_pause_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1208,13 +1147,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn client_pre_teardown_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_teardown_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1223,13 +1159,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn client_pre_set_parameter_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_set_parameter_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1238,13 +1171,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn client_pre_get_parameter_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_get_parameter_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1253,13 +1183,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn client_pre_announce_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_announce_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);
@ -1268,13 +1195,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn client_pre_record_request<T: ObjectSubclass>( unsafe extern "C" fn client_pre_record_request<T: RTSPClientImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPClient, ptr: *mut gst_rtsp_server_sys::GstRTSPClient,
ctx: *mut gst_rtsp_server_sys::GstRTSPContext, ctx: *mut gst_rtsp_server_sys::GstRTSPContext,
) -> gst_rtsp_sys::GstRTSPStatusCode ) -> gst_rtsp_sys::GstRTSPStatusCode {
where
T: RTSPClientImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPClient> = from_glib_borrow(ptr);

View file

@ -33,7 +33,7 @@ impl SDPInfo {
} }
} }
pub trait RTSPMediaImpl: RTSPMediaImplExt + ObjectImpl + Send + Sync + 'static { pub trait RTSPMediaImpl: RTSPMediaImplExt + ObjectImpl + Send + Sync {
fn handle_message(&self, media: &RTSPMedia, message: &gst::MessageRef) -> bool { fn handle_message(&self, media: &RTSPMedia, message: &gst::MessageRef) -> bool {
self.parent_handle_message(media, message) self.parent_handle_message(media, message)
} }
@ -157,10 +157,10 @@ pub trait RTSPMediaImplExt {
) -> Result<(), gst::LoggableError>; ) -> Result<(), gst::LoggableError>;
} }
impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T { impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
fn parent_handle_message(&self, media: &RTSPMedia, message: &gst::MessageRef) -> bool { fn parent_handle_message(&self, media: &RTSPMedia, message: &gst::MessageRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).handle_message { if let Some(f) = (*parent_class).handle_message {
@ -177,7 +177,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
thread: &RTSPThread, thread: &RTSPThread,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).prepare { if let Some(f) = (*parent_class).prepare {
@ -194,7 +194,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_unprepare(&self, media: &RTSPMedia) -> Result<(), gst::LoggableError> { fn parent_unprepare(&self, media: &RTSPMedia) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepare { if let Some(f) = (*parent_class).unprepare {
@ -211,7 +211,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_suspend(&self, media: &RTSPMedia) -> Result<(), gst::LoggableError> { fn parent_suspend(&self, media: &RTSPMedia) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).suspend { if let Some(f) = (*parent_class).suspend {
@ -228,7 +228,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_unsuspend(&self, media: &RTSPMedia) -> Result<(), gst::LoggableError> { fn parent_unsuspend(&self, media: &RTSPMedia) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unsuspend { if let Some(f) = (*parent_class).unsuspend {
@ -249,7 +249,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
unsafe { unsafe {
use std::mem; use std::mem;
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).query_position { if let Some(f) = (*parent_class).query_position {
@ -269,7 +269,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
unsafe { unsafe {
use std::mem; use std::mem;
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).query_stop { if let Some(f) = (*parent_class).query_stop {
@ -287,7 +287,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_create_rtpbin(&self, media: &RTSPMedia) -> Option<gst::Element> { fn parent_create_rtpbin(&self, media: &RTSPMedia) -> Option<gst::Element> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
let f = (*parent_class) let f = (*parent_class)
@ -304,7 +304,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
rtpbin: &gst::Element, rtpbin: &gst::Element,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).setup_rtpbin { if let Some(f) = (*parent_class).setup_rtpbin {
@ -340,7 +340,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
info: &SDPInfo, info: &SDPInfo,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
let f = (*parent_class) let f = (*parent_class)
@ -361,7 +361,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_new_stream(&self, media: &RTSPMedia, stream: &::RTSPStream) { fn parent_new_stream(&self, media: &RTSPMedia, stream: &::RTSPStream) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_stream { if let Some(f) = (*parent_class).new_stream {
@ -372,7 +372,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_removed_stream(&self, media: &RTSPMedia, stream: &::RTSPStream) { fn parent_removed_stream(&self, media: &RTSPMedia, stream: &::RTSPStream) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).removed_stream { if let Some(f) = (*parent_class).removed_stream {
@ -383,7 +383,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_prepared(&self, media: &RTSPMedia) { fn parent_prepared(&self, media: &RTSPMedia) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).prepared { if let Some(f) = (*parent_class).prepared {
@ -394,7 +394,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_unprepared(&self, media: &RTSPMedia) { fn parent_unprepared(&self, media: &RTSPMedia) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).unprepared { if let Some(f) = (*parent_class).unprepared {
@ -405,7 +405,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_target_state(&self, media: &RTSPMedia, state: gst::State) { fn parent_target_state(&self, media: &RTSPMedia, state: gst::State) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).target_state { if let Some(f) = (*parent_class).target_state {
@ -416,7 +416,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
fn parent_new_state(&self, media: &RTSPMedia, state: gst::State) { fn parent_new_state(&self, media: &RTSPMedia, state: gst::State) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
if let Some(f) = (*parent_class).new_state { if let Some(f) = (*parent_class).new_state {
@ -431,7 +431,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
sdp: &gst_sdp::SDPMessageRef, sdp: &gst_sdp::SDPMessageRef,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPMediaClass;
let f = (*parent_class) let f = (*parent_class)
@ -449,7 +449,7 @@ impl<T: RTSPMediaImpl + ObjectImpl> RTSPMediaImplExt for T {
} }
} }
} }
unsafe impl<T: ObjectSubclass + RTSPMediaImpl> IsSubclassable<T> for RTSPMediaClass { unsafe impl<T: RTSPMediaImpl> IsSubclassable<T> for RTSPMediaClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
@ -475,13 +475,10 @@ unsafe impl<T: ObjectSubclass + RTSPMediaImpl> IsSubclassable<T> for RTSPMediaCl
} }
} }
unsafe extern "C" fn media_handle_message<T: ObjectSubclass>( unsafe extern "C" fn media_handle_message<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
message: *mut gst_sys::GstMessage, message: *mut gst_sys::GstMessage,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -490,13 +487,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn media_prepare<T: ObjectSubclass>( unsafe extern "C" fn media_prepare<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
thread: *mut gst_rtsp_server_sys::GstRTSPThread, thread: *mut gst_rtsp_server_sys::GstRTSPThread,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -510,12 +504,9 @@ where
} }
} }
unsafe extern "C" fn media_unprepare<T: ObjectSubclass>( unsafe extern "C" fn media_unprepare<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -529,12 +520,9 @@ where
} }
} }
unsafe extern "C" fn media_suspend<T: ObjectSubclass>( unsafe extern "C" fn media_suspend<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -548,12 +536,9 @@ where
} }
} }
unsafe extern "C" fn media_unsuspend<T: ObjectSubclass>( unsafe extern "C" fn media_unsuspend<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -567,13 +552,10 @@ where
} }
} }
unsafe extern "C" fn media_query_position<T: ObjectSubclass>( unsafe extern "C" fn media_query_position<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
position: *mut i64, position: *mut i64,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -587,13 +569,10 @@ where
} }
} }
unsafe extern "C" fn media_query_stop<T: ObjectSubclass>( unsafe extern "C" fn media_query_stop<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
stop: *mut i64, stop: *mut i64,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -607,12 +586,9 @@ where
} }
} }
unsafe extern "C" fn media_create_rtpbin<T: ObjectSubclass>( unsafe extern "C" fn media_create_rtpbin<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
) -> *mut gst_sys::GstElement ) -> *mut gst_sys::GstElement {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -626,13 +602,10 @@ where
res res
} }
unsafe extern "C" fn media_setup_rtpbin<T: ObjectSubclass>( unsafe extern "C" fn media_setup_rtpbin<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
rtpbin: *mut gst_sys::GstElement, rtpbin: *mut gst_sys::GstElement,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -657,14 +630,11 @@ where
res res
} }
unsafe extern "C" fn media_setup_sdp<T: ObjectSubclass>( unsafe extern "C" fn media_setup_sdp<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
sdp: *mut gst_sdp_sys::GstSDPMessage, sdp: *mut gst_sdp_sys::GstSDPMessage,
info: *mut gst_rtsp_server_sys::GstSDPInfo, info: *mut gst_rtsp_server_sys::GstSDPInfo,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -682,12 +652,10 @@ where
} }
} }
unsafe extern "C" fn media_new_stream<T: ObjectSubclass>( unsafe extern "C" fn media_new_stream<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
stream: *mut gst_rtsp_server_sys::GstRTSPStream, stream: *mut gst_rtsp_server_sys::GstRTSPStream,
) where ) {
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -695,12 +663,10 @@ unsafe extern "C" fn media_new_stream<T: ObjectSubclass>(
imp.new_stream(&wrap, &from_glib_borrow(stream)); imp.new_stream(&wrap, &from_glib_borrow(stream));
} }
unsafe extern "C" fn media_removed_stream<T: ObjectSubclass>( unsafe extern "C" fn media_removed_stream<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
stream: *mut gst_rtsp_server_sys::GstRTSPStream, stream: *mut gst_rtsp_server_sys::GstRTSPStream,
) where ) {
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -708,10 +674,7 @@ unsafe extern "C" fn media_removed_stream<T: ObjectSubclass>(
imp.removed_stream(&wrap, &from_glib_borrow(stream)); imp.removed_stream(&wrap, &from_glib_borrow(stream));
} }
unsafe extern "C" fn media_prepared<T: ObjectSubclass>(ptr: *mut gst_rtsp_server_sys::GstRTSPMedia) unsafe extern "C" fn media_prepared<T: RTSPMediaImpl>(ptr: *mut gst_rtsp_server_sys::GstRTSPMedia) {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -719,11 +682,9 @@ where
imp.prepared(&wrap); imp.prepared(&wrap);
} }
unsafe extern "C" fn media_unprepared<T: ObjectSubclass>( unsafe extern "C" fn media_unprepared<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
) where ) {
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -731,12 +692,10 @@ unsafe extern "C" fn media_unprepared<T: ObjectSubclass>(
imp.unprepared(&wrap); imp.unprepared(&wrap);
} }
unsafe extern "C" fn media_target_state<T: ObjectSubclass>( unsafe extern "C" fn media_target_state<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
state: gst_sys::GstState, state: gst_sys::GstState,
) where ) {
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -744,12 +703,10 @@ unsafe extern "C" fn media_target_state<T: ObjectSubclass>(
imp.target_state(&wrap, from_glib(state)); imp.target_state(&wrap, from_glib(state));
} }
unsafe extern "C" fn media_new_state<T: ObjectSubclass>( unsafe extern "C" fn media_new_state<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
state: gst_sys::GstState, state: gst_sys::GstState,
) where ) {
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);
@ -757,13 +714,10 @@ unsafe extern "C" fn media_new_state<T: ObjectSubclass>(
imp.new_state(&wrap, from_glib(state)); imp.new_state(&wrap, from_glib(state));
} }
unsafe extern "C" fn media_handle_sdp<T: ObjectSubclass>( unsafe extern "C" fn media_handle_sdp<T: RTSPMediaImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMedia, ptr: *mut gst_rtsp_server_sys::GstRTSPMedia,
sdp: *mut gst_sdp_sys::GstSDPMessage, sdp: *mut gst_sdp_sys::GstSDPMessage,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: RTSPMediaImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMedia> = from_glib_borrow(ptr);

View file

@ -18,9 +18,7 @@ use RTSPMediaFactoryClass;
use std::mem::transmute; use std::mem::transmute;
pub trait RTSPMediaFactoryImpl: pub trait RTSPMediaFactoryImpl: RTSPMediaFactoryImplExt + ObjectImpl + Send + Sync {
RTSPMediaFactoryImplExt + ObjectImpl + Send + Sync + 'static
{
fn gen_key( fn gen_key(
&self, &self,
factory: &RTSPMediaFactory, factory: &RTSPMediaFactory,
@ -97,14 +95,14 @@ pub trait RTSPMediaFactoryImplExt {
fn parent_media_configure(&self, factory: &RTSPMediaFactory, media: &::RTSPMedia); fn parent_media_configure(&self, factory: &RTSPMediaFactory, media: &::RTSPMedia);
} }
impl<T: RTSPMediaFactoryImpl + ObjectImpl> RTSPMediaFactoryImplExt for T { impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
fn parent_gen_key( fn parent_gen_key(
&self, &self,
factory: &RTSPMediaFactory, factory: &RTSPMediaFactory,
url: &gst_rtsp::RTSPUrl, url: &gst_rtsp::RTSPUrl,
) -> Option<glib::GString> { ) -> Option<glib::GString> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() let parent_class = data.as_ref().get_parent_class()
as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass; as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
@ -120,7 +118,7 @@ impl<T: RTSPMediaFactoryImpl + ObjectImpl> RTSPMediaFactoryImplExt for T {
url: &gst_rtsp::RTSPUrl, url: &gst_rtsp::RTSPUrl,
) -> Option<gst::Element> { ) -> Option<gst::Element> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() let parent_class = data.as_ref().get_parent_class()
as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass; as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
@ -136,7 +134,7 @@ impl<T: RTSPMediaFactoryImpl + ObjectImpl> RTSPMediaFactoryImplExt for T {
url: &gst_rtsp::RTSPUrl, url: &gst_rtsp::RTSPUrl,
) -> Option<::RTSPMedia> { ) -> Option<::RTSPMedia> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() let parent_class = data.as_ref().get_parent_class()
as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass; as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
@ -152,7 +150,7 @@ impl<T: RTSPMediaFactoryImpl + ObjectImpl> RTSPMediaFactoryImplExt for T {
media: &::RTSPMedia, media: &::RTSPMedia,
) -> Option<gst::Pipeline> { ) -> Option<gst::Pipeline> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() let parent_class = data.as_ref().get_parent_class()
as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass; as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass;
(*parent_class) (*parent_class)
@ -173,7 +171,7 @@ impl<T: RTSPMediaFactoryImpl + ObjectImpl> RTSPMediaFactoryImplExt for T {
fn parent_configure(&self, factory: &RTSPMediaFactory, media: &::RTSPMedia) { fn parent_configure(&self, factory: &RTSPMediaFactory, media: &::RTSPMedia) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() let parent_class = data.as_ref().get_parent_class()
as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass; as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).configure { if let Some(f) = (*parent_class).configure {
@ -184,7 +182,7 @@ impl<T: RTSPMediaFactoryImpl + ObjectImpl> RTSPMediaFactoryImplExt for T {
fn parent_media_constructed(&self, factory: &RTSPMediaFactory, media: &::RTSPMedia) { fn parent_media_constructed(&self, factory: &RTSPMediaFactory, media: &::RTSPMedia) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() let parent_class = data.as_ref().get_parent_class()
as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass; as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).media_constructed { if let Some(f) = (*parent_class).media_constructed {
@ -195,7 +193,7 @@ impl<T: RTSPMediaFactoryImpl + ObjectImpl> RTSPMediaFactoryImplExt for T {
fn parent_media_configure(&self, factory: &RTSPMediaFactory, media: &::RTSPMedia) { fn parent_media_configure(&self, factory: &RTSPMediaFactory, media: &::RTSPMedia) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() let parent_class = data.as_ref().get_parent_class()
as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass; as *mut gst_rtsp_server_sys::GstRTSPMediaFactoryClass;
if let Some(f) = (*parent_class).media_configure { if let Some(f) = (*parent_class).media_configure {
@ -204,7 +202,7 @@ impl<T: RTSPMediaFactoryImpl + ObjectImpl> RTSPMediaFactoryImplExt for T {
} }
} }
} }
unsafe impl<T: ObjectSubclass + RTSPMediaFactoryImpl> IsSubclassable<T> for RTSPMediaFactoryClass { unsafe impl<T: RTSPMediaFactoryImpl> IsSubclassable<T> for RTSPMediaFactoryClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
@ -221,13 +219,10 @@ unsafe impl<T: ObjectSubclass + RTSPMediaFactoryImpl> IsSubclassable<T> for RTSP
} }
} }
unsafe extern "C" fn factory_gen_key<T: ObjectSubclass>( unsafe extern "C" fn factory_gen_key<T: RTSPMediaFactoryImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory,
url: *const gst_rtsp_sys::GstRTSPUrl, url: *const gst_rtsp_sys::GstRTSPUrl,
) -> *mut std::os::raw::c_char ) -> *mut std::os::raw::c_char {
where
T: RTSPMediaFactoryImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
@ -235,13 +230,10 @@ where
imp.gen_key(&wrap, &from_glib_borrow(url)).to_glib_full() imp.gen_key(&wrap, &from_glib_borrow(url)).to_glib_full()
} }
unsafe extern "C" fn factory_create_element<T: ObjectSubclass>( unsafe extern "C" fn factory_create_element<T: RTSPMediaFactoryImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory,
url: *const gst_rtsp_sys::GstRTSPUrl, url: *const gst_rtsp_sys::GstRTSPUrl,
) -> *mut gst_sys::GstElement ) -> *mut gst_sys::GstElement {
where
T: RTSPMediaFactoryImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
@ -253,13 +245,10 @@ where
element element
} }
unsafe extern "C" fn factory_construct<T: ObjectSubclass>( unsafe extern "C" fn factory_construct<T: RTSPMediaFactoryImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory,
url: *const gst_rtsp_sys::GstRTSPUrl, url: *const gst_rtsp_sys::GstRTSPUrl,
) -> *mut gst_rtsp_server_sys::GstRTSPMedia ) -> *mut gst_rtsp_server_sys::GstRTSPMedia {
where
T: RTSPMediaFactoryImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
@ -267,13 +256,10 @@ where
imp.construct(&wrap, &from_glib_borrow(url)).to_glib_full() imp.construct(&wrap, &from_glib_borrow(url)).to_glib_full()
} }
unsafe extern "C" fn factory_create_pipeline<T: ObjectSubclass>( unsafe extern "C" fn factory_create_pipeline<T: RTSPMediaFactoryImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory,
media: *mut gst_rtsp_server_sys::GstRTSPMedia, media: *mut gst_rtsp_server_sys::GstRTSPMedia,
) -> *mut gst_sys::GstElement ) -> *mut gst_sys::GstElement {
where
T: RTSPMediaFactoryImpl,
{
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
static PIPELINE_QUARK: Lazy<glib::Quark> = static PIPELINE_QUARK: Lazy<glib::Quark> =
@ -300,12 +286,10 @@ where
pipeline as *mut _ pipeline as *mut _
} }
unsafe extern "C" fn factory_configure<T: ObjectSubclass>( unsafe extern "C" fn factory_configure<T: RTSPMediaFactoryImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory,
media: *mut gst_rtsp_server_sys::GstRTSPMedia, media: *mut gst_rtsp_server_sys::GstRTSPMedia,
) where ) {
T: RTSPMediaFactoryImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
@ -313,12 +297,10 @@ unsafe extern "C" fn factory_configure<T: ObjectSubclass>(
imp.configure(&wrap, &from_glib_borrow(media)); imp.configure(&wrap, &from_glib_borrow(media));
} }
unsafe extern "C" fn factory_media_constructed<T: ObjectSubclass>( unsafe extern "C" fn factory_media_constructed<T: RTSPMediaFactoryImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory,
media: *mut gst_rtsp_server_sys::GstRTSPMedia, media: *mut gst_rtsp_server_sys::GstRTSPMedia,
) where ) {
T: RTSPMediaFactoryImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);
@ -326,12 +308,10 @@ unsafe extern "C" fn factory_media_constructed<T: ObjectSubclass>(
imp.media_constructed(&wrap, &from_glib_borrow(media)); imp.media_constructed(&wrap, &from_glib_borrow(media));
} }
unsafe extern "C" fn factory_media_configure<T: ObjectSubclass>( unsafe extern "C" fn factory_media_configure<T: RTSPMediaFactoryImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory, ptr: *mut gst_rtsp_server_sys::GstRTSPMediaFactory,
media: *mut gst_rtsp_server_sys::GstRTSPMedia, media: *mut gst_rtsp_server_sys::GstRTSPMedia,
) where ) {
T: RTSPMediaFactoryImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPMediaFactory> = from_glib_borrow(ptr);

View file

@ -14,7 +14,7 @@ use glib::translate::*;
use RTSPServer; use RTSPServer;
use RTSPServerClass; use RTSPServerClass;
pub trait RTSPServerImpl: RTSPServerImplExt + ObjectImpl + Send + Sync + 'static { pub trait RTSPServerImpl: RTSPServerImplExt + ObjectImpl + Send + Sync {
fn create_client(&self, server: &RTSPServer) -> Option<::RTSPClient> { fn create_client(&self, server: &RTSPServer) -> Option<::RTSPClient> {
self.parent_create_client(server) self.parent_create_client(server)
} }
@ -30,10 +30,10 @@ pub trait RTSPServerImplExt {
fn parent_client_connected(&self, server: &RTSPServer, client: &::RTSPClient); fn parent_client_connected(&self, server: &RTSPServer, client: &::RTSPClient);
} }
impl<T: RTSPServerImpl + ObjectImpl> RTSPServerImplExt for T { impl<T: RTSPServerImpl> RTSPServerImplExt for T {
fn parent_create_client(&self, server: &RTSPServer) -> Option<::RTSPClient> { fn parent_create_client(&self, server: &RTSPServer) -> Option<::RTSPClient> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPServerClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPServerClass;
let f = (*parent_class) let f = (*parent_class)
@ -45,7 +45,7 @@ impl<T: RTSPServerImpl + ObjectImpl> RTSPServerImplExt for T {
fn parent_client_connected(&self, server: &RTSPServer, client: &::RTSPClient) { fn parent_client_connected(&self, server: &RTSPServer, client: &::RTSPClient) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPServerClass; data.as_ref().get_parent_class() as *mut gst_rtsp_server_sys::GstRTSPServerClass;
if let Some(f) = (*parent_class).client_connected { if let Some(f) = (*parent_class).client_connected {
@ -54,7 +54,7 @@ impl<T: RTSPServerImpl + ObjectImpl> RTSPServerImplExt for T {
} }
} }
} }
unsafe impl<T: ObjectSubclass + RTSPServerImpl> IsSubclassable<T> for RTSPServerClass { unsafe impl<T: RTSPServerImpl> IsSubclassable<T> for RTSPServerClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
@ -65,12 +65,9 @@ unsafe impl<T: ObjectSubclass + RTSPServerImpl> IsSubclassable<T> for RTSPServer
} }
} }
unsafe extern "C" fn server_create_client<T: ObjectSubclass>( unsafe extern "C" fn server_create_client<T: RTSPServerImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPServer, ptr: *mut gst_rtsp_server_sys::GstRTSPServer,
) -> *mut gst_rtsp_server_sys::GstRTSPClient ) -> *mut gst_rtsp_server_sys::GstRTSPClient {
where
T: RTSPServerImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPServer> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPServer> = from_glib_borrow(ptr);
@ -78,12 +75,10 @@ where
imp.create_client(&wrap).to_glib_full() imp.create_client(&wrap).to_glib_full()
} }
unsafe extern "C" fn server_client_connected<T: ObjectSubclass>( unsafe extern "C" fn server_client_connected<T: RTSPServerImpl>(
ptr: *mut gst_rtsp_server_sys::GstRTSPServer, ptr: *mut gst_rtsp_server_sys::GstRTSPServer,
client: *mut gst_rtsp_server_sys::GstRTSPClient, client: *mut gst_rtsp_server_sys::GstRTSPClient,
) where ) {
T: RTSPServerImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<RTSPServer> = from_glib_borrow(ptr); let wrap: Borrowed<RTSPServer> = from_glib_borrow(ptr);

View file

@ -24,7 +24,7 @@ use VideoCodecFrame;
use VideoDecoder; use VideoDecoder;
use VideoDecoderClass; use VideoDecoderClass;
pub trait VideoDecoderImpl: VideoDecoderImplExt + ElementImpl + Send + Sync + 'static { pub trait VideoDecoderImpl: VideoDecoderImplExt + ElementImpl {
fn open(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> { fn open(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> {
self.parent_open(element) self.parent_open(element)
} }
@ -180,10 +180,10 @@ pub trait VideoDecoderImplExt {
) -> Result<(), gst::ErrorMessage>; ) -> Result<(), gst::ErrorMessage>;
} }
impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T { impl<T: VideoDecoderImpl> VideoDecoderImplExt for T {
fn parent_open(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -204,7 +204,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_close(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -225,7 +225,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_start(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -246,7 +246,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_stop(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &VideoDecoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -267,7 +267,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_finish(&self, element: &VideoDecoder) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_finish(&self, element: &VideoDecoder) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -280,7 +280,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_drain(&self, element: &VideoDecoder) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_drain(&self, element: &VideoDecoder) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -297,7 +297,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
state: &VideoCodecState<'static, Readable>, state: &VideoCodecState<'static, Readable>,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -321,7 +321,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
at_eos: bool, at_eos: bool,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -345,7 +345,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
frame: VideoCodecFrame, frame: VideoCodecFrame,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -360,7 +360,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_flush(&self, element: &VideoDecoder) -> bool { fn parent_flush(&self, element: &VideoDecoder) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -372,7 +372,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_negotiate(&self, element: &VideoDecoder) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &VideoDecoder) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -390,7 +390,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_get_caps(&self, element: &VideoDecoder, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_get_caps(&self, element: &VideoDecoder, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -402,7 +402,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_sink_event(&self, element: &VideoDecoder, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &VideoDecoder, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -414,7 +414,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_sink_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -426,7 +426,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_src_event(&self, element: &VideoDecoder, event: gst::Event) -> bool { fn parent_src_event(&self, element: &VideoDecoder, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -438,7 +438,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
fn parent_src_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &VideoDecoder, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -454,7 +454,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -479,7 +479,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoDecoderClass;
(*parent_class) (*parent_class)
@ -499,7 +499,7 @@ impl<T: VideoDecoderImpl + ObjectImpl> VideoDecoderImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + VideoDecoderImpl> IsSubclassable<T> for VideoDecoderClass unsafe impl<T: VideoDecoderImpl> IsSubclassable<T> for VideoDecoderClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -529,11 +529,10 @@ where
} }
} }
unsafe extern "C" fn video_decoder_open<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_open<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -552,11 +551,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_close<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_close<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -575,11 +573,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_start<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_start<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -598,11 +595,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_stop<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_stop<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -621,11 +617,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_finish<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_finish<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -638,11 +633,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_drain<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_drain<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -655,12 +649,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_set_format<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_set_format<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
state: *mut gst_video_sys::GstVideoCodecState, state: *mut gst_video_sys::GstVideoCodecState,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -681,14 +674,13 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_parse<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_parse<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
frame: *mut gst_video_sys::GstVideoCodecFrame, frame: *mut gst_video_sys::GstVideoCodecFrame,
adapter: *mut gst_base_sys::GstAdapter, adapter: *mut gst_base_sys::GstAdapter,
at_eos: glib_sys::gboolean, at_eos: glib_sys::gboolean,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -705,12 +697,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_handle_frame<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_handle_frame<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
frame: *mut gst_video_sys::GstVideoCodecFrame, frame: *mut gst_video_sys::GstVideoCodecFrame,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -724,11 +715,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_flush<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_flush<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -741,11 +731,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_negotiate<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_negotiate<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -764,12 +753,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_getcaps<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_getcaps<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
filter: *mut gst_sys::GstCaps, filter: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -788,12 +776,11 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn video_decoder_sink_event<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_sink_event<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -806,12 +793,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_sink_query<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_sink_query<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -824,12 +810,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_src_event<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_src_event<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -842,12 +827,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_src_query<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_src_query<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -860,12 +844,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_propose_allocation<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_propose_allocation<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -885,12 +868,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_decoder_decide_allocation<T: ObjectSubclass>( unsafe extern "C" fn video_decoder_decide_allocation<T: VideoDecoderImpl>(
ptr: *mut gst_video_sys::GstVideoDecoder, ptr: *mut gst_video_sys::GstVideoDecoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoDecoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -23,7 +23,7 @@ use VideoCodecFrame;
use VideoEncoder; use VideoEncoder;
use VideoEncoderClass; use VideoEncoderClass;
pub trait VideoEncoderImpl: VideoEncoderImplExt + ElementImpl + Send + Sync + 'static { pub trait VideoEncoderImpl: VideoEncoderImplExt + ElementImpl {
fn open(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> { fn open(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> {
self.parent_open(element) self.parent_open(element)
} }
@ -155,10 +155,10 @@ pub trait VideoEncoderImplExt {
) -> Result<(), gst::ErrorMessage>; ) -> Result<(), gst::ErrorMessage>;
} }
impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T { impl<T: VideoEncoderImpl> VideoEncoderImplExt for T {
fn parent_open(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> { fn parent_open(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -179,7 +179,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_close(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> { fn parent_close(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -200,7 +200,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_start(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> { fn parent_start(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -221,7 +221,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_stop(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> { fn parent_stop(&self, element: &VideoEncoder) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -242,7 +242,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_finish(&self, element: &VideoEncoder) -> Result<gst::FlowSuccess, gst::FlowError> { fn parent_finish(&self, element: &VideoEncoder) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -259,7 +259,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
state: &VideoCodecState<'static, Readable>, state: &VideoCodecState<'static, Readable>,
) -> Result<(), gst::LoggableError> { ) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -281,7 +281,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
frame: VideoCodecFrame, frame: VideoCodecFrame,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -296,7 +296,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_flush(&self, element: &VideoEncoder) -> bool { fn parent_flush(&self, element: &VideoEncoder) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -308,7 +308,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_negotiate(&self, element: &VideoEncoder) -> Result<(), gst::LoggableError> { fn parent_negotiate(&self, element: &VideoEncoder) -> Result<(), gst::LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -326,7 +326,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_get_caps(&self, element: &VideoEncoder, filter: Option<&gst::Caps>) -> gst::Caps { fn parent_get_caps(&self, element: &VideoEncoder, filter: Option<&gst::Caps>) -> gst::Caps {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -338,7 +338,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_sink_event(&self, element: &VideoEncoder, event: gst::Event) -> bool { fn parent_sink_event(&self, element: &VideoEncoder, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -350,7 +350,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_sink_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool { fn parent_sink_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -362,7 +362,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_src_event(&self, element: &VideoEncoder, event: gst::Event) -> bool { fn parent_src_event(&self, element: &VideoEncoder, event: gst::Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -374,7 +374,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
fn parent_src_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool { fn parent_src_query(&self, element: &VideoEncoder, query: &mut gst::QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
let f = (*parent_class) let f = (*parent_class)
@ -390,7 +390,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -415,7 +415,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
query: &mut gst::QueryRef, query: &mut gst::QueryRef,
) -> Result<(), gst::ErrorMessage> { ) -> Result<(), gst::ErrorMessage> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoEncoderClass;
(*parent_class) (*parent_class)
@ -435,7 +435,7 @@ impl<T: VideoEncoderImpl + ObjectImpl> VideoEncoderImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + VideoEncoderImpl> IsSubclassable<T> for VideoEncoderClass unsafe impl<T: VideoEncoderImpl> IsSubclassable<T> for VideoEncoderClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -463,11 +463,10 @@ where
} }
} }
unsafe extern "C" fn video_encoder_open<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_open<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -486,11 +485,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_close<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_close<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -509,11 +507,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_start<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_start<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -532,11 +529,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_stop<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_stop<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -555,11 +551,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_finish<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_finish<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -572,12 +567,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_set_format<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_set_format<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
state: *mut gst_video_sys::GstVideoCodecState, state: *mut gst_video_sys::GstVideoCodecState,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -598,12 +592,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_handle_frame<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_handle_frame<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
frame: *mut gst_video_sys::GstVideoCodecFrame, frame: *mut gst_video_sys::GstVideoCodecFrame,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -617,11 +610,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_flush<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_flush<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -634,11 +626,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_negotiate<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_negotiate<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -657,12 +648,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_getcaps<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_getcaps<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
filter: *mut gst_sys::GstCaps, filter: *mut gst_sys::GstCaps,
) -> *mut gst_sys::GstCaps ) -> *mut gst_sys::GstCaps
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -681,12 +671,11 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn video_encoder_sink_event<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_sink_event<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -699,12 +688,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_sink_query<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_sink_query<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -717,12 +705,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_src_event<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_src_event<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -735,12 +722,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_src_query<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_src_query<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -753,12 +739,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_propose_allocation<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_propose_allocation<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -778,12 +763,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn video_encoder_decide_allocation<T: ObjectSubclass>( unsafe extern "C" fn video_encoder_decide_allocation<T: VideoEncoderImpl>(
ptr: *mut gst_video_sys::GstVideoEncoder, ptr: *mut gst_video_sys::GstVideoEncoder,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: VideoEncoderImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -19,9 +19,7 @@ use gst_base::subclass::prelude::*;
use VideoSink; use VideoSink;
use VideoSinkClass; use VideoSinkClass;
pub trait VideoSinkImpl: pub trait VideoSinkImpl: VideoSinkImplExt + BaseSinkImpl + ElementImpl {
VideoSinkImplExt + BaseSinkImpl + ElementImpl + Send + Sync + 'static
{
fn show_frame( fn show_frame(
&self, &self,
element: &VideoSink, element: &VideoSink,
@ -39,14 +37,14 @@ pub trait VideoSinkImplExt {
) -> Result<gst::FlowSuccess, gst::FlowError>; ) -> Result<gst::FlowSuccess, gst::FlowError>;
} }
impl<T: VideoSinkImpl + ObjectImpl> VideoSinkImplExt for T { impl<T: VideoSinkImpl> VideoSinkImplExt for T {
fn parent_show_frame( fn parent_show_frame(
&self, &self,
element: &VideoSink, element: &VideoSink,
buffer: &gst::Buffer, buffer: &gst::Buffer,
) -> Result<gst::FlowSuccess, gst::FlowError> { ) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoSinkClass; data.as_ref().get_parent_class() as *mut gst_video_sys::GstVideoSinkClass;
(*parent_class) (*parent_class)
@ -60,7 +58,7 @@ impl<T: VideoSinkImpl + ObjectImpl> VideoSinkImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + VideoSinkImpl> IsSubclassable<T> for VideoSinkClass unsafe impl<T: VideoSinkImpl> IsSubclassable<T> for VideoSinkClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -73,12 +71,11 @@ where
} }
} }
unsafe extern "C" fn video_sink_show_frame<T: ObjectSubclass>( unsafe extern "C" fn video_sink_show_frame<T: VideoSinkImpl>(
ptr: *mut gst_video_sys::GstVideoSink, ptr: *mut gst_video_sys::GstVideoSink,
buffer: *mut gst_sys::GstBuffer, buffer: *mut gst_sys::GstBuffer,
) -> gst_sys::GstFlowReturn ) -> gst_sys::GstFlowReturn
where where
T: VideoSinkImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -20,7 +20,7 @@ use Element;
use LoggableError; use LoggableError;
use Message; use Message;
pub trait BinImpl: BinImplExt + ElementImpl + Send + Sync + 'static { pub trait BinImpl: BinImplExt + ElementImpl {
fn add_element(&self, bin: &Bin, element: &Element) -> Result<(), LoggableError> { fn add_element(&self, bin: &Bin, element: &Element) -> Result<(), LoggableError> {
self.parent_add_element(bin, element) self.parent_add_element(bin, element)
} }
@ -42,10 +42,10 @@ pub trait BinImplExt {
fn parent_handle_message(&self, bin: &Bin, message: Message); fn parent_handle_message(&self, bin: &Bin, message: Message);
} }
impl<T: BinImpl + ObjectImpl> BinImplExt for T { impl<T: BinImpl> BinImplExt for T {
fn parent_add_element(&self, bin: &Bin, element: &Element) -> Result<(), LoggableError> { fn parent_add_element(&self, bin: &Bin, element: &Element) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstBinClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstBinClass;
let f = (*parent_class).add_element.ok_or_else(|| { let f = (*parent_class).add_element.ok_or_else(|| {
gst_loggable_error!(::CAT_RUST, "Parent function `add_element` is not defined") gst_loggable_error!(::CAT_RUST, "Parent function `add_element` is not defined")
@ -60,7 +60,7 @@ impl<T: BinImpl + ObjectImpl> BinImplExt for T {
fn parent_remove_element(&self, bin: &Bin, element: &Element) -> Result<(), LoggableError> { fn parent_remove_element(&self, bin: &Bin, element: &Element) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstBinClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstBinClass;
let f = (*parent_class).remove_element.ok_or_else(|| { let f = (*parent_class).remove_element.ok_or_else(|| {
gst_loggable_error!( gst_loggable_error!(
@ -78,7 +78,7 @@ impl<T: BinImpl + ObjectImpl> BinImplExt for T {
fn parent_handle_message(&self, bin: &Bin, message: Message) { fn parent_handle_message(&self, bin: &Bin, message: Message) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstBinClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstBinClass;
if let Some(ref f) = (*parent_class).handle_message { if let Some(ref f) = (*parent_class).handle_message {
f(bin.to_glib_none().0, message.into_ptr()); f(bin.to_glib_none().0, message.into_ptr());
@ -87,7 +87,7 @@ impl<T: BinImpl + ObjectImpl> BinImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + BinImpl> IsSubclassable<T> for BinClass unsafe impl<T: BinImpl> IsSubclassable<T> for BinClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -102,12 +102,11 @@ where
} }
} }
unsafe extern "C" fn bin_add_element<T: ObjectSubclass>( unsafe extern "C" fn bin_add_element<T: BinImpl>(
ptr: *mut gst_sys::GstBin, ptr: *mut gst_sys::GstBin,
element: *mut gst_sys::GstElement, element: *mut gst_sys::GstElement,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BinImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -126,12 +125,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn bin_remove_element<T: ObjectSubclass>( unsafe extern "C" fn bin_remove_element<T: BinImpl>(
ptr: *mut gst_sys::GstBin, ptr: *mut gst_sys::GstBin,
element: *mut gst_sys::GstElement, element: *mut gst_sys::GstElement,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: BinImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -157,11 +155,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn bin_handle_message<T: ObjectSubclass>( unsafe extern "C" fn bin_handle_message<T: BinImpl>(
ptr: *mut gst_sys::GstBin, ptr: *mut gst_sys::GstBin,
message: *mut gst_sys::GstMessage, message: *mut gst_sys::GstMessage,
) where ) where
T: BinImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);

View file

@ -18,7 +18,7 @@ use libc;
use ChildProxy; use ChildProxy;
pub trait ChildProxyImpl: super::element::ElementImpl + Send + Sync + 'static { pub trait ChildProxyImpl: ObjectImpl + Send + Sync {
fn get_child_by_name(&self, object: &ChildProxy, name: &str) -> Option<glib::Object> { fn get_child_by_name(&self, object: &ChildProxy, name: &str) -> Option<glib::Object> {
unsafe { unsafe {
let type_ = gst_sys::gst_child_proxy_get_type(); let type_ = gst_sys::gst_child_proxy_get_type();
@ -44,7 +44,7 @@ pub trait ChildProxyImpl: super::element::ElementImpl + Send + Sync + 'static {
fn child_removed(&self, _object: &ChildProxy, _child: &glib::Object, _name: &str) {} fn child_removed(&self, _object: &ChildProxy, _child: &glib::Object, _name: &str) {}
} }
unsafe impl<T: ObjectSubclass + ChildProxyImpl> IsImplementable<T> for ChildProxy { unsafe impl<T: ChildProxyImpl> IsImplementable<T> for ChildProxy {
unsafe extern "C" fn interface_init( unsafe extern "C" fn interface_init(
iface: glib_sys::gpointer, iface: glib_sys::gpointer,
_iface_data: glib_sys::gpointer, _iface_data: glib_sys::gpointer,
@ -59,13 +59,10 @@ unsafe impl<T: ObjectSubclass + ChildProxyImpl> IsImplementable<T> for ChildProx
} }
} }
unsafe extern "C" fn child_proxy_get_child_by_name<T: ObjectSubclass>( unsafe extern "C" fn child_proxy_get_child_by_name<T: ChildProxyImpl>(
child_proxy: *mut gst_sys::GstChildProxy, child_proxy: *mut gst_sys::GstChildProxy,
name: *const libc::c_char, name: *const libc::c_char,
) -> *mut gobject_sys::GObject ) -> *mut gobject_sys::GObject {
where
T: ChildProxyImpl,
{
let instance = &*(child_proxy as *mut T::Instance); let instance = &*(child_proxy as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
@ -76,13 +73,10 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn child_proxy_get_child_by_index<T: ObjectSubclass>( unsafe extern "C" fn child_proxy_get_child_by_index<T: ChildProxyImpl>(
child_proxy: *mut gst_sys::GstChildProxy, child_proxy: *mut gst_sys::GstChildProxy,
index: u32, index: u32,
) -> *mut gobject_sys::GObject ) -> *mut gobject_sys::GObject {
where
T: ChildProxyImpl,
{
let instance = &*(child_proxy as *mut T::Instance); let instance = &*(child_proxy as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
@ -90,25 +84,20 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn child_proxy_get_children_count<T: ObjectSubclass>( unsafe extern "C" fn child_proxy_get_children_count<T: ChildProxyImpl>(
child_proxy: *mut gst_sys::GstChildProxy, child_proxy: *mut gst_sys::GstChildProxy,
) -> u32 ) -> u32 {
where
T: ChildProxyImpl,
{
let instance = &*(child_proxy as *mut T::Instance); let instance = &*(child_proxy as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
imp.get_children_count(&from_glib_borrow(child_proxy)) imp.get_children_count(&from_glib_borrow(child_proxy))
} }
unsafe extern "C" fn child_proxy_child_added<T: ObjectSubclass>( unsafe extern "C" fn child_proxy_child_added<T: ChildProxyImpl>(
child_proxy: *mut gst_sys::GstChildProxy, child_proxy: *mut gst_sys::GstChildProxy,
child: *mut gobject_sys::GObject, child: *mut gobject_sys::GObject,
name: *const libc::c_char, name: *const libc::c_char,
) where ) {
T: ChildProxyImpl,
{
let instance = &*(child_proxy as *mut T::Instance); let instance = &*(child_proxy as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
@ -119,13 +108,11 @@ unsafe extern "C" fn child_proxy_child_added<T: ObjectSubclass>(
) )
} }
unsafe extern "C" fn child_proxy_child_removed<T: ObjectSubclass>( unsafe extern "C" fn child_proxy_child_removed<T: ChildProxyImpl>(
child_proxy: *mut gst_sys::GstChildProxy, child_proxy: *mut gst_sys::GstChildProxy,
child: *mut gobject_sys::GObject, child: *mut gobject_sys::GObject,
name: *const libc::c_char, name: *const libc::c_char,
) where ) {
T: ChildProxyImpl,
{
let instance = &*(child_proxy as *mut T::Instance); let instance = &*(child_proxy as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();

View file

@ -22,7 +22,7 @@ use ClockSuccess;
use ClockTime; use ClockTime;
use ClockTimeDiff; use ClockTimeDiff;
pub trait ClockImpl: ClockImplExt + ObjectImpl + Send + Sync + 'static { pub trait ClockImpl: ClockImplExt + ObjectImpl + Send + Sync {
fn change_resolution( fn change_resolution(
&self, &self,
clock: &Clock, clock: &Clock,
@ -85,7 +85,7 @@ pub trait ClockImplExt {
<Self as ObjectSubclass>::ParentType: IsA<Clock>; <Self as ObjectSubclass>::ParentType: IsA<Clock>;
} }
impl<T: ClockImpl + ObjectImpl> ClockImplExt for T { impl<T: ClockImpl> ClockImplExt for T {
fn parent_change_resolution( fn parent_change_resolution(
&self, &self,
clock: &Clock, clock: &Clock,
@ -93,7 +93,7 @@ impl<T: ClockImpl + ObjectImpl> ClockImplExt for T {
new_resolution: ClockTime, new_resolution: ClockTime,
) -> ClockTime { ) -> ClockTime {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass;
if let Some(func) = (*parent_class).change_resolution { if let Some(func) = (*parent_class).change_resolution {
@ -110,7 +110,7 @@ impl<T: ClockImpl + ObjectImpl> ClockImplExt for T {
fn parent_get_resolution(&self, clock: &Clock) -> ClockTime { fn parent_get_resolution(&self, clock: &Clock) -> ClockTime {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass;
from_glib( from_glib(
@ -124,7 +124,7 @@ impl<T: ClockImpl + ObjectImpl> ClockImplExt for T {
fn parent_get_internal_time(&self, clock: &Clock) -> ClockTime { fn parent_get_internal_time(&self, clock: &Clock) -> ClockTime {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass;
from_glib( from_glib(
@ -142,7 +142,7 @@ impl<T: ClockImpl + ObjectImpl> ClockImplExt for T {
id: &ClockId, id: &ClockId,
) -> (Result<ClockSuccess, ClockError>, ClockTimeDiff) { ) -> (Result<ClockSuccess, ClockError>, ClockTimeDiff) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass;
let mut jitter = 0; let mut jitter = 0;
@ -167,7 +167,7 @@ impl<T: ClockImpl + ObjectImpl> ClockImplExt for T {
fn parent_wait_async(&self, clock: &Clock, id: &ClockId) -> Result<ClockSuccess, ClockError> { fn parent_wait_async(&self, clock: &Clock, id: &ClockId) -> Result<ClockSuccess, ClockError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass;
ClockReturn::from_glib( ClockReturn::from_glib(
(*parent_class) (*parent_class)
@ -186,7 +186,7 @@ impl<T: ClockImpl + ObjectImpl> ClockImplExt for T {
fn parent_unschedule(&self, clock: &Clock, id: &ClockId) { fn parent_unschedule(&self, clock: &Clock, id: &ClockId) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstClockClass;
if let Some(func) = (*parent_class).unschedule { if let Some(func) = (*parent_class).unschedule {
func( func(
@ -233,7 +233,7 @@ impl<T: ClockImpl + ObjectImpl> ClockImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + ClockImpl> IsSubclassable<T> for ClockClass { unsafe impl<T: ClockImpl> IsSubclassable<T> for ClockClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
@ -249,14 +249,11 @@ unsafe impl<T: ObjectSubclass + ClockImpl> IsSubclassable<T> for ClockClass {
} }
} }
unsafe extern "C" fn clock_change_resolution<T: ObjectSubclass>( unsafe extern "C" fn clock_change_resolution<T: ClockImpl>(
ptr: *mut gst_sys::GstClock, ptr: *mut gst_sys::GstClock,
old_resolution: gst_sys::GstClockTime, old_resolution: gst_sys::GstClockTime,
new_resolution: gst_sys::GstClockTime, new_resolution: gst_sys::GstClockTime,
) -> gst_sys::GstClockTime ) -> gst_sys::GstClockTime {
where
T: ClockImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Clock> = from_glib_borrow(ptr); let wrap: Borrowed<Clock> = from_glib_borrow(ptr);
@ -265,12 +262,9 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn clock_get_resolution<T: ObjectSubclass>( unsafe extern "C" fn clock_get_resolution<T: ClockImpl>(
ptr: *mut gst_sys::GstClock, ptr: *mut gst_sys::GstClock,
) -> gst_sys::GstClockTime ) -> gst_sys::GstClockTime {
where
T: ClockImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Clock> = from_glib_borrow(ptr); let wrap: Borrowed<Clock> = from_glib_borrow(ptr);
@ -278,12 +272,9 @@ where
imp.get_resolution(&wrap).to_glib() imp.get_resolution(&wrap).to_glib()
} }
unsafe extern "C" fn clock_get_internal_time<T: ObjectSubclass>( unsafe extern "C" fn clock_get_internal_time<T: ClockImpl>(
ptr: *mut gst_sys::GstClock, ptr: *mut gst_sys::GstClock,
) -> gst_sys::GstClockTime ) -> gst_sys::GstClockTime {
where
T: ClockImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Clock> = from_glib_borrow(ptr); let wrap: Borrowed<Clock> = from_glib_borrow(ptr);
@ -291,14 +282,11 @@ where
imp.get_internal_time(&wrap).to_glib() imp.get_internal_time(&wrap).to_glib()
} }
unsafe extern "C" fn clock_wait<T: ObjectSubclass>( unsafe extern "C" fn clock_wait<T: ClockImpl>(
ptr: *mut gst_sys::GstClock, ptr: *mut gst_sys::GstClock,
id: *mut gst_sys::GstClockEntry, id: *mut gst_sys::GstClockEntry,
jitter: *mut gst_sys::GstClockTimeDiff, jitter: *mut gst_sys::GstClockTimeDiff,
) -> gst_sys::GstClockReturn ) -> gst_sys::GstClockReturn {
where
T: ClockImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Clock> = from_glib_borrow(ptr); let wrap: Borrowed<Clock> = from_glib_borrow(ptr);
@ -311,13 +299,10 @@ where
ClockReturn::from(res).to_glib() ClockReturn::from(res).to_glib()
} }
unsafe extern "C" fn clock_wait_async<T: ObjectSubclass>( unsafe extern "C" fn clock_wait_async<T: ClockImpl>(
ptr: *mut gst_sys::GstClock, ptr: *mut gst_sys::GstClock,
id: *mut gst_sys::GstClockEntry, id: *mut gst_sys::GstClockEntry,
) -> gst_sys::GstClockReturn ) -> gst_sys::GstClockReturn {
where
T: ClockImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Clock> = from_glib_borrow(ptr); let wrap: Borrowed<Clock> = from_glib_borrow(ptr);
@ -325,12 +310,10 @@ where
ClockReturn::from(imp.wait_async(&wrap, &from_glib_borrow(id as gst_sys::GstClockID))).to_glib() ClockReturn::from(imp.wait_async(&wrap, &from_glib_borrow(id as gst_sys::GstClockID))).to_glib()
} }
unsafe extern "C" fn clock_unschedule<T: ObjectSubclass>( unsafe extern "C" fn clock_unschedule<T: ClockImpl>(
ptr: *mut gst_sys::GstClock, ptr: *mut gst_sys::GstClock,
id: *mut gst_sys::GstClockEntry, id: *mut gst_sys::GstClockEntry,
) where ) {
T: ClockImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Clock> = from_glib_borrow(ptr); let wrap: Borrowed<Clock> = from_glib_borrow(ptr);

View file

@ -20,7 +20,7 @@ use LoggableError;
use std::ptr; use std::ptr;
pub trait DeviceImpl: DeviceImplExt + ObjectImpl + Send + Sync + 'static { pub trait DeviceImpl: DeviceImplExt + ObjectImpl + Send + Sync {
fn create_element( fn create_element(
&self, &self,
device: &Device, device: &Device,
@ -48,14 +48,14 @@ pub trait DeviceImplExt {
) -> Result<(), LoggableError>; ) -> Result<(), LoggableError>;
} }
impl<T: DeviceImpl + ObjectImpl> DeviceImplExt for T { impl<T: DeviceImpl> DeviceImplExt for T {
fn parent_create_element( fn parent_create_element(
&self, &self,
device: &Device, device: &Device,
name: Option<&str>, name: Option<&str>,
) -> Result<Element, LoggableError> { ) -> Result<Element, LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceClass;
if let Some(f) = (*parent_class).create_element { if let Some(f) = (*parent_class).create_element {
let ptr = f(device.to_glib_none().0, name.to_glib_none().0); let ptr = f(device.to_glib_none().0, name.to_glib_none().0);
@ -82,7 +82,7 @@ impl<T: DeviceImpl + ObjectImpl> DeviceImplExt for T {
element: &Element, element: &Element,
) -> Result<(), LoggableError> { ) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceClass;
let f = (*parent_class).reconfigure_element.ok_or_else(|| { let f = (*parent_class).reconfigure_element.ok_or_else(|| {
gst_loggable_error!( gst_loggable_error!(
@ -99,7 +99,7 @@ impl<T: DeviceImpl + ObjectImpl> DeviceImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + DeviceImpl> IsSubclassable<T> for DeviceClass { unsafe impl<T: DeviceImpl> IsSubclassable<T> for DeviceClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
@ -110,13 +110,10 @@ unsafe impl<T: ObjectSubclass + DeviceImpl> IsSubclassable<T> for DeviceClass {
} }
} }
unsafe extern "C" fn device_create_element<T: ObjectSubclass>( unsafe extern "C" fn device_create_element<T: DeviceImpl>(
ptr: *mut gst_sys::GstDevice, ptr: *mut gst_sys::GstDevice,
name: *const libc::c_char, name: *const libc::c_char,
) -> *mut gst_sys::GstElement ) -> *mut gst_sys::GstElement {
where
T: DeviceImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Device> = from_glib_borrow(ptr); let wrap: Borrowed<Device> = from_glib_borrow(ptr);
@ -144,13 +141,10 @@ where
} }
} }
unsafe extern "C" fn device_reconfigure_element<T: ObjectSubclass>( unsafe extern "C" fn device_reconfigure_element<T: DeviceImpl>(
ptr: *mut gst_sys::GstDevice, ptr: *mut gst_sys::GstDevice,
element: *mut gst_sys::GstElement, element: *mut gst_sys::GstElement,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: DeviceImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Device> = from_glib_borrow(ptr); let wrap: Borrowed<Device> = from_glib_borrow(ptr);

View file

@ -18,7 +18,7 @@ use DeviceProvider;
use DeviceProviderClass; use DeviceProviderClass;
use LoggableError; use LoggableError;
pub trait DeviceProviderImpl: DeviceProviderImplExt + ObjectImpl + Send + Sync + 'static { pub trait DeviceProviderImpl: DeviceProviderImplExt + ObjectImpl + Send + Sync {
fn probe(&self, device_provider: &DeviceProvider) -> Vec<Device> { fn probe(&self, device_provider: &DeviceProvider) -> Vec<Device> {
self.parent_probe(device_provider) self.parent_probe(device_provider)
} }
@ -40,10 +40,10 @@ pub trait DeviceProviderImplExt {
fn parent_stop(&self, device_provider: &DeviceProvider); fn parent_stop(&self, device_provider: &DeviceProvider);
} }
impl<T: DeviceProviderImpl + ObjectImpl> DeviceProviderImplExt for T { impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
fn parent_probe(&self, device_provider: &DeviceProvider) -> Vec<Device> { fn parent_probe(&self, device_provider: &DeviceProvider) -> Vec<Device> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceProviderClass; data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceProviderClass;
if let Some(f) = (*parent_class).probe { if let Some(f) = (*parent_class).probe {
@ -56,7 +56,7 @@ impl<T: DeviceProviderImpl + ObjectImpl> DeviceProviderImplExt for T {
fn parent_start(&self, device_provider: &DeviceProvider) -> Result<(), LoggableError> { fn parent_start(&self, device_provider: &DeviceProvider) -> Result<(), LoggableError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceProviderClass; data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceProviderClass;
let f = (*parent_class).start.ok_or_else(|| { let f = (*parent_class).start.ok_or_else(|| {
@ -72,7 +72,7 @@ impl<T: DeviceProviderImpl + ObjectImpl> DeviceProviderImplExt for T {
fn parent_stop(&self, device_provider: &DeviceProvider) { fn parent_stop(&self, device_provider: &DeviceProvider) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = let parent_class =
data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceProviderClass; data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceProviderClass;
if let Some(f) = (*parent_class).stop { if let Some(f) = (*parent_class).stop {
@ -114,7 +114,7 @@ pub unsafe trait DeviceProviderClassSubclassExt: Sized + 'static {
unsafe impl DeviceProviderClassSubclassExt for DeviceProviderClass {} unsafe impl DeviceProviderClassSubclassExt for DeviceProviderClass {}
unsafe impl<T: ObjectSubclass + DeviceProviderImpl> IsSubclassable<T> for DeviceProviderClass { unsafe impl<T: DeviceProviderImpl> IsSubclassable<T> for DeviceProviderClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {
@ -126,12 +126,9 @@ unsafe impl<T: ObjectSubclass + DeviceProviderImpl> IsSubclassable<T> for Device
} }
} }
unsafe extern "C" fn device_provider_probe<T: ObjectSubclass>( unsafe extern "C" fn device_provider_probe<T: DeviceProviderImpl>(
ptr: *mut gst_sys::GstDeviceProvider, ptr: *mut gst_sys::GstDeviceProvider,
) -> *mut glib_sys::GList ) -> *mut glib_sys::GList {
where
T: DeviceProviderImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<DeviceProvider> = from_glib_borrow(ptr); let wrap: Borrowed<DeviceProvider> = from_glib_borrow(ptr);
@ -139,12 +136,9 @@ where
imp.probe(&wrap).to_glib_full() imp.probe(&wrap).to_glib_full()
} }
unsafe extern "C" fn device_provider_start<T: ObjectSubclass>( unsafe extern "C" fn device_provider_start<T: DeviceProviderImpl>(
ptr: *mut gst_sys::GstDeviceProvider, ptr: *mut gst_sys::GstDeviceProvider,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: DeviceProviderImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<DeviceProvider> = from_glib_borrow(ptr); let wrap: Borrowed<DeviceProvider> = from_glib_borrow(ptr);
@ -159,10 +153,9 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn device_provider_stop<T: ObjectSubclass>(ptr: *mut gst_sys::GstDeviceProvider) unsafe extern "C" fn device_provider_stop<T: DeviceProviderImpl>(
where ptr: *mut gst_sys::GstDeviceProvider,
T: DeviceProviderImpl, ) {
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<DeviceProvider> = from_glib_borrow(ptr); let wrap: Borrowed<DeviceProvider> = from_glib_borrow(ptr);

View file

@ -28,7 +28,7 @@ use StateChangeError;
use StateChangeReturn; use StateChangeReturn;
use StateChangeSuccess; use StateChangeSuccess;
pub trait ElementImpl: ElementImplExt + ObjectImpl + Send + Sync + 'static { pub trait ElementImpl: ElementImplExt + ObjectImpl + Send + Sync {
fn change_state( fn change_state(
&self, &self,
element: &::Element, element: &::Element,
@ -124,7 +124,7 @@ pub trait ElementImplExt {
) -> R; ) -> R;
} }
impl<T: ElementImpl + ObjectSubclass> ElementImplExt for T impl<T: ElementImpl> ElementImplExt for T
where where
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
@ -134,7 +134,7 @@ where
transition: StateChange, transition: StateChange,
) -> Result<StateChangeSuccess, StateChangeError> { ) -> Result<StateChangeSuccess, StateChangeError> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass;
let f = (*parent_class) let f = (*parent_class)
@ -153,7 +153,7 @@ where
caps: Option<&::Caps>, caps: Option<&::Caps>,
) -> Option<::Pad> { ) -> Option<::Pad> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass;
(*parent_class) (*parent_class)
@ -172,7 +172,7 @@ where
fn parent_release_pad(&self, element: &::Element, pad: &::Pad) { fn parent_release_pad(&self, element: &::Element, pad: &::Pad) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass;
(*parent_class) (*parent_class)
@ -184,7 +184,7 @@ where
fn parent_send_event(&self, element: &::Element, event: Event) -> bool { fn parent_send_event(&self, element: &::Element, event: Event) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass;
(*parent_class) (*parent_class)
@ -196,7 +196,7 @@ where
fn parent_query(&self, element: &::Element, query: &mut QueryRef) -> bool { fn parent_query(&self, element: &::Element, query: &mut QueryRef) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass;
(*parent_class) (*parent_class)
@ -208,7 +208,7 @@ where
fn parent_set_context(&self, element: &::Element, context: &::Context) { fn parent_set_context(&self, element: &::Element, context: &::Context) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass;
(*parent_class) (*parent_class)
@ -220,7 +220,7 @@ where
fn parent_set_clock(&self, element: &::Element, clock: Option<&::Clock>) -> bool { fn parent_set_clock(&self, element: &::Element, clock: Option<&::Clock>) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass;
(*parent_class) (*parent_class)
@ -232,7 +232,7 @@ where
fn parent_provide_clock(&self, element: &::Element) -> Option<::Clock> { fn parent_provide_clock(&self, element: &::Element) -> Option<::Clock> {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass;
(*parent_class) (*parent_class)
@ -244,7 +244,7 @@ where
fn parent_post_message(&self, element: &::Element, msg: ::Message) -> bool { fn parent_post_message(&self, element: &::Element, msg: ::Message) -> bool {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstElementClass;
if let Some(f) = (*parent_class).post_message { if let Some(f) = (*parent_class).post_message {
@ -338,7 +338,7 @@ pub unsafe trait ElementClassSubclassExt: Sized + 'static {
unsafe impl ElementClassSubclassExt for ElementClass {} unsafe impl ElementClassSubclassExt for ElementClass {}
unsafe impl<T: ObjectSubclass + ElementImpl> IsSubclassable<T> for ElementClass unsafe impl<T: ElementImpl> IsSubclassable<T> for ElementClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
@ -360,12 +360,11 @@ where
} }
} }
unsafe extern "C" fn element_change_state<T: ObjectSubclass>( unsafe extern "C" fn element_change_state<T: ElementImpl>(
ptr: *mut gst_sys::GstElement, ptr: *mut gst_sys::GstElement,
transition: gst_sys::GstStateChange, transition: gst_sys::GstStateChange,
) -> gst_sys::GstStateChangeReturn ) -> gst_sys::GstStateChangeReturn
where where
T: ElementImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -388,14 +387,13 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn element_request_new_pad<T: ObjectSubclass>( unsafe extern "C" fn element_request_new_pad<T: ElementImpl>(
ptr: *mut gst_sys::GstElement, ptr: *mut gst_sys::GstElement,
templ: *mut gst_sys::GstPadTemplate, templ: *mut gst_sys::GstPadTemplate,
name: *const libc::c_char, name: *const libc::c_char,
caps: *const gst_sys::GstCaps, caps: *const gst_sys::GstCaps,
) -> *mut gst_sys::GstPad ) -> *mut gst_sys::GstPad
where where
T: ElementImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -426,11 +424,10 @@ where
pad.to_glib_none().0 pad.to_glib_none().0
} }
unsafe extern "C" fn element_release_pad<T: ObjectSubclass>( unsafe extern "C" fn element_release_pad<T: ElementImpl>(
ptr: *mut gst_sys::GstElement, ptr: *mut gst_sys::GstElement,
pad: *mut gst_sys::GstPad, pad: *mut gst_sys::GstPad,
) where ) where
T: ElementImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -448,12 +445,11 @@ unsafe extern "C" fn element_release_pad<T: ObjectSubclass>(
}) })
} }
unsafe extern "C" fn element_send_event<T: ObjectSubclass>( unsafe extern "C" fn element_send_event<T: ElementImpl>(
ptr: *mut gst_sys::GstElement, ptr: *mut gst_sys::GstElement,
event: *mut gst_sys::GstEvent, event: *mut gst_sys::GstEvent,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: ElementImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -466,12 +462,11 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn element_query<T: ObjectSubclass>( unsafe extern "C" fn element_query<T: ElementImpl>(
ptr: *mut gst_sys::GstElement, ptr: *mut gst_sys::GstElement,
query: *mut gst_sys::GstQuery, query: *mut gst_sys::GstQuery,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: ElementImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -485,11 +480,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn element_set_context<T: ObjectSubclass>( unsafe extern "C" fn element_set_context<T: ElementImpl>(
ptr: *mut gst_sys::GstElement, ptr: *mut gst_sys::GstElement,
context: *mut gst_sys::GstContext, context: *mut gst_sys::GstContext,
) where ) where
T: ElementImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -501,12 +495,11 @@ unsafe extern "C" fn element_set_context<T: ObjectSubclass>(
}) })
} }
unsafe extern "C" fn element_set_clock<T: ObjectSubclass>( unsafe extern "C" fn element_set_clock<T: ElementImpl>(
ptr: *mut gst_sys::GstElement, ptr: *mut gst_sys::GstElement,
clock: *mut gst_sys::GstClock, clock: *mut gst_sys::GstClock,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: ElementImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -521,11 +514,10 @@ where
.to_glib() .to_glib()
} }
unsafe extern "C" fn element_provide_clock<T: ObjectSubclass>( unsafe extern "C" fn element_provide_clock<T: ElementImpl>(
ptr: *mut gst_sys::GstElement, ptr: *mut gst_sys::GstElement,
) -> *mut gst_sys::GstClock ) -> *mut gst_sys::GstClock
where where
T: ElementImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -538,12 +530,11 @@ where
.to_glib_full() .to_glib_full()
} }
unsafe extern "C" fn element_post_message<T: ObjectSubclass>( unsafe extern "C" fn element_post_message<T: ElementImpl>(
ptr: *mut gst_sys::GstElement, ptr: *mut gst_sys::GstElement,
msg: *mut gst_sys::GstMessage, msg: *mut gst_sys::GstMessage,
) -> glib_sys::gboolean ) -> glib_sys::gboolean
where where
T: ElementImpl,
T::Instance: PanicPoison, T::Instance: PanicPoison,
{ {
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
@ -679,8 +670,6 @@ mod tests {
} }
impl ObjectImpl for TestElement { impl ObjectImpl for TestElement {
glib_object_impl!();
fn constructed(&self, obj: &glib::Object) { fn constructed(&self, obj: &glib::Object) {
self.parent_constructed(obj); self.parent_constructed(obj);

View file

@ -13,9 +13,9 @@ use glib::subclass::prelude::*;
use GhostPadClass; use GhostPadClass;
pub trait GhostPadImpl: PadImpl + Send + Sync + 'static {} pub trait GhostPadImpl: PadImpl {}
unsafe impl<T: ObjectSubclass + GhostPadImpl> IsSubclassable<T> for GhostPadClass { unsafe impl<T: GhostPadImpl> IsSubclassable<T> for GhostPadClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<::PadClass as IsSubclassable<T>>::override_vfuncs(self); <::PadClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {

View file

@ -16,7 +16,7 @@ use glib::subclass::prelude::*;
use Pad; use Pad;
use PadClass; use PadClass;
pub trait PadImpl: PadImplExt + ObjectImpl + Send + Sync + 'static { pub trait PadImpl: PadImplExt + ObjectImpl + Send + Sync {
fn linked(&self, pad: &Pad, peer: &Pad) { fn linked(&self, pad: &Pad, peer: &Pad) {
self.parent_linked(pad, peer) self.parent_linked(pad, peer)
} }
@ -32,10 +32,10 @@ pub trait PadImplExt {
fn parent_unlinked(&self, pad: &Pad, peer: &Pad); fn parent_unlinked(&self, pad: &Pad, peer: &Pad);
} }
impl<T: PadImpl + ObjectImpl> PadImplExt for T { impl<T: PadImpl> PadImplExt for T {
fn parent_linked(&self, pad: &Pad, peer: &Pad) { fn parent_linked(&self, pad: &Pad, peer: &Pad) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstPadClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstPadClass;
(*parent_class) (*parent_class)
@ -47,7 +47,7 @@ impl<T: PadImpl + ObjectImpl> PadImplExt for T {
fn parent_unlinked(&self, pad: &Pad, peer: &Pad) { fn parent_unlinked(&self, pad: &Pad, peer: &Pad) {
unsafe { unsafe {
let data = self.get_type_data(); let data = T::type_data();
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstPadClass; let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstPadClass;
(*parent_class) (*parent_class)
@ -58,7 +58,7 @@ impl<T: PadImpl + ObjectImpl> PadImplExt for T {
} }
} }
unsafe impl<T: ObjectSubclass + PadImpl> IsSubclassable<T> for PadClass { unsafe impl<T: PadImpl> IsSubclassable<T> for PadClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self); <glib::ObjectClass as IsSubclassable<T>>::override_vfuncs(self);
@ -70,12 +70,7 @@ unsafe impl<T: ObjectSubclass + PadImpl> IsSubclassable<T> for PadClass {
} }
} }
unsafe extern "C" fn pad_linked<T: ObjectSubclass>( unsafe extern "C" fn pad_linked<T: PadImpl>(ptr: *mut gst_sys::GstPad, peer: *mut gst_sys::GstPad) {
ptr: *mut gst_sys::GstPad,
peer: *mut gst_sys::GstPad,
) where
T: PadImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Pad> = from_glib_borrow(ptr); let wrap: Borrowed<Pad> = from_glib_borrow(ptr);
@ -83,12 +78,10 @@ unsafe extern "C" fn pad_linked<T: ObjectSubclass>(
imp.linked(&wrap, &from_glib_borrow(peer)) imp.linked(&wrap, &from_glib_borrow(peer))
} }
unsafe extern "C" fn pad_unlinked<T: ObjectSubclass>( unsafe extern "C" fn pad_unlinked<T: PadImpl>(
ptr: *mut gst_sys::GstPad, ptr: *mut gst_sys::GstPad,
peer: *mut gst_sys::GstPad, peer: *mut gst_sys::GstPad,
) where ) {
T: PadImpl,
{
let instance = &*(ptr as *mut T::Instance); let instance = &*(ptr as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
let wrap: Borrowed<Pad> = from_glib_borrow(ptr); let wrap: Borrowed<Pad> = from_glib_borrow(ptr);
@ -125,9 +118,7 @@ mod tests {
} }
} }
impl ObjectImpl for TestPad { impl ObjectImpl for TestPad {}
glib_object_impl!();
}
impl PadImpl for TestPad { impl PadImpl for TestPad {
fn linked(&self, pad: &Pad, peer: &Pad) { fn linked(&self, pad: &Pad, peer: &Pad) {

View file

@ -13,9 +13,9 @@ use glib::subclass::prelude::*;
use PipelineClass; use PipelineClass;
pub trait PipelineImpl: BinImpl + Send + Sync + 'static {} pub trait PipelineImpl: BinImpl {}
unsafe impl<T: ObjectSubclass + PipelineImpl> IsSubclassable<T> for PipelineClass unsafe impl<T: PipelineImpl> IsSubclassable<T> for PipelineClass
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {

View file

@ -12,9 +12,9 @@ use glib::subclass::prelude::*;
use Preset; use Preset;
pub trait PresetImpl: super::element::ElementImpl + Send + Sync + 'static {} pub trait PresetImpl: super::element::ElementImpl {}
unsafe impl<T: ObjectSubclass + PresetImpl> IsImplementable<T> for Preset { unsafe impl<T: PresetImpl> IsImplementable<T> for Preset {
unsafe extern "C" fn interface_init( unsafe extern "C" fn interface_init(
_iface: glib_sys::gpointer, _iface: glib_sys::gpointer,
_iface_data: glib_sys::gpointer, _iface_data: glib_sys::gpointer,

View file

@ -13,9 +13,9 @@ use glib::subclass::prelude::*;
use SystemClockClass; use SystemClockClass;
pub trait SystemClockImpl: ClockImpl + Send + Sync + 'static {} pub trait SystemClockImpl: ClockImpl {}
unsafe impl<T: ObjectSubclass + SystemClockImpl> IsSubclassable<T> for SystemClockClass { unsafe impl<T: SystemClockImpl> IsSubclassable<T> for SystemClockClass {
fn override_vfuncs(&mut self) { fn override_vfuncs(&mut self) {
<::ClockClass as IsSubclassable<T>>::override_vfuncs(self); <::ClockClass as IsSubclassable<T>>::override_vfuncs(self);
unsafe { unsafe {

View file

@ -12,9 +12,9 @@ use glib::subclass::prelude::*;
use TagSetter; use TagSetter;
pub trait TagSetterImpl: super::element::ElementImpl + Send + Sync + 'static {} pub trait TagSetterImpl: super::element::ElementImpl {}
unsafe impl<T: ObjectSubclass + TagSetterImpl> IsImplementable<T> for TagSetter { unsafe impl<T: TagSetterImpl> IsImplementable<T> for TagSetter {
unsafe extern "C" fn interface_init( unsafe extern "C" fn interface_init(
_iface: glib_sys::gpointer, _iface: glib_sys::gpointer,
_iface_data: glib_sys::gpointer, _iface_data: glib_sys::gpointer,

View file

@ -20,14 +20,14 @@ use libc;
use URIHandler; use URIHandler;
use URIType; use URIType;
pub trait URIHandlerImpl: super::element::ElementImpl + Send + Sync + 'static { pub trait URIHandlerImpl: super::element::ElementImpl {
fn get_uri(&self, element: &URIHandler) -> Option<String>; fn get_uri(&self, element: &URIHandler) -> Option<String>;
fn set_uri(&self, element: &URIHandler, uri: &str) -> Result<(), glib::Error>; fn set_uri(&self, element: &URIHandler, uri: &str) -> Result<(), glib::Error>;
fn get_uri_type() -> URIType; fn get_uri_type() -> URIType;
fn get_protocols() -> Vec<String>; fn get_protocols() -> Vec<String>;
} }
unsafe impl<T: ObjectSubclass + URIHandlerImpl> IsImplementable<T> for URIHandler { unsafe impl<T: URIHandlerImpl> IsImplementable<T> for URIHandler {
unsafe extern "C" fn interface_init( unsafe extern "C" fn interface_init(
iface: glib_sys::gpointer, iface: glib_sys::gpointer,
_iface_data: glib_sys::gpointer, _iface_data: glib_sys::gpointer,
@ -52,46 +52,34 @@ unsafe impl<T: ObjectSubclass + URIHandlerImpl> IsImplementable<T> for URIHandle
} }
} }
unsafe extern "C" fn uri_handler_get_type<T: ObjectSubclass>( unsafe extern "C" fn uri_handler_get_type<T: URIHandlerImpl>(
_type_: glib_sys::GType, _type_: glib_sys::GType,
) -> gst_sys::GstURIType ) -> gst_sys::GstURIType {
where
T: URIHandlerImpl,
{
<T as URIHandlerImpl>::get_uri_type().to_glib() <T as URIHandlerImpl>::get_uri_type().to_glib()
} }
unsafe extern "C" fn uri_handler_get_protocols<T: ObjectSubclass>( unsafe extern "C" fn uri_handler_get_protocols<T: URIHandlerImpl>(
_type_: glib_sys::GType, _type_: glib_sys::GType,
) -> *const *const libc::c_char ) -> *const *const libc::c_char {
where
T: URIHandlerImpl,
{
let data = <T as ObjectSubclass>::type_data(); let data = <T as ObjectSubclass>::type_data();
data.as_ref() data.as_ref()
.get_interface_data(URIHandler::static_type().to_glib()) as *const _ .get_interface_data(URIHandler::static_type().to_glib()) as *const _
} }
unsafe extern "C" fn uri_handler_get_uri<T: ObjectSubclass>( unsafe extern "C" fn uri_handler_get_uri<T: URIHandlerImpl>(
uri_handler: *mut gst_sys::GstURIHandler, uri_handler: *mut gst_sys::GstURIHandler,
) -> *mut libc::c_char ) -> *mut libc::c_char {
where
T: URIHandlerImpl,
{
let instance = &*(uri_handler as *mut T::Instance); let instance = &*(uri_handler as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();
imp.get_uri(&from_glib_borrow(uri_handler)).to_glib_full() imp.get_uri(&from_glib_borrow(uri_handler)).to_glib_full()
} }
unsafe extern "C" fn uri_handler_set_uri<T: ObjectSubclass>( unsafe extern "C" fn uri_handler_set_uri<T: URIHandlerImpl>(
uri_handler: *mut gst_sys::GstURIHandler, uri_handler: *mut gst_sys::GstURIHandler,
uri: *const libc::c_char, uri: *const libc::c_char,
err: *mut *mut glib_sys::GError, err: *mut *mut glib_sys::GError,
) -> glib_sys::gboolean ) -> glib_sys::gboolean {
where
T: URIHandlerImpl,
{
let instance = &*(uri_handler as *mut T::Instance); let instance = &*(uri_handler as *mut T::Instance);
let imp = instance.get_impl(); let imp = instance.get_impl();