Update for glib subclass API cleanup

This commit is contained in:
Sebastian Dröge 2021-03-08 12:06:56 +02:00
parent b8c20c07ce
commit 0803dd411e
32 changed files with 79 additions and 94 deletions

View file

@ -534,8 +534,8 @@ unsafe impl<T: AudioDecoderImpl> IsSubclassable<T> for AudioDecoder
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Element as IsSubclassable<T>>::override_vfuncs(klass); <gst::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.open = Some(audio_decoder_open::<T>); klass.open = Some(audio_decoder_open::<T>);
klass.close = Some(audio_decoder_close::<T>); klass.close = Some(audio_decoder_close::<T>);

View file

@ -480,8 +480,8 @@ unsafe impl<T: AudioEncoderImpl> IsSubclassable<T> for AudioEncoder
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Element as IsSubclassable<T>>::override_vfuncs(klass); <gst::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.open = Some(audio_encoder_open::<T>); klass.open = Some(audio_encoder_open::<T>);
klass.close = Some(audio_encoder_close::<T>); klass.close = Some(audio_encoder_close::<T>);

View file

@ -188,8 +188,8 @@ unsafe impl<T: AudioSinkImpl> IsSubclassable<T> for AudioSink
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst_base::BaseSink as IsSubclassable<T>>::override_vfuncs(klass); <gst_base::BaseSink as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.close = Some(audiosink_close::<T>); klass.close = Some(audiosink_close::<T>);
klass.delay = Some(audiosink_delay::<T>); klass.delay = Some(audiosink_delay::<T>);

View file

@ -204,8 +204,8 @@ unsafe impl<T: AudioSrcImpl> IsSubclassable<T> for AudioSrc
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst_base::BaseSrc as IsSubclassable<T>>::override_vfuncs(klass); <gst_base::BaseSrc as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.close = Some(audiosrc_close::<T>); klass.close = Some(audiosrc_close::<T>);
klass.delay = Some(audiosrc_delay::<T>); klass.delay = Some(audiosrc_delay::<T>);

View file

@ -707,8 +707,8 @@ unsafe impl<T: AggregatorImpl> IsSubclassable<T> for Aggregator
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Element as IsSubclassable<T>>::override_vfuncs(klass); <gst::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.flush = Some(aggregator_flush::<T>); klass.flush = Some(aggregator_flush::<T>);
klass.clip = Some(aggregator_clip::<T>); klass.clip = Some(aggregator_clip::<T>);

View file

@ -94,8 +94,8 @@ impl<T: AggregatorPadImpl> AggregatorPadImplExt for T {
} }
} }
unsafe impl<T: AggregatorPadImpl> IsSubclassable<T> for AggregatorPad { unsafe impl<T: AggregatorPadImpl> IsSubclassable<T> for AggregatorPad {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Pad as IsSubclassable<T>>::override_vfuncs(klass); <gst::Pad as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.flush = Some(aggregator_pad_flush::<T>); klass.flush = Some(aggregator_pad_flush::<T>);
klass.skip_buffer = Some(aggregator_pad_skip_buffer::<T>); klass.skip_buffer = Some(aggregator_pad_skip_buffer::<T>);

View file

@ -207,8 +207,8 @@ unsafe impl<T: BaseParseImpl> IsSubclassable<T> for BaseParse
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Element as IsSubclassable<T>>::override_vfuncs(klass); <gst::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.start = Some(base_parse_start::<T>); klass.start = Some(base_parse_start::<T>);
klass.stop = Some(base_parse_stop::<T>); klass.stop = Some(base_parse_stop::<T>);

View file

@ -404,8 +404,8 @@ unsafe impl<T: BaseSinkImpl> IsSubclassable<T> for BaseSink
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Element as IsSubclassable<T>>::override_vfuncs(klass); <gst::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.start = Some(base_sink_start::<T>); klass.start = Some(base_sink_start::<T>);
klass.stop = Some(base_sink_stop::<T>); klass.stop = Some(base_sink_stop::<T>);

View file

@ -584,8 +584,8 @@ unsafe impl<T: BaseSrcImpl> IsSubclassable<T> for BaseSrc
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Element as IsSubclassable<T>>::override_vfuncs(klass); <gst::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.start = Some(base_src_start::<T>); klass.start = Some(base_src_start::<T>);
klass.stop = Some(base_src_stop::<T>); klass.stop = Some(base_src_stop::<T>);

View file

@ -838,8 +838,8 @@ unsafe impl<T: BaseTransformImpl> IsSubclassable<T> for BaseTransform
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Element as IsSubclassable<T>>::override_vfuncs(klass); <gst::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.start = Some(base_transform_start::<T>); klass.start = Some(base_transform_start::<T>);
klass.stop = Some(base_transform_stop::<T>); klass.stop = Some(base_transform_stop::<T>);

View file

@ -114,8 +114,8 @@ unsafe impl<T: PushSrcImpl> IsSubclassable<T> for PushSrc
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<crate::BaseSrc as IsSubclassable<T>>::override_vfuncs(klass); <crate::BaseSrc as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.fill = Some(push_src_fill::<T>); klass.fill = Some(push_src_fill::<T>);
klass.alloc = Some(push_src_alloc::<T>); klass.alloc = Some(push_src_alloc::<T>);

View file

@ -11,13 +11,10 @@ pub trait PlayerVideoRendererImpl: ObjectImpl {
} }
unsafe impl<T: PlayerVideoRendererImpl> IsImplementable<T> for PlayerVideoRenderer { unsafe impl<T: PlayerVideoRendererImpl> IsImplementable<T> for PlayerVideoRenderer {
unsafe extern "C" fn interface_init( fn interface_init(iface: &mut glib::Class<Self>) {
iface: glib::ffi::gpointer, let iface = iface.as_mut();
_iface_data: glib::ffi::gpointer,
) {
let video_renderer_iface = &mut *(iface as *mut ffi::GstPlayerVideoRendererInterface);
video_renderer_iface.create_video_sink = Some(video_renderer_create_video_sink::<T>); iface.create_video_sink = Some(video_renderer_create_video_sink::<T>);
} }
} }

View file

@ -854,8 +854,8 @@ impl<T: RTSPClientImpl> RTSPClientImplExt for T {
} }
} }
unsafe impl<T: RTSPClientImpl> IsSubclassable<T> for RTSPClient { unsafe impl<T: RTSPClientImpl> IsSubclassable<T> for RTSPClient {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<glib::Object as IsSubclassable<T>>::override_vfuncs(klass); <glib::Object as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.create_sdp = Some(client_create_sdp::<T>); klass.create_sdp = Some(client_create_sdp::<T>);
klass.configure_client_media = Some(client_configure_client_media::<T>); klass.configure_client_media = Some(client_configure_client_media::<T>);

View file

@ -451,8 +451,8 @@ impl<T: RTSPMediaImpl> RTSPMediaImplExt for T {
} }
} }
unsafe impl<T: RTSPMediaImpl> IsSubclassable<T> for RTSPMedia { unsafe impl<T: RTSPMediaImpl> IsSubclassable<T> for RTSPMedia {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<glib::Object as IsSubclassable<T>>::override_vfuncs(klass); <glib::Object as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.handle_message = Some(media_handle_message::<T>); klass.handle_message = Some(media_handle_message::<T>);
klass.prepare = Some(media_prepare::<T>); klass.prepare = Some(media_prepare::<T>);

View file

@ -232,8 +232,8 @@ impl<T: RTSPMediaFactoryImpl> RTSPMediaFactoryImplExt for T {
} }
} }
unsafe impl<T: RTSPMediaFactoryImpl> IsSubclassable<T> for RTSPMediaFactory { unsafe impl<T: RTSPMediaFactoryImpl> IsSubclassable<T> for RTSPMediaFactory {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<glib::Object as IsSubclassable<T>>::override_vfuncs(klass); <glib::Object as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.gen_key = Some(factory_gen_key::<T>); klass.gen_key = Some(factory_gen_key::<T>);
klass.create_element = Some(factory_create_element::<T>); klass.create_element = Some(factory_create_element::<T>);

View file

@ -48,8 +48,8 @@ impl<T: RTSPServerImpl> RTSPServerImplExt for T {
} }
} }
unsafe impl<T: RTSPServerImpl> IsSubclassable<T> for RTSPServer { unsafe impl<T: RTSPServerImpl> IsSubclassable<T> for RTSPServer {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<glib::Object as IsSubclassable<T>>::override_vfuncs(klass); <glib::Object as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.create_client = Some(server_create_client::<T>); klass.create_client = Some(server_create_client::<T>);
klass.client_connected = Some(server_client_connected::<T>); klass.client_connected = Some(server_client_connected::<T>);

View file

@ -536,8 +536,8 @@ unsafe impl<T: VideoDecoderImpl> IsSubclassable<T> for VideoDecoder
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Element as IsSubclassable<T>>::override_vfuncs(klass); <gst::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.open = Some(video_decoder_open::<T>); klass.open = Some(video_decoder_open::<T>);
klass.close = Some(video_decoder_close::<T>); klass.close = Some(video_decoder_close::<T>);

View file

@ -470,8 +470,8 @@ unsafe impl<T: VideoEncoderImpl> IsSubclassable<T> for VideoEncoder
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst::Element as IsSubclassable<T>>::override_vfuncs(klass); <gst::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.open = Some(video_encoder_open::<T>); klass.open = Some(video_encoder_open::<T>);
klass.close = Some(video_encoder_close::<T>); klass.close = Some(video_encoder_close::<T>);

View file

@ -54,8 +54,8 @@ unsafe impl<T: VideoSinkImpl> IsSubclassable<T> for VideoSink
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<gst_base::BaseSink as IsSubclassable<T>>::override_vfuncs(klass); <gst_base::BaseSink as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.show_frame = Some(video_sink_show_frame::<T>); klass.show_frame = Some(video_sink_show_frame::<T>);
} }

View file

@ -102,8 +102,8 @@ unsafe impl<T: BinImpl> IsSubclassable<T> for Bin
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<crate::Element as IsSubclassable<T>>::override_vfuncs(klass); <crate::Element as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.add_element = Some(bin_add_element::<T>); klass.add_element = Some(bin_add_element::<T>);
klass.remove_element = Some(bin_remove_element::<T>); klass.remove_element = Some(bin_remove_element::<T>);

View file

@ -33,17 +33,14 @@ pub trait ChildProxyImpl: ObjectImpl + Send + Sync {
} }
unsafe impl<T: ChildProxyImpl> IsImplementable<T> for ChildProxy { unsafe impl<T: ChildProxyImpl> IsImplementable<T> for ChildProxy {
unsafe extern "C" fn interface_init( fn interface_init(iface: &mut glib::Class<Self>) {
iface: glib::ffi::gpointer, let iface = iface.as_mut();
_iface_data: glib::ffi::gpointer,
) {
let child_proxy_iface = &mut *(iface as *mut ffi::GstChildProxyInterface);
child_proxy_iface.get_child_by_name = Some(child_proxy_get_child_by_name::<T>); iface.get_child_by_name = Some(child_proxy_get_child_by_name::<T>);
child_proxy_iface.get_child_by_index = Some(child_proxy_get_child_by_index::<T>); iface.get_child_by_index = Some(child_proxy_get_child_by_index::<T>);
child_proxy_iface.get_children_count = Some(child_proxy_get_children_count::<T>); iface.get_children_count = Some(child_proxy_get_children_count::<T>);
child_proxy_iface.child_added = Some(child_proxy_child_added::<T>); iface.child_added = Some(child_proxy_child_added::<T>);
child_proxy_iface.child_removed = Some(child_proxy_child_removed::<T>); iface.child_removed = Some(child_proxy_child_removed::<T>);
} }
} }

View file

@ -231,8 +231,8 @@ impl<T: ClockImpl> ClockImplExt for T {
} }
unsafe impl<T: ClockImpl> IsSubclassable<T> for Clock { unsafe impl<T: ClockImpl> IsSubclassable<T> for Clock {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<glib::Object as IsSubclassable<T>>::override_vfuncs(klass); <glib::Object as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.change_resolution = Some(clock_change_resolution::<T>); klass.change_resolution = Some(clock_change_resolution::<T>);
klass.get_resolution = Some(clock_get_resolution::<T>); klass.get_resolution = Some(clock_get_resolution::<T>);

View file

@ -100,8 +100,8 @@ impl<T: DeviceImpl> DeviceImplExt for T {
} }
unsafe impl<T: DeviceImpl> IsSubclassable<T> for Device { unsafe impl<T: DeviceImpl> IsSubclassable<T> for Device {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<glib::Object as IsSubclassable<T>>::override_vfuncs(klass); <glib::Object as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.create_element = Some(device_create_element::<T>); klass.create_element = Some(device_create_element::<T>);
klass.reconfigure_element = Some(device_reconfigure_element::<T>); klass.reconfigure_element = Some(device_reconfigure_element::<T>);

View file

@ -92,8 +92,8 @@ impl<T: DeviceProviderImpl> DeviceProviderImplExt for T {
} }
unsafe impl<T: DeviceProviderImpl> IsSubclassable<T> for DeviceProvider { unsafe impl<T: DeviceProviderImpl> IsSubclassable<T> for DeviceProvider {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<glib::Object as IsSubclassable<T>>::override_vfuncs(klass); <glib::Object as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.probe = Some(device_provider_probe::<T>); klass.probe = Some(device_provider_probe::<T>);
klass.start = Some(device_provider_start::<T>); klass.start = Some(device_provider_start::<T>);

View file

@ -355,8 +355,8 @@ unsafe impl<T: ElementImpl> IsSubclassable<T> for Element
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<glib::Object as IsSubclassable<T>>::override_vfuncs(klass); <glib::Object as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.change_state = Some(element_change_state::<T>); klass.change_state = Some(element_change_state::<T>);

View file

@ -8,8 +8,8 @@ use crate::GhostPad;
pub trait GhostPadImpl: PadImpl {} pub trait GhostPadImpl: PadImpl {}
unsafe impl<T: GhostPadImpl> IsSubclassable<T> for GhostPad { unsafe impl<T: GhostPadImpl> IsSubclassable<T> for GhostPad {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<crate::Pad as IsSubclassable<T>>::override_vfuncs(klass); <crate::Pad as IsSubclassable<T>>::class_init(klass);
let _klass = klass.as_mut(); let _klass = klass.as_mut();
// Nothing to do here // Nothing to do here
} }

View file

@ -59,8 +59,8 @@ impl<T: PadImpl> PadImplExt for T {
} }
unsafe impl<T: PadImpl> IsSubclassable<T> for Pad { unsafe impl<T: PadImpl> IsSubclassable<T> for Pad {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<glib::Object as IsSubclassable<T>>::override_vfuncs(klass); <glib::Object as IsSubclassable<T>>::class_init(klass);
let klass = klass.as_mut(); let klass = klass.as_mut();
klass.linked = Some(pad_linked::<T>); klass.linked = Some(pad_linked::<T>);
klass.unlinked = Some(pad_unlinked::<T>); klass.unlinked = Some(pad_unlinked::<T>);

View file

@ -11,8 +11,8 @@ unsafe impl<T: PipelineImpl> IsSubclassable<T> for Pipeline
where where
<T as ObjectSubclass>::Instance: PanicPoison, <T as ObjectSubclass>::Instance: PanicPoison,
{ {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<crate::Bin as IsSubclassable<T>>::override_vfuncs(klass); <crate::Bin as IsSubclassable<T>>::class_init(klass);
let _klass = klass.as_mut(); let _klass = klass.as_mut();
// Nothing to do here // Nothing to do here
} }

View file

@ -7,9 +7,5 @@ use crate::Preset;
pub trait PresetImpl: super::element::ElementImpl {} pub trait PresetImpl: super::element::ElementImpl {}
unsafe impl<T: PresetImpl> IsImplementable<T> for Preset { unsafe impl<T: PresetImpl> IsImplementable<T> for Preset {
unsafe extern "C" fn interface_init( fn interface_init(_iface: &mut glib::Class<Self>) {}
_iface: glib::ffi::gpointer,
_iface_data: glib::ffi::gpointer,
) {
}
} }

View file

@ -8,8 +8,8 @@ use crate::SystemClock;
pub trait SystemClockImpl: ClockImpl {} pub trait SystemClockImpl: ClockImpl {}
unsafe impl<T: SystemClockImpl> IsSubclassable<T> for SystemClock { unsafe impl<T: SystemClockImpl> IsSubclassable<T> for SystemClock {
fn override_vfuncs(klass: &mut glib::Class<Self>) { fn class_init(klass: &mut glib::Class<Self>) {
<crate::Clock as IsSubclassable<T>>::override_vfuncs(klass); <crate::Clock as IsSubclassable<T>>::class_init(klass);
let _klass = klass.as_mut(); let _klass = klass.as_mut();
// Nothing to do here // Nothing to do here
} }

View file

@ -7,9 +7,5 @@ use crate::TagSetter;
pub trait TagSetterImpl: super::element::ElementImpl {} pub trait TagSetterImpl: super::element::ElementImpl {}
unsafe impl<T: TagSetterImpl> IsImplementable<T> for TagSetter { unsafe impl<T: TagSetterImpl> IsImplementable<T> for TagSetter {
unsafe extern "C" fn interface_init( fn interface_init(_iface: &mut glib::Class<Self>) {}
_iface: glib::ffi::gpointer,
_iface_data: glib::ffi::gpointer,
) {
}
} }

View file

@ -21,24 +21,23 @@ unsafe impl Send for CStrV {}
unsafe impl Sync for CStrV {} unsafe impl Sync for CStrV {}
unsafe impl<T: URIHandlerImpl> IsImplementable<T> for URIHandler { unsafe impl<T: URIHandlerImpl> IsImplementable<T> for URIHandler {
unsafe extern "C" fn interface_init( fn interface_init(iface: &mut glib::Class<Self>) {
iface: glib::ffi::gpointer, let iface = iface.as_mut();
_iface_data: glib::ffi::gpointer,
) {
let uri_handler_iface = &mut *(iface as *mut ffi::GstURIHandlerInterface);
// Store the protocols in the interface data for later use // Store the protocols in the interface data for later use
unsafe {
let mut data = T::type_data(); let mut data = T::type_data();
let protocols = T::get_protocols(); let protocols = T::get_protocols();
let protocols = protocols.to_glib_full(); let protocols = protocols.to_glib_full();
let data = data.as_mut(); let data = data.as_mut();
data.set_class_data(URIHandler::static_type(), CStrV(protocols)); data.set_class_data(URIHandler::static_type(), CStrV(protocols));
}
uri_handler_iface.get_type = Some(uri_handler_get_type::<T>); iface.get_type = Some(uri_handler_get_type::<T>);
uri_handler_iface.get_protocols = Some(uri_handler_get_protocols::<T>); iface.get_protocols = Some(uri_handler_get_protocols::<T>);
uri_handler_iface.get_uri = Some(uri_handler_get_uri::<T>); iface.get_uri = Some(uri_handler_get_uri::<T>);
uri_handler_iface.set_uri = Some(uri_handler_set_uri::<T>); iface.set_uri = Some(uri_handler_set_uri::<T>);
} }
} }