Update for the subclassing glib bindings API changes

This commit is contained in:
Sebastian Dröge 2021-03-09 13:50:32 +02:00
parent bcec97373f
commit 6fa48890bc
32 changed files with 117 additions and 0 deletions

View file

@ -555,6 +555,10 @@ where
klass.propose_allocation = Some(audio_decoder_propose_allocation::<T>); klass.propose_allocation = Some(audio_decoder_propose_allocation::<T>);
klass.decide_allocation = Some(audio_decoder_decide_allocation::<T>); klass.decide_allocation = Some(audio_decoder_decide_allocation::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn audio_decoder_open<T: AudioDecoderImpl>( unsafe extern "C" fn audio_decoder_open<T: AudioDecoderImpl>(

View file

@ -500,6 +500,10 @@ where
klass.propose_allocation = Some(audio_encoder_propose_allocation::<T>); klass.propose_allocation = Some(audio_encoder_propose_allocation::<T>);
klass.decide_allocation = Some(audio_encoder_decide_allocation::<T>); klass.decide_allocation = Some(audio_encoder_decide_allocation::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn audio_encoder_open<T: AudioEncoderImpl>( unsafe extern "C" fn audio_encoder_open<T: AudioEncoderImpl>(

View file

@ -199,6 +199,10 @@ where
klass.write = Some(audiosink_write::<T>); klass.write = Some(audiosink_write::<T>);
klass.reset = Some(audiosink_reset::<T>); klass.reset = Some(audiosink_reset::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst_base::BaseSink as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn audiosink_close<T: AudioSinkImpl>( unsafe extern "C" fn audiosink_close<T: AudioSinkImpl>(

View file

@ -215,6 +215,10 @@ where
klass.read = Some(audiosrc_read::<T>); klass.read = Some(audiosrc_read::<T>);
klass.reset = Some(audiosrc_reset::<T>); klass.reset = Some(audiosrc_reset::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst_base::BaseSrc as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn audiosrc_close<T: AudioSrcImpl>( unsafe extern "C" fn audiosrc_close<T: AudioSrcImpl>(

View file

@ -735,6 +735,10 @@ where
klass.finish_buffer_list = Some(aggregator_finish_buffer_list::<T>); klass.finish_buffer_list = Some(aggregator_finish_buffer_list::<T>);
} }
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn aggregator_flush<T: AggregatorImpl>( unsafe extern "C" fn aggregator_flush<T: AggregatorImpl>(

View file

@ -100,6 +100,10 @@ unsafe impl<T: AggregatorPadImpl> IsSubclassable<T> for AggregatorPad {
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>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Pad as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn aggregator_pad_flush<T: AggregatorPadImpl>( unsafe extern "C" fn aggregator_pad_flush<T: AggregatorPadImpl>(

View file

@ -216,6 +216,10 @@ where
klass.handle_frame = Some(base_parse_handle_frame::<T>); klass.handle_frame = Some(base_parse_handle_frame::<T>);
klass.convert = Some(base_parse_convert::<T>); klass.convert = Some(base_parse_convert::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn base_parse_start<T: BaseParseImpl>( unsafe extern "C" fn base_parse_start<T: BaseParseImpl>(

View file

@ -421,6 +421,10 @@ where
klass.unlock = Some(base_sink_unlock::<T>); klass.unlock = Some(base_sink_unlock::<T>);
klass.unlock_stop = Some(base_sink_unlock_stop::<T>); klass.unlock_stop = Some(base_sink_unlock_stop::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn base_sink_start<T: BaseSinkImpl>( unsafe extern "C" fn base_sink_start<T: BaseSinkImpl>(

View file

@ -605,6 +605,10 @@ where
klass.unlock = Some(base_src_unlock::<T>); klass.unlock = Some(base_src_unlock::<T>);
klass.unlock_stop = Some(base_src_unlock_stop::<T>); klass.unlock_stop = Some(base_src_unlock_stop::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn base_src_start<T: BaseSrcImpl>( unsafe extern "C" fn base_src_start<T: BaseSrcImpl>(

View file

@ -877,6 +877,10 @@ where
} }
} }
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
#[derive(Debug)] #[derive(Debug)]

View file

@ -121,6 +121,10 @@ where
klass.alloc = Some(push_src_alloc::<T>); klass.alloc = Some(push_src_alloc::<T>);
klass.create = Some(push_src_create::<T>); klass.create = Some(push_src_create::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<crate::BaseSrc as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn push_src_fill<T: PushSrcImpl>( unsafe extern "C" fn push_src_fill<T: PushSrcImpl>(

View file

@ -16,6 +16,8 @@ unsafe impl<T: PlayerVideoRendererImpl> IsImplementable<T> for PlayerVideoRender
iface.create_video_sink = Some(video_renderer_create_video_sink::<T>); iface.create_video_sink = Some(video_renderer_create_video_sink::<T>);
} }
fn instance_init(_instance: &mut glib::subclass::InitializingObject<T>) {}
} }
unsafe extern "C" fn video_renderer_create_video_sink<T: PlayerVideoRendererImpl>( unsafe extern "C" fn video_renderer_create_video_sink<T: PlayerVideoRendererImpl>(

View file

@ -888,6 +888,10 @@ unsafe impl<T: RTSPClientImpl> IsSubclassable<T> for RTSPClient {
klass.pre_announce_request = Some(client_pre_announce_request::<T>); klass.pre_announce_request = Some(client_pre_announce_request::<T>);
klass.pre_record_request = Some(client_pre_record_request::<T>); klass.pre_record_request = Some(client_pre_record_request::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<glib::Object as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn client_create_sdp<T: RTSPClientImpl>( unsafe extern "C" fn client_create_sdp<T: RTSPClientImpl>(

View file

@ -472,6 +472,10 @@ unsafe impl<T: RTSPMediaImpl> IsSubclassable<T> for RTSPMedia {
klass.new_state = Some(media_new_state::<T>); klass.new_state = Some(media_new_state::<T>);
klass.handle_sdp = Some(media_handle_sdp::<T>); klass.handle_sdp = Some(media_handle_sdp::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<glib::Object as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn media_handle_message<T: RTSPMediaImpl>( unsafe extern "C" fn media_handle_message<T: RTSPMediaImpl>(

View file

@ -243,6 +243,10 @@ unsafe impl<T: RTSPMediaFactoryImpl> IsSubclassable<T> for RTSPMediaFactory {
klass.media_constructed = Some(factory_media_constructed::<T>); klass.media_constructed = Some(factory_media_constructed::<T>);
klass.media_configure = Some(factory_media_configure::<T>); klass.media_configure = Some(factory_media_configure::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<glib::Object as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn factory_gen_key<T: RTSPMediaFactoryImpl>( unsafe extern "C" fn factory_gen_key<T: RTSPMediaFactoryImpl>(

View file

@ -54,6 +54,10 @@ unsafe impl<T: RTSPServerImpl> IsSubclassable<T> for RTSPServer {
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>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<glib::Object as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn server_create_client<T: RTSPServerImpl>( unsafe extern "C" fn server_create_client<T: RTSPServerImpl>(

View file

@ -558,6 +558,10 @@ where
klass.propose_allocation = Some(video_decoder_propose_allocation::<T>); klass.propose_allocation = Some(video_decoder_propose_allocation::<T>);
klass.decide_allocation = Some(video_decoder_decide_allocation::<T>); klass.decide_allocation = Some(video_decoder_decide_allocation::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn video_decoder_open<T: VideoDecoderImpl>( unsafe extern "C" fn video_decoder_open<T: VideoDecoderImpl>(

View file

@ -490,6 +490,10 @@ where
klass.propose_allocation = Some(video_encoder_propose_allocation::<T>); klass.propose_allocation = Some(video_encoder_propose_allocation::<T>);
klass.decide_allocation = Some(video_encoder_decide_allocation::<T>); klass.decide_allocation = Some(video_encoder_decide_allocation::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn video_encoder_open<T: VideoEncoderImpl>( unsafe extern "C" fn video_encoder_open<T: VideoEncoderImpl>(

View file

@ -59,6 +59,10 @@ where
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>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<gst_base::BaseSink as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn video_sink_show_frame<T: VideoSinkImpl>( unsafe extern "C" fn video_sink_show_frame<T: VideoSinkImpl>(

View file

@ -109,6 +109,10 @@ where
klass.remove_element = Some(bin_remove_element::<T>); klass.remove_element = Some(bin_remove_element::<T>);
klass.handle_message = Some(bin_handle_message::<T>); klass.handle_message = Some(bin_handle_message::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<crate::Element as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn bin_add_element<T: BinImpl>( unsafe extern "C" fn bin_add_element<T: BinImpl>(

View file

@ -42,6 +42,8 @@ unsafe impl<T: ChildProxyImpl> IsImplementable<T> for ChildProxy {
iface.child_added = Some(child_proxy_child_added::<T>); iface.child_added = Some(child_proxy_child_added::<T>);
iface.child_removed = Some(child_proxy_child_removed::<T>); iface.child_removed = Some(child_proxy_child_removed::<T>);
} }
fn instance_init(_instance: &mut glib::subclass::InitializingObject<T>) {}
} }
unsafe extern "C" fn child_proxy_get_child_by_name<T: ChildProxyImpl>( unsafe extern "C" fn child_proxy_get_child_by_name<T: ChildProxyImpl>(

View file

@ -241,6 +241,10 @@ unsafe impl<T: ClockImpl> IsSubclassable<T> for Clock {
klass.wait_async = Some(clock_wait_async::<T>); klass.wait_async = Some(clock_wait_async::<T>);
klass.unschedule = Some(clock_unschedule::<T>); klass.unschedule = Some(clock_unschedule::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<glib::Object as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn clock_change_resolution<T: ClockImpl>( unsafe extern "C" fn clock_change_resolution<T: ClockImpl>(

View file

@ -106,6 +106,10 @@ unsafe impl<T: DeviceImpl> IsSubclassable<T> for Device {
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>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<glib::Object as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn device_create_element<T: DeviceImpl>( unsafe extern "C" fn device_create_element<T: DeviceImpl>(

View file

@ -119,6 +119,10 @@ unsafe impl<T: DeviceProviderImpl> IsSubclassable<T> for DeviceProvider {
} }
} }
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<glib::Object as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn device_provider_probe<T: DeviceProviderImpl>( unsafe extern "C" fn device_provider_probe<T: DeviceProviderImpl>(

View file

@ -393,6 +393,10 @@ where
} }
} }
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<glib::Object as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn element_change_state<T: ElementImpl>( unsafe extern "C" fn element_change_state<T: ElementImpl>(

View file

@ -13,4 +13,8 @@ unsafe impl<T: GhostPadImpl> IsSubclassable<T> for GhostPad {
let _klass = klass.as_mut(); let _klass = klass.as_mut();
// Nothing to do here // Nothing to do here
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<crate::Pad as IsSubclassable<T>>::instance_init(instance);
}
} }

View file

@ -65,6 +65,10 @@ unsafe impl<T: PadImpl> IsSubclassable<T> for Pad {
klass.linked = Some(pad_linked::<T>); klass.linked = Some(pad_linked::<T>);
klass.unlinked = Some(pad_unlinked::<T>); klass.unlinked = Some(pad_unlinked::<T>);
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<glib::Object as IsSubclassable<T>>::instance_init(instance);
}
} }
unsafe extern "C" fn pad_linked<T: PadImpl>(ptr: *mut ffi::GstPad, peer: *mut ffi::GstPad) { unsafe extern "C" fn pad_linked<T: PadImpl>(ptr: *mut ffi::GstPad, peer: *mut ffi::GstPad) {

View file

@ -16,4 +16,8 @@ where
let _klass = klass.as_mut(); let _klass = klass.as_mut();
// Nothing to do here // Nothing to do here
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<crate::Bin as IsSubclassable<T>>::instance_init(instance);
}
} }

View file

@ -8,4 +8,6 @@ pub trait PresetImpl: super::element::ElementImpl {}
unsafe impl<T: PresetImpl> IsImplementable<T> for Preset { unsafe impl<T: PresetImpl> IsImplementable<T> for Preset {
fn interface_init(_iface: &mut glib::Class<Self>) {} fn interface_init(_iface: &mut glib::Class<Self>) {}
fn instance_init(_instance: &mut glib::subclass::InitializingObject<T>) {}
} }

View file

@ -13,4 +13,8 @@ unsafe impl<T: SystemClockImpl> IsSubclassable<T> for SystemClock {
let _klass = klass.as_mut(); let _klass = klass.as_mut();
// Nothing to do here // Nothing to do here
} }
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
<crate::Clock as IsSubclassable<T>>::instance_init(instance);
}
} }

View file

@ -8,4 +8,5 @@ pub trait TagSetterImpl: super::element::ElementImpl {}
unsafe impl<T: TagSetterImpl> IsImplementable<T> for TagSetter { unsafe impl<T: TagSetterImpl> IsImplementable<T> for TagSetter {
fn interface_init(_iface: &mut glib::Class<Self>) {} fn interface_init(_iface: &mut glib::Class<Self>) {}
fn instance_init(_instance: &mut glib::subclass::InitializingObject<T>) {}
} }

View file

@ -39,6 +39,8 @@ unsafe impl<T: URIHandlerImpl> IsImplementable<T> for URIHandler {
iface.get_uri = Some(uri_handler_get_uri::<T>); iface.get_uri = Some(uri_handler_get_uri::<T>);
iface.set_uri = Some(uri_handler_set_uri::<T>); iface.set_uri = Some(uri_handler_set_uri::<T>);
} }
fn instance_init(_instance: &mut glib::subclass::InitializingObject<T>) {}
} }
unsafe extern "C" fn uri_handler_get_type<T: URIHandlerImpl>( unsafe extern "C" fn uri_handler_get_type<T: URIHandlerImpl>(