mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 03:21:03 +00:00
Update for glib subclass API cleanup
This commit is contained in:
parent
b8c20c07ce
commit
0803dd411e
32 changed files with 79 additions and 94 deletions
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>);
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
let mut data = T::type_data();
|
unsafe {
|
||||||
let protocols = T::get_protocols();
|
let mut data = T::type_data();
|
||||||
let protocols = protocols.to_glib_full();
|
let protocols = T::get_protocols();
|
||||||
let data = data.as_mut();
|
let protocols = protocols.to_glib_full();
|
||||||
|
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>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue