From 6fa48890bc9d53469946e02f8fc30fe391d446d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 9 Mar 2021 13:50:32 +0200 Subject: [PATCH] Update for the subclassing glib bindings API changes --- gstreamer-audio/src/subclass/audio_decoder.rs | 4 ++++ gstreamer-audio/src/subclass/audio_encoder.rs | 4 ++++ gstreamer-audio/src/subclass/audio_sink.rs | 4 ++++ gstreamer-audio/src/subclass/audio_src.rs | 4 ++++ gstreamer-base/src/subclass/aggregator.rs | 4 ++++ gstreamer-base/src/subclass/aggregator_pad.rs | 4 ++++ gstreamer-base/src/subclass/base_parse.rs | 4 ++++ gstreamer-base/src/subclass/base_sink.rs | 4 ++++ gstreamer-base/src/subclass/base_src.rs | 4 ++++ gstreamer-base/src/subclass/base_transform.rs | 4 ++++ gstreamer-base/src/subclass/push_src.rs | 4 ++++ gstreamer-player/src/subclass/player_video_renderer.rs | 2 ++ gstreamer-rtsp-server/src/subclass/rtsp_client.rs | 4 ++++ gstreamer-rtsp-server/src/subclass/rtsp_media.rs | 4 ++++ gstreamer-rtsp-server/src/subclass/rtsp_media_factory.rs | 4 ++++ gstreamer-rtsp-server/src/subclass/rtsp_server.rs | 4 ++++ gstreamer-video/src/subclass/video_decoder.rs | 4 ++++ gstreamer-video/src/subclass/video_encoder.rs | 4 ++++ gstreamer-video/src/subclass/video_sink.rs | 4 ++++ gstreamer/src/subclass/bin.rs | 4 ++++ gstreamer/src/subclass/child_proxy.rs | 2 ++ gstreamer/src/subclass/clock.rs | 4 ++++ gstreamer/src/subclass/device.rs | 4 ++++ gstreamer/src/subclass/device_provider.rs | 4 ++++ gstreamer/src/subclass/element.rs | 4 ++++ gstreamer/src/subclass/ghost_pad.rs | 4 ++++ gstreamer/src/subclass/pad.rs | 4 ++++ gstreamer/src/subclass/pipeline.rs | 4 ++++ gstreamer/src/subclass/preset.rs | 2 ++ gstreamer/src/subclass/system_clock.rs | 4 ++++ gstreamer/src/subclass/tag_setter.rs | 1 + gstreamer/src/subclass/uri_handler.rs | 2 ++ 32 files changed, 117 insertions(+) diff --git a/gstreamer-audio/src/subclass/audio_decoder.rs b/gstreamer-audio/src/subclass/audio_decoder.rs index 65fbe91d9..eff738992 100644 --- a/gstreamer-audio/src/subclass/audio_decoder.rs +++ b/gstreamer-audio/src/subclass/audio_decoder.rs @@ -555,6 +555,10 @@ where klass.propose_allocation = Some(audio_decoder_propose_allocation::); klass.decide_allocation = Some(audio_decoder_decide_allocation::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn audio_decoder_open( diff --git a/gstreamer-audio/src/subclass/audio_encoder.rs b/gstreamer-audio/src/subclass/audio_encoder.rs index d73daa2d5..50ef6fa35 100644 --- a/gstreamer-audio/src/subclass/audio_encoder.rs +++ b/gstreamer-audio/src/subclass/audio_encoder.rs @@ -500,6 +500,10 @@ where klass.propose_allocation = Some(audio_encoder_propose_allocation::); klass.decide_allocation = Some(audio_encoder_decide_allocation::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn audio_encoder_open( diff --git a/gstreamer-audio/src/subclass/audio_sink.rs b/gstreamer-audio/src/subclass/audio_sink.rs index 7d6941cbd..3dbd04edd 100644 --- a/gstreamer-audio/src/subclass/audio_sink.rs +++ b/gstreamer-audio/src/subclass/audio_sink.rs @@ -199,6 +199,10 @@ where klass.write = Some(audiosink_write::); klass.reset = Some(audiosink_reset::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn audiosink_close( diff --git a/gstreamer-audio/src/subclass/audio_src.rs b/gstreamer-audio/src/subclass/audio_src.rs index 375793394..93b3e1c8c 100644 --- a/gstreamer-audio/src/subclass/audio_src.rs +++ b/gstreamer-audio/src/subclass/audio_src.rs @@ -215,6 +215,10 @@ where klass.read = Some(audiosrc_read::); klass.reset = Some(audiosrc_reset::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn audiosrc_close( diff --git a/gstreamer-base/src/subclass/aggregator.rs b/gstreamer-base/src/subclass/aggregator.rs index fbba5b1d8..80f204f74 100644 --- a/gstreamer-base/src/subclass/aggregator.rs +++ b/gstreamer-base/src/subclass/aggregator.rs @@ -735,6 +735,10 @@ where klass.finish_buffer_list = Some(aggregator_finish_buffer_list::); } } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn aggregator_flush( diff --git a/gstreamer-base/src/subclass/aggregator_pad.rs b/gstreamer-base/src/subclass/aggregator_pad.rs index 246b21b3e..a0769517c 100644 --- a/gstreamer-base/src/subclass/aggregator_pad.rs +++ b/gstreamer-base/src/subclass/aggregator_pad.rs @@ -100,6 +100,10 @@ unsafe impl IsSubclassable for AggregatorPad { klass.flush = Some(aggregator_pad_flush::); klass.skip_buffer = Some(aggregator_pad_skip_buffer::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn aggregator_pad_flush( diff --git a/gstreamer-base/src/subclass/base_parse.rs b/gstreamer-base/src/subclass/base_parse.rs index a7587ded5..799b33c05 100644 --- a/gstreamer-base/src/subclass/base_parse.rs +++ b/gstreamer-base/src/subclass/base_parse.rs @@ -216,6 +216,10 @@ where klass.handle_frame = Some(base_parse_handle_frame::); klass.convert = Some(base_parse_convert::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn base_parse_start( diff --git a/gstreamer-base/src/subclass/base_sink.rs b/gstreamer-base/src/subclass/base_sink.rs index 56b8fee30..d326f169c 100644 --- a/gstreamer-base/src/subclass/base_sink.rs +++ b/gstreamer-base/src/subclass/base_sink.rs @@ -421,6 +421,10 @@ where klass.unlock = Some(base_sink_unlock::); klass.unlock_stop = Some(base_sink_unlock_stop::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn base_sink_start( diff --git a/gstreamer-base/src/subclass/base_src.rs b/gstreamer-base/src/subclass/base_src.rs index 1ea917e72..68452644c 100644 --- a/gstreamer-base/src/subclass/base_src.rs +++ b/gstreamer-base/src/subclass/base_src.rs @@ -605,6 +605,10 @@ where klass.unlock = Some(base_src_unlock::); klass.unlock_stop = Some(base_src_unlock_stop::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn base_src_start( diff --git a/gstreamer-base/src/subclass/base_transform.rs b/gstreamer-base/src/subclass/base_transform.rs index 50b2c165e..e7079b418 100644 --- a/gstreamer-base/src/subclass/base_transform.rs +++ b/gstreamer-base/src/subclass/base_transform.rs @@ -877,6 +877,10 @@ where } } } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } #[derive(Debug)] diff --git a/gstreamer-base/src/subclass/push_src.rs b/gstreamer-base/src/subclass/push_src.rs index 744cef6c8..a9320b4e8 100644 --- a/gstreamer-base/src/subclass/push_src.rs +++ b/gstreamer-base/src/subclass/push_src.rs @@ -121,6 +121,10 @@ where klass.alloc = Some(push_src_alloc::); klass.create = Some(push_src_create::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn push_src_fill( diff --git a/gstreamer-player/src/subclass/player_video_renderer.rs b/gstreamer-player/src/subclass/player_video_renderer.rs index 112e9a22e..1d13e5190 100644 --- a/gstreamer-player/src/subclass/player_video_renderer.rs +++ b/gstreamer-player/src/subclass/player_video_renderer.rs @@ -16,6 +16,8 @@ unsafe impl IsImplementable for PlayerVideoRender iface.create_video_sink = Some(video_renderer_create_video_sink::); } + + fn instance_init(_instance: &mut glib::subclass::InitializingObject) {} } unsafe extern "C" fn video_renderer_create_video_sink( diff --git a/gstreamer-rtsp-server/src/subclass/rtsp_client.rs b/gstreamer-rtsp-server/src/subclass/rtsp_client.rs index 419a7aa09..6131b9b22 100644 --- a/gstreamer-rtsp-server/src/subclass/rtsp_client.rs +++ b/gstreamer-rtsp-server/src/subclass/rtsp_client.rs @@ -888,6 +888,10 @@ unsafe impl IsSubclassable for RTSPClient { klass.pre_announce_request = Some(client_pre_announce_request::); klass.pre_record_request = Some(client_pre_record_request::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn client_create_sdp( diff --git a/gstreamer-rtsp-server/src/subclass/rtsp_media.rs b/gstreamer-rtsp-server/src/subclass/rtsp_media.rs index f9b50de7e..5f853b4a5 100644 --- a/gstreamer-rtsp-server/src/subclass/rtsp_media.rs +++ b/gstreamer-rtsp-server/src/subclass/rtsp_media.rs @@ -472,6 +472,10 @@ unsafe impl IsSubclassable for RTSPMedia { klass.new_state = Some(media_new_state::); klass.handle_sdp = Some(media_handle_sdp::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn media_handle_message( diff --git a/gstreamer-rtsp-server/src/subclass/rtsp_media_factory.rs b/gstreamer-rtsp-server/src/subclass/rtsp_media_factory.rs index 56d86976a..7c027aa21 100644 --- a/gstreamer-rtsp-server/src/subclass/rtsp_media_factory.rs +++ b/gstreamer-rtsp-server/src/subclass/rtsp_media_factory.rs @@ -243,6 +243,10 @@ unsafe impl IsSubclassable for RTSPMediaFactory { klass.media_constructed = Some(factory_media_constructed::); klass.media_configure = Some(factory_media_configure::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn factory_gen_key( diff --git a/gstreamer-rtsp-server/src/subclass/rtsp_server.rs b/gstreamer-rtsp-server/src/subclass/rtsp_server.rs index 027740f43..6a77b9558 100644 --- a/gstreamer-rtsp-server/src/subclass/rtsp_server.rs +++ b/gstreamer-rtsp-server/src/subclass/rtsp_server.rs @@ -54,6 +54,10 @@ unsafe impl IsSubclassable for RTSPServer { klass.create_client = Some(server_create_client::); klass.client_connected = Some(server_client_connected::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn server_create_client( diff --git a/gstreamer-video/src/subclass/video_decoder.rs b/gstreamer-video/src/subclass/video_decoder.rs index 011b88229..710bc412f 100644 --- a/gstreamer-video/src/subclass/video_decoder.rs +++ b/gstreamer-video/src/subclass/video_decoder.rs @@ -558,6 +558,10 @@ where klass.propose_allocation = Some(video_decoder_propose_allocation::); klass.decide_allocation = Some(video_decoder_decide_allocation::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn video_decoder_open( diff --git a/gstreamer-video/src/subclass/video_encoder.rs b/gstreamer-video/src/subclass/video_encoder.rs index 370b6bdda..7ca3a7c79 100644 --- a/gstreamer-video/src/subclass/video_encoder.rs +++ b/gstreamer-video/src/subclass/video_encoder.rs @@ -490,6 +490,10 @@ where klass.propose_allocation = Some(video_encoder_propose_allocation::); klass.decide_allocation = Some(video_encoder_decide_allocation::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn video_encoder_open( diff --git a/gstreamer-video/src/subclass/video_sink.rs b/gstreamer-video/src/subclass/video_sink.rs index ea14786f6..970a89e75 100644 --- a/gstreamer-video/src/subclass/video_sink.rs +++ b/gstreamer-video/src/subclass/video_sink.rs @@ -59,6 +59,10 @@ where let klass = klass.as_mut(); klass.show_frame = Some(video_sink_show_frame::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn video_sink_show_frame( diff --git a/gstreamer/src/subclass/bin.rs b/gstreamer/src/subclass/bin.rs index 2b8b51b10..452914b31 100644 --- a/gstreamer/src/subclass/bin.rs +++ b/gstreamer/src/subclass/bin.rs @@ -109,6 +109,10 @@ where klass.remove_element = Some(bin_remove_element::); klass.handle_message = Some(bin_handle_message::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn bin_add_element( diff --git a/gstreamer/src/subclass/child_proxy.rs b/gstreamer/src/subclass/child_proxy.rs index 22381dfb4..94bcba82c 100644 --- a/gstreamer/src/subclass/child_proxy.rs +++ b/gstreamer/src/subclass/child_proxy.rs @@ -42,6 +42,8 @@ unsafe impl IsImplementable for ChildProxy { iface.child_added = Some(child_proxy_child_added::); iface.child_removed = Some(child_proxy_child_removed::); } + + fn instance_init(_instance: &mut glib::subclass::InitializingObject) {} } unsafe extern "C" fn child_proxy_get_child_by_name( diff --git a/gstreamer/src/subclass/clock.rs b/gstreamer/src/subclass/clock.rs index a2736728d..0897689dd 100644 --- a/gstreamer/src/subclass/clock.rs +++ b/gstreamer/src/subclass/clock.rs @@ -241,6 +241,10 @@ unsafe impl IsSubclassable for Clock { klass.wait_async = Some(clock_wait_async::); klass.unschedule = Some(clock_unschedule::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn clock_change_resolution( diff --git a/gstreamer/src/subclass/device.rs b/gstreamer/src/subclass/device.rs index 25f8e96b0..62e2769cc 100644 --- a/gstreamer/src/subclass/device.rs +++ b/gstreamer/src/subclass/device.rs @@ -106,6 +106,10 @@ unsafe impl IsSubclassable for Device { klass.create_element = Some(device_create_element::); klass.reconfigure_element = Some(device_reconfigure_element::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn device_create_element( diff --git a/gstreamer/src/subclass/device_provider.rs b/gstreamer/src/subclass/device_provider.rs index 8dcda87db..01b6a8961 100644 --- a/gstreamer/src/subclass/device_provider.rs +++ b/gstreamer/src/subclass/device_provider.rs @@ -119,6 +119,10 @@ unsafe impl IsSubclassable for DeviceProvider { } } } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn device_provider_probe( diff --git a/gstreamer/src/subclass/element.rs b/gstreamer/src/subclass/element.rs index 22534a2bb..9a7ba8145 100644 --- a/gstreamer/src/subclass/element.rs +++ b/gstreamer/src/subclass/element.rs @@ -393,6 +393,10 @@ where } } } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn element_change_state( diff --git a/gstreamer/src/subclass/ghost_pad.rs b/gstreamer/src/subclass/ghost_pad.rs index c13c4e82b..6a8bdcd51 100644 --- a/gstreamer/src/subclass/ghost_pad.rs +++ b/gstreamer/src/subclass/ghost_pad.rs @@ -13,4 +13,8 @@ unsafe impl IsSubclassable for GhostPad { let _klass = klass.as_mut(); // Nothing to do here } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } diff --git a/gstreamer/src/subclass/pad.rs b/gstreamer/src/subclass/pad.rs index 2602653fd..73d9b0411 100644 --- a/gstreamer/src/subclass/pad.rs +++ b/gstreamer/src/subclass/pad.rs @@ -65,6 +65,10 @@ unsafe impl IsSubclassable for Pad { klass.linked = Some(pad_linked::); klass.unlinked = Some(pad_unlinked::); } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } unsafe extern "C" fn pad_linked(ptr: *mut ffi::GstPad, peer: *mut ffi::GstPad) { diff --git a/gstreamer/src/subclass/pipeline.rs b/gstreamer/src/subclass/pipeline.rs index ce8428384..7b5cedff3 100644 --- a/gstreamer/src/subclass/pipeline.rs +++ b/gstreamer/src/subclass/pipeline.rs @@ -16,4 +16,8 @@ where let _klass = klass.as_mut(); // Nothing to do here } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } diff --git a/gstreamer/src/subclass/preset.rs b/gstreamer/src/subclass/preset.rs index bdd2383c5..9b99c8d0d 100644 --- a/gstreamer/src/subclass/preset.rs +++ b/gstreamer/src/subclass/preset.rs @@ -8,4 +8,6 @@ pub trait PresetImpl: super::element::ElementImpl {} unsafe impl IsImplementable for Preset { fn interface_init(_iface: &mut glib::Class) {} + + fn instance_init(_instance: &mut glib::subclass::InitializingObject) {} } diff --git a/gstreamer/src/subclass/system_clock.rs b/gstreamer/src/subclass/system_clock.rs index b18d029ba..69d25c4a1 100644 --- a/gstreamer/src/subclass/system_clock.rs +++ b/gstreamer/src/subclass/system_clock.rs @@ -13,4 +13,8 @@ unsafe impl IsSubclassable for SystemClock { let _klass = klass.as_mut(); // Nothing to do here } + + fn instance_init(instance: &mut glib::subclass::InitializingObject) { + >::instance_init(instance); + } } diff --git a/gstreamer/src/subclass/tag_setter.rs b/gstreamer/src/subclass/tag_setter.rs index af735ba6f..ac944a07a 100644 --- a/gstreamer/src/subclass/tag_setter.rs +++ b/gstreamer/src/subclass/tag_setter.rs @@ -8,4 +8,5 @@ pub trait TagSetterImpl: super::element::ElementImpl {} unsafe impl IsImplementable for TagSetter { fn interface_init(_iface: &mut glib::Class) {} + fn instance_init(_instance: &mut glib::subclass::InitializingObject) {} } diff --git a/gstreamer/src/subclass/uri_handler.rs b/gstreamer/src/subclass/uri_handler.rs index bf8224116..b464944d9 100644 --- a/gstreamer/src/subclass/uri_handler.rs +++ b/gstreamer/src/subclass/uri_handler.rs @@ -39,6 +39,8 @@ unsafe impl IsImplementable for URIHandler { iface.get_uri = Some(uri_handler_get_uri::); iface.set_uri = Some(uri_handler_set_uri::); } + + fn instance_init(_instance: &mut glib::subclass::InitializingObject) {} } unsafe extern "C" fn uri_handler_get_type(