From 1d59ea91c58c9b7ee7a28052b8966286a6176bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 26 Apr 2021 15:15:53 +0300 Subject: [PATCH] Clean up various imports everywhere --- gstreamer-audio/src/audio_decoder.rs | 2 +- gstreamer-audio/src/audio_encoder.rs | 2 +- gstreamer-base/src/aggregator.rs | 3 --- gstreamer-base/src/aggregator_pad.rs | 2 +- gstreamer-base/src/base_parse.rs | 2 +- gstreamer-base/src/base_sink.rs | 2 +- gstreamer-base/src/base_src.rs | 2 +- gstreamer-base/src/base_transform.rs | 2 +- gstreamer-base/src/flow_combiner.rs | 2 +- gstreamer-base/src/functions.rs | 2 +- gstreamer-check/src/harness.rs | 2 +- gstreamer-editing-services/src/timeline_element.rs | 2 +- gstreamer-gl/src/context.rs | 2 +- gstreamer-gl/src/gl_base_memory.rs | 2 +- gstreamer-gl/src/gl_context.rs | 2 +- gstreamer-net/src/net_address_meta.rs | 3 +-- gstreamer-net/src/net_client_clock.rs | 2 +- gstreamer-net/src/net_time_provider.rs | 2 +- gstreamer-net/src/ntp_clock.rs | 2 +- gstreamer-net/src/ptp_clock.rs | 2 +- gstreamer-pbutils/src/discoverer.rs | 3 +-- gstreamer-pbutils/src/encoding_profile.rs | 2 +- .../src/player_video_overlay_video_renderer.rs | 2 +- .../src/subclass/player_video_renderer.rs | 2 +- gstreamer-rtsp-server/src/rtsp_address_pool.rs | 2 +- gstreamer-rtsp-server/src/rtsp_auth.rs | 3 +-- gstreamer-rtsp-server/src/rtsp_client.rs | 2 +- gstreamer-rtsp-server/src/rtsp_media.rs | 2 +- gstreamer-rtsp-server/src/rtsp_media_factory.rs | 2 +- gstreamer-rtsp-server/src/rtsp_server.rs | 2 +- gstreamer-rtsp-server/src/rtsp_session_pool.rs | 2 +- gstreamer-rtsp-server/src/rtsp_stream.rs | 2 +- gstreamer-rtsp-server/src/rtsp_stream_transport.rs | 2 +- gstreamer-video/src/video_decoder.rs | 2 +- gstreamer-video/src/video_encoder.rs | 2 +- gstreamer-video/src/video_overlay.rs | 4 ++-- gstreamer-webrtc/src/auto/web_rtc_data_channel.rs | 5 +---- gstreamer/src/bin.rs | 3 +-- gstreamer/src/buffer_pool.rs | 2 +- gstreamer/src/child_proxy.rs | 2 +- gstreamer/src/clock.rs | 3 --- gstreamer/src/control_binding.rs | 2 +- gstreamer/src/control_source.rs | 2 +- gstreamer/src/device_monitor.rs | 2 +- gstreamer/src/device_provider.rs | 5 ++--- gstreamer/src/element.rs | 13 +++---------- gstreamer/src/error.rs | 2 +- gstreamer/src/functions.rs | 2 +- gstreamer/src/gobject.rs | 2 +- gstreamer/src/log.rs | 2 +- gstreamer/src/message.rs | 4 +--- gstreamer/src/object.rs | 3 +-- gstreamer/src/pad.rs | 5 +---- gstreamer/src/pipeline.rs | 2 +- gstreamer/src/plugin.rs | 2 +- gstreamer/src/plugin_feature.rs | 3 +-- gstreamer/src/proxy_pad.rs | 2 +- gstreamer/src/tag_setter.rs | 3 +-- 58 files changed, 60 insertions(+), 89 deletions(-) diff --git a/gstreamer-audio/src/audio_decoder.rs b/gstreamer-audio/src/audio_decoder.rs index 5385e8e09..3ad792e01 100644 --- a/gstreamer-audio/src/audio_decoder.rs +++ b/gstreamer-audio/src/audio_decoder.rs @@ -2,7 +2,7 @@ use crate::AudioDecoder; use crate::AudioInfo; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::mem; use std::ptr; diff --git a/gstreamer-audio/src/audio_encoder.rs b/gstreamer-audio/src/audio_encoder.rs index 7166446b2..9aedc3cbc 100644 --- a/gstreamer-audio/src/audio_encoder.rs +++ b/gstreamer-audio/src/audio_encoder.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::AudioEncoder; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::mem; use std::ptr; diff --git a/gstreamer-base/src/aggregator.rs b/gstreamer-base/src/aggregator.rs index 8a7772312..b8f56da74 100644 --- a/gstreamer-base/src/aggregator.rs +++ b/gstreamer-base/src/aggregator.rs @@ -1,14 +1,11 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::Aggregator; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] use glib::prelude::*; #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] use glib::signal::{connect_raw, SignalHandlerId}; use glib::translate::*; -use glib::IsA; #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] use glib::Value; diff --git a/gstreamer-base/src/aggregator_pad.rs b/gstreamer-base/src/aggregator_pad.rs index 54a56785e..17ed81789 100644 --- a/gstreamer-base/src/aggregator_pad.rs +++ b/gstreamer-base/src/aggregator_pad.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::AggregatorPad; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; pub trait AggregatorPadExtManual: 'static { diff --git a/gstreamer-base/src/base_parse.rs b/gstreamer-base/src/base_parse.rs index 34502d4f0..d8971a9fa 100644 --- a/gstreamer-base/src/base_parse.rs +++ b/gstreamer-base/src/base_parse.rs @@ -2,7 +2,7 @@ use crate::BaseParse; use crate::BaseParseFrame; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use gst::FormattedValue; use std::convert::TryFrom; diff --git a/gstreamer-base/src/base_sink.rs b/gstreamer-base/src/base_sink.rs index 5a404b872..5946de8b1 100644 --- a/gstreamer-base/src/base_sink.rs +++ b/gstreamer-base/src/base_sink.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::BaseSink; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::mem; diff --git a/gstreamer-base/src/base_src.rs b/gstreamer-base/src/base_src.rs index 15266ef34..4c1fb5083 100644 --- a/gstreamer-base/src/base_src.rs +++ b/gstreamer-base/src/base_src.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::mem; use std::ptr; diff --git a/gstreamer-base/src/base_transform.rs b/gstreamer-base/src/base_transform.rs index f82d27939..a698dbb87 100644 --- a/gstreamer-base/src/base_transform.rs +++ b/gstreamer-base/src/base_transform.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::BaseTransform; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::mem; use std::ptr; diff --git a/gstreamer-base/src/flow_combiner.rs b/gstreamer-base/src/flow_combiner.rs index 9727ce8f0..8b5a5b2ac 100644 --- a/gstreamer-base/src/flow_combiner.rs +++ b/gstreamer-base/src/flow_combiner.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; glib::wrapper! { diff --git a/gstreamer-base/src/functions.rs b/gstreamer-base/src/functions.rs index 638ef3b46..7baa9d597 100644 --- a/gstreamer-base/src/functions.rs +++ b/gstreamer-base/src/functions.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::mem; diff --git a/gstreamer-check/src/harness.rs b/gstreamer-check/src/harness.rs index 5ff000c21..59142e052 100644 --- a/gstreamer-check/src/harness.rs +++ b/gstreamer-check/src/harness.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::TestClock; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use gst::prelude::*; use std::marker::PhantomData; diff --git a/gstreamer-editing-services/src/timeline_element.rs b/gstreamer-editing-services/src/timeline_element.rs index 31343c4f8..6bf3624d8 100644 --- a/gstreamer-editing-services/src/timeline_element.rs +++ b/gstreamer-editing-services/src/timeline_element.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::TimelineElement; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::ptr; diff --git a/gstreamer-gl/src/context.rs b/gstreamer-gl/src/context.rs index 2278a8e8e..a25e43b34 100644 --- a/gstreamer-gl/src/context.rs +++ b/gstreamer-gl/src/context.rs @@ -1,8 +1,8 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::GLDisplay; +use glib::prelude::*; use glib::translate::*; -use glib::IsA; use gst::ContextRef; use std::ptr; diff --git a/gstreamer-gl/src/gl_base_memory.rs b/gstreamer-gl/src/gl_base_memory.rs index b6fa91c10..716017913 100644 --- a/gstreamer-gl/src/gl_base_memory.rs +++ b/gstreamer-gl/src/gl_base_memory.rs @@ -1,4 +1,4 @@ -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use crate::GLAllocationParams; diff --git a/gstreamer-gl/src/gl_context.rs b/gstreamer-gl/src/gl_context.rs index 8ded7e8a9..58d9e71b0 100644 --- a/gstreamer-gl/src/gl_context.rs +++ b/gstreamer-gl/src/gl_context.rs @@ -4,8 +4,8 @@ use crate::GLContext; use crate::GLDisplay; use crate::GLPlatform; use crate::GLAPI; +use glib::prelude::*; use glib::translate::*; -use glib::IsA; use libc::uintptr_t; impl GLContext { diff --git a/gstreamer-net/src/net_address_meta.rs b/gstreamer-net/src/net_address_meta.rs index f4a7be1e4..c44bf3e29 100644 --- a/gstreamer-net/src/net_address_meta.rs +++ b/gstreamer-net/src/net_address_meta.rs @@ -58,8 +58,7 @@ impl fmt::Debug for NetAddressMeta { #[cfg(test)] mod tests { use super::*; - use gio::InetAddressExt; - use gio::InetSocketAddressExt; + use gio::prelude::*; #[test] fn test_add_get_meta() { diff --git a/gstreamer-net/src/net_client_clock.rs b/gstreamer-net/src/net_client_clock.rs index c05e564b3..22468ed10 100644 --- a/gstreamer-net/src/net_client_clock.rs +++ b/gstreamer-net/src/net_client_clock.rs @@ -2,7 +2,7 @@ use crate::NetClientClock; -use glib::object::Cast; +use glib::prelude::*; use glib::translate::*; impl NetClientClock { diff --git a/gstreamer-net/src/net_time_provider.rs b/gstreamer-net/src/net_time_provider.rs index 70106565e..8035b11ad 100644 --- a/gstreamer-net/src/net_time_provider.rs +++ b/gstreamer-net/src/net_time_provider.rs @@ -2,8 +2,8 @@ use crate::NetTimeProvider; +use glib::prelude::*; use glib::translate::*; -use glib::IsA; impl NetTimeProvider { pub fn new>(clock: &P, address: Option<&str>, port: i32) -> NetTimeProvider { diff --git a/gstreamer-net/src/ntp_clock.rs b/gstreamer-net/src/ntp_clock.rs index fc9a014f2..6d66c1eaf 100644 --- a/gstreamer-net/src/ntp_clock.rs +++ b/gstreamer-net/src/ntp_clock.rs @@ -2,7 +2,7 @@ use crate::NtpClock; -use glib::object::Cast; +use glib::prelude::*; use glib::translate::*; impl NtpClock { diff --git a/gstreamer-net/src/ptp_clock.rs b/gstreamer-net/src/ptp_clock.rs index c0fa7951d..85a800960 100644 --- a/gstreamer-net/src/ptp_clock.rs +++ b/gstreamer-net/src/ptp_clock.rs @@ -2,7 +2,7 @@ use crate::PtpClock; -use glib::object::Cast; +use glib::prelude::*; use glib::translate::*; impl PtpClock { diff --git a/gstreamer-pbutils/src/discoverer.rs b/gstreamer-pbutils/src/discoverer.rs index 08be0c006..3071428ea 100644 --- a/gstreamer-pbutils/src/discoverer.rs +++ b/gstreamer-pbutils/src/discoverer.rs @@ -2,11 +2,10 @@ use crate::auto::Discoverer; -use glib::object::{Cast, ObjectType}; +use glib::prelude::*; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; -use glib::IsA; use glib::Value; use std::boxed::Box as Box_; diff --git a/gstreamer-pbutils/src/encoding_profile.rs b/gstreamer-pbutils/src/encoding_profile.rs index bfbf59125..d6f99b0c5 100644 --- a/gstreamer-pbutils/src/encoding_profile.rs +++ b/gstreamer-pbutils/src/encoding_profile.rs @@ -2,7 +2,7 @@ use thiserror::Error; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use crate::auto::EncodingAudioProfile; diff --git a/gstreamer-player/src/player_video_overlay_video_renderer.rs b/gstreamer-player/src/player_video_overlay_video_renderer.rs index 7e0a845de..d84096087 100644 --- a/gstreamer-player/src/player_video_overlay_video_renderer.rs +++ b/gstreamer-player/src/player_video_overlay_video_renderer.rs @@ -1,8 +1,8 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::PlayerVideoOverlayVideoRenderer; +use glib::prelude::*; use glib::translate::*; -use glib::IsA; use std::ptr; diff --git a/gstreamer-player/src/subclass/player_video_renderer.rs b/gstreamer-player/src/subclass/player_video_renderer.rs index 47f8af835..4c74325ef 100644 --- a/gstreamer-player/src/subclass/player_video_renderer.rs +++ b/gstreamer-player/src/subclass/player_video_renderer.rs @@ -2,9 +2,9 @@ use crate::{Player, PlayerVideoRenderer}; +use glib::prelude::*; use glib::subclass::prelude::*; use glib::translate::*; -use glib::Cast; pub trait PlayerVideoRendererImpl: ObjectImpl { fn create_video_sink(&self, video_renderer: &Self::Type, player: &Player) -> gst::Element; diff --git a/gstreamer-rtsp-server/src/rtsp_address_pool.rs b/gstreamer-rtsp-server/src/rtsp_address_pool.rs index 29d17c3b4..59dbc1fb7 100644 --- a/gstreamer-rtsp-server/src/rtsp_address_pool.rs +++ b/gstreamer-rtsp-server/src/rtsp_address_pool.rs @@ -3,7 +3,7 @@ use crate::RTSPAddress; use crate::RTSPAddressPool; use crate::RTSPAddressPoolResult; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::ptr; diff --git a/gstreamer-rtsp-server/src/rtsp_auth.rs b/gstreamer-rtsp-server/src/rtsp_auth.rs index 48810f6ee..cc9c0a9c2 100644 --- a/gstreamer-rtsp-server/src/rtsp_auth.rs +++ b/gstreamer-rtsp-server/src/rtsp_auth.rs @@ -1,7 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::object::Cast; -use glib::object::IsA; +use glib::prelude::*; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; diff --git a/gstreamer-rtsp-server/src/rtsp_client.rs b/gstreamer-rtsp-server/src/rtsp_client.rs index 916a9c43c..ec0f3466a 100644 --- a/gstreamer-rtsp-server/src/rtsp_client.rs +++ b/gstreamer-rtsp-server/src/rtsp_client.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::RTSPClient; -use glib::object::IsA; +use glib::prelude::*; use glib::source::SourceId; use glib::translate::*; diff --git a/gstreamer-rtsp-server/src/rtsp_media.rs b/gstreamer-rtsp-server/src/rtsp_media.rs index b161ab222..69dd2b67f 100644 --- a/gstreamer-rtsp-server/src/rtsp_media.rs +++ b/gstreamer-rtsp-server/src/rtsp_media.rs @@ -1,6 +1,6 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use crate::RTSPMedia; diff --git a/gstreamer-rtsp-server/src/rtsp_media_factory.rs b/gstreamer-rtsp-server/src/rtsp_media_factory.rs index 82bd6f38d..b423c7585 100644 --- a/gstreamer-rtsp-server/src/rtsp_media_factory.rs +++ b/gstreamer-rtsp-server/src/rtsp_media_factory.rs @@ -2,10 +2,10 @@ use crate::RTSPMediaFactory; +use glib::prelude::*; #[cfg(any(feature = "v1_14", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] use glib::translate::*; -use glib::IsA; pub trait RTSPMediaFactoryExtManual: 'static { #[cfg(any(feature = "v1_14", feature = "dox"))] diff --git a/gstreamer-rtsp-server/src/rtsp_server.rs b/gstreamer-rtsp-server/src/rtsp_server.rs index 153539457..4ee8bac05 100644 --- a/gstreamer-rtsp-server/src/rtsp_server.rs +++ b/gstreamer-rtsp-server/src/rtsp_server.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::RTSPServer; -use glib::object::IsA; +use glib::prelude::*; use glib::source::SourceId; use glib::translate::*; diff --git a/gstreamer-rtsp-server/src/rtsp_session_pool.rs b/gstreamer-rtsp-server/src/rtsp_session_pool.rs index f240171ec..d25da6df5 100644 --- a/gstreamer-rtsp-server/src/rtsp_session_pool.rs +++ b/gstreamer-rtsp-server/src/rtsp_session_pool.rs @@ -2,7 +2,7 @@ use crate::RTSPSessionPool; use glib::ffi::{gboolean, gpointer}; -use glib::object::IsA; +use glib::prelude::*; use glib::source::{Continue, Priority}; use glib::translate::*; use std::cell::RefCell; diff --git a/gstreamer-rtsp-server/src/rtsp_stream.rs b/gstreamer-rtsp-server/src/rtsp_stream.rs index edb3a8313..bf98f4b13 100644 --- a/gstreamer-rtsp-server/src/rtsp_stream.rs +++ b/gstreamer-rtsp-server/src/rtsp_stream.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::RTSPStream; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; pub trait RTSPStreamExtManual: 'static { diff --git a/gstreamer-rtsp-server/src/rtsp_stream_transport.rs b/gstreamer-rtsp-server/src/rtsp_stream_transport.rs index df84d577d..7fd437309 100644 --- a/gstreamer-rtsp-server/src/rtsp_stream_transport.rs +++ b/gstreamer-rtsp-server/src/rtsp_stream_transport.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::RTSPStreamTransport; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; pub trait RTSPStreamTransportExtManual: 'static { diff --git a/gstreamer-video/src/video_decoder.rs b/gstreamer-video/src/video_decoder.rs index 4cc0189f7..aa9f5a35d 100644 --- a/gstreamer-video/src/video_decoder.rs +++ b/gstreamer-video/src/video_decoder.rs @@ -8,7 +8,7 @@ use crate::VideoFormat; #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] use crate::VideoInterlaceMode; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::mem; use std::ptr; diff --git a/gstreamer-video/src/video_encoder.rs b/gstreamer-video/src/video_encoder.rs index 070f5b42b..40c7b48c4 100644 --- a/gstreamer-video/src/video_encoder.rs +++ b/gstreamer-video/src/video_encoder.rs @@ -4,7 +4,7 @@ use crate::utils::HasStreamLock; use crate::video_codec_state::{InNegotiation, Readable, VideoCodecState, VideoCodecStateContext}; use crate::VideoCodecFrame; use crate::VideoEncoder; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::mem; use std::ptr; diff --git a/gstreamer-video/src/video_overlay.rs b/gstreamer-video/src/video_overlay.rs index dabd89be1..2024ba5a5 100644 --- a/gstreamer-video/src/video_overlay.rs +++ b/gstreamer-video/src/video_overlay.rs @@ -1,10 +1,10 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::VideoOverlay; -use glib::translate::*; use libc::uintptr_t; -use glib::IsA; +use glib::prelude::*; +use glib::translate::*; pub trait VideoOverlayExtManual: 'static { unsafe fn set_window_handle(&self, handle: uintptr_t); diff --git a/gstreamer-webrtc/src/auto/web_rtc_data_channel.rs b/gstreamer-webrtc/src/auto/web_rtc_data_channel.rs index e8216cd6b..a75748861 100644 --- a/gstreamer-webrtc/src/auto/web_rtc_data_channel.rs +++ b/gstreamer-webrtc/src/auto/web_rtc_data_channel.rs @@ -5,13 +5,10 @@ use crate::WebRTCDataChannelState; use crate::WebRTCPriorityType; -use glib::object::ObjectExt; -use glib::object::ObjectType as ObjectType_; +use glib::prelude::*; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; -use glib::StaticType; -use glib::ToValue; use std::boxed::Box as Box_; use std::mem::transmute; diff --git a/gstreamer/src/bin.rs b/gstreamer/src/bin.rs index eaa36b439..4770b1757 100644 --- a/gstreamer/src/bin.rs +++ b/gstreamer/src/bin.rs @@ -5,8 +5,7 @@ use crate::BinFlags; use crate::Element; use crate::LoggableError; -use glib::object::Cast; -use glib::object::IsA; +use glib::prelude::*; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; diff --git a/gstreamer/src/buffer_pool.rs b/gstreamer/src/buffer_pool.rs index b760c4258..0770a913b 100644 --- a/gstreamer/src/buffer_pool.rs +++ b/gstreamer/src/buffer_pool.rs @@ -5,8 +5,8 @@ use crate::Allocator; use crate::BufferPool; use crate::Structure; +use glib::prelude::*; use glib::translate::{from_glib, from_glib_full, from_glib_none, ToGlib, ToGlibPtr, ToGlibPtrMut}; -use glib::IsA; use std::mem; use std::ops; diff --git a/gstreamer/src/child_proxy.rs b/gstreamer/src/child_proxy.rs index eba1dd58c..03af452de 100644 --- a/gstreamer/src/child_proxy.rs +++ b/gstreamer/src/child_proxy.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::ChildProxy; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::ptr; diff --git a/gstreamer/src/clock.rs b/gstreamer/src/clock.rs index 190fe16dd..2d8c10afb 100644 --- a/gstreamer/src/clock.rs +++ b/gstreamer/src/clock.rs @@ -9,11 +9,8 @@ use crate::ClockSuccess; use crate::ClockTime; use crate::ClockTimeDiff; use glib::ffi::{gboolean, gpointer}; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] use glib::prelude::*; use glib::translate::*; -use glib::IsA; use libc::c_void; use std::cmp; use std::convert; diff --git a/gstreamer/src/control_binding.rs b/gstreamer/src/control_binding.rs index 66b690689..c5d200b90 100644 --- a/gstreamer/src/control_binding.rs +++ b/gstreamer/src/control_binding.rs @@ -2,7 +2,7 @@ use crate::ClockTime; use crate::ControlBinding; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; pub trait ControlBindingExtManual: 'static { diff --git a/gstreamer/src/control_source.rs b/gstreamer/src/control_source.rs index 2466f1ad4..51b20926c 100644 --- a/gstreamer/src/control_source.rs +++ b/gstreamer/src/control_source.rs @@ -2,7 +2,7 @@ use crate::ClockTime; use crate::ControlSource; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; pub trait ControlSourceExtManual: 'static { diff --git a/gstreamer/src/device_monitor.rs b/gstreamer/src/device_monitor.rs index c72685ff5..27c08bd09 100644 --- a/gstreamer/src/device_monitor.rs +++ b/gstreamer/src/device_monitor.rs @@ -3,7 +3,7 @@ use crate::Caps; use crate::DeviceMonitor; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; use std::num::NonZeroU32; diff --git a/gstreamer/src/device_provider.rs b/gstreamer/src/device_provider.rs index 850359530..70b04d691 100644 --- a/gstreamer/src/device_provider.rs +++ b/gstreamer/src/device_provider.rs @@ -4,9 +4,8 @@ use crate::DeviceProvider; use crate::Plugin; use crate::Rank; -use glib::object::IsA; -use glib::translate::ToGlib; -use glib::translate::ToGlibPtr; +use glib::prelude::*; +use glib::translate::*; use std::ffi::CStr; diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index 9b938334b..0c37a553f 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -22,16 +22,9 @@ use crate::StateChange; use crate::StateChangeError; use crate::StateChangeReturn; use crate::StateChangeSuccess; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -use glib::object::Cast; -use glib::object::IsA; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] -use glib::translate::FromGlibPtrBorrow; -use glib::translate::{ - from_glib, from_glib_full, from_glib_none, FromGlib, FromGlibPtrContainer, ToGlib, ToGlibPtr, -}; + +use glib::prelude::*; +use glib::translate::*; use std::ffi::CStr; #[cfg(any(feature = "v1_10", feature = "dox"))] diff --git a/gstreamer/src/error.rs b/gstreamer/src/error.rs index d8dad754c..91928149d 100644 --- a/gstreamer/src/error.rs +++ b/gstreamer/src/error.rs @@ -2,7 +2,7 @@ use thiserror::Error; -use glib::IsA; +use glib::prelude::*; #[macro_export] macro_rules! error_msg( diff --git a/gstreamer/src/functions.rs b/gstreamer/src/functions.rs index 3f94e18c2..386a550e1 100644 --- a/gstreamer/src/functions.rs +++ b/gstreamer/src/functions.rs @@ -1,8 +1,8 @@ // Take a look at the license at the top of the repository in the LICENSE file. use crate::auto::functions::parse_bin_from_description; +use glib::prelude::*; use glib::translate::*; -use glib::Cast; use std::ptr; use crate::Bin; diff --git a/gstreamer/src/gobject.rs b/gstreamer/src/gobject.rs index b15f3b566..4c4682364 100644 --- a/gstreamer/src/gobject.rs +++ b/gstreamer/src/gobject.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. +use glib::prelude::*; use glib::translate::ToGlibPtr; -use glib::IsA; pub trait GObjectExtManualGst: 'static { fn set_property_from_str(&self, name: &str, value: &str); diff --git a/gstreamer/src/log.rs b/gstreamer/src/log.rs index ae350a1e6..9d511d4aa 100644 --- a/gstreamer/src/log.rs +++ b/gstreamer/src/log.rs @@ -11,8 +11,8 @@ use std::ptr; use once_cell::sync::Lazy; use glib::ffi::gpointer; +use glib::prelude::*; use glib::translate::*; -use glib::IsA; #[derive(PartialEq, Eq)] pub struct DebugMessage(ptr::NonNull); diff --git a/gstreamer/src/message.rs b/gstreamer/src/message.rs index 2fc978aab..e400b527d 100644 --- a/gstreamer/src/message.rs +++ b/gstreamer/src/message.rs @@ -16,10 +16,8 @@ use std::num::NonZeroU32; use std::ops::Deref; use std::ptr; +use glib::prelude::*; use glib::translate::{from_glib, from_glib_full, from_glib_none, mut_override, ToGlib, ToGlibPtr}; -use glib::value::ToSendValue; -use glib::Cast; -use glib::IsA; mini_object_wrapper!(Message, MessageRef, ffi::GstMessage, || { ffi::gst_message_get_type() diff --git a/gstreamer/src/object.rs b/gstreamer/src/object.rs index cb2a928a3..6ee84bd4f 100644 --- a/gstreamer/src/object.rs +++ b/gstreamer/src/object.rs @@ -1,9 +1,8 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use glib::object::{Cast, ObjectExt}; +use glib::prelude::*; use glib::signal::SignalHandlerId; use glib::translate::*; -use glib::IsA; use crate::ClockTime; use crate::ObjectFlags; diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 5c759fd03..19e432ad6 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -29,11 +29,10 @@ use std::num::NonZeroU64; use std::ptr; use glib::ffi::gpointer; -use glib::object::{Cast, IsA}; +use glib::prelude::*; use glib::translate::{ from_glib, from_glib_borrow, from_glib_full, FromGlib, FromGlibPtrBorrow, ToGlib, ToGlibPtr, }; -use glib::StaticType; #[derive(Debug, PartialEq, Eq)] pub struct PadProbeId(NonZeroU64); @@ -1653,8 +1652,6 @@ impl + IsA + glib::object::IsClass> PadBuilder { pub fn from_template(templ: &crate::PadTemplate, name: Option<&str>) -> Self { assert_initialized_main_thread!(); - use glib::ObjectExt; - let mut type_ = T::static_type(); // Since 1.14 templates can keep a pad GType with them, so we need to do some diff --git a/gstreamer/src/pipeline.rs b/gstreamer/src/pipeline.rs index 376b55fb7..b6398a22e 100644 --- a/gstreamer/src/pipeline.rs +++ b/gstreamer/src/pipeline.rs @@ -1,7 +1,7 @@ // Take a look at the license at the top of the repository in the LICENSE file. +use glib::prelude::*; use glib::translate::*; -use glib::IsA; use crate::PipelineFlags; diff --git a/gstreamer/src/plugin.rs b/gstreamer/src/plugin.rs index 1c5fbb590..4b19b2c07 100644 --- a/gstreamer/src/plugin.rs +++ b/gstreamer/src/plugin.rs @@ -5,8 +5,8 @@ use crate::PluginFlags; use crate::Structure; use crate::StructureRef; +use glib::prelude::*; use glib::translate::*; -use glib::IsA; impl Plugin { pub fn cache_data(&self) -> Option<&StructureRef> { diff --git a/gstreamer/src/plugin_feature.rs b/gstreamer/src/plugin_feature.rs index 17530fe5d..f85a61f8b 100644 --- a/gstreamer/src/plugin_feature.rs +++ b/gstreamer/src/plugin_feature.rs @@ -3,7 +3,7 @@ use crate::PluginFeature; use crate::Rank; -use glib::object::{Cast, IsA}; +use glib::prelude::*; use glib::translate::{from_glib, FromGlibPtrFull, ToGlib, ToGlibPtr}; pub trait PluginFeatureExtManual: Sized + 'static { @@ -40,7 +40,6 @@ impl> PluginFeatureExtManual for O { #[cfg(test)] mod tests { use super::*; - use crate::prelude::*; #[test] fn test_load() { diff --git a/gstreamer/src/proxy_pad.rs b/gstreamer/src/proxy_pad.rs index 5c47c9ab4..84bf193dc 100644 --- a/gstreamer/src/proxy_pad.rs +++ b/gstreamer/src/proxy_pad.rs @@ -10,7 +10,7 @@ use crate::Pad; use crate::ProxyPad; use std::ptr; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::{from_glib, from_glib_full, ToGlibPtr}; pub trait ProxyPadExtManual: 'static { diff --git a/gstreamer/src/tag_setter.rs b/gstreamer/src/tag_setter.rs index c221fd4c3..66afdc089 100644 --- a/gstreamer/src/tag_setter.rs +++ b/gstreamer/src/tag_setter.rs @@ -3,9 +3,8 @@ use crate::tags::*; use crate::TagMergeMode; use crate::TagSetter; -use glib::object::IsA; +use glib::prelude::*; use glib::translate::*; -use glib::ToSendValue; pub trait TagSetterExtManual: 'static { fn add<'a, T: Tag<'a>>(&self, value: &T::TagType, mode: TagMergeMode);