forked from mirrors/gstreamer-rs
Adapt to no longer re-exported traits
Some of the traits were moved to prelude or translate and no longer in the main scope of the crate Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1382>
This commit is contained in:
parent
cfc1aed3c3
commit
aaea288abf
57 changed files with 97 additions and 94 deletions
|
@ -51,7 +51,7 @@ impl<T: IirFilterImpl> IirFilterImplExt for T {}
|
|||
/// Class struct for `IirFilter`.
|
||||
#[repr(C)]
|
||||
pub struct Class {
|
||||
parent: <<imp::IirFilter as ObjectSubclass>::ParentType as glib::ObjectType>::GlibClassType,
|
||||
parent: <<imp::IirFilter as ObjectSubclass>::ParentType as ObjectType>::GlibClassType,
|
||||
|
||||
set_rate: fn(&IirFilter, rate: u32),
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::{
|
|||
os::unix::prelude::{IntoRawFd, RawFd},
|
||||
};
|
||||
|
||||
use glib::{translate::*, Cast};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use gst::{Memory, MemoryRef};
|
||||
|
||||
#[cfg(feature = "v1_16")]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::{fmt, mem, os::unix::prelude::IntoRawFd};
|
||||
|
||||
use glib::{translate::*, Cast};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use gst::{Memory, MemoryRef};
|
||||
|
||||
use crate::{DRMDumbAllocator, DmaBufMemory};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::{fmt, os::unix::prelude::RawFd};
|
||||
|
||||
use glib::{translate::*, Cast};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use gst::{Memory, MemoryRef};
|
||||
|
||||
use crate::{FdAllocator, FdMemoryFlags};
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::mem::transmute;
|
|||
use glib::object::Cast;
|
||||
#[cfg(feature = "v1_18")]
|
||||
use glib::signal::{connect_raw, SignalHandlerId};
|
||||
use glib::{object::IsA, translate::*};
|
||||
use glib::translate::*;
|
||||
use gst::prelude::*;
|
||||
|
||||
use crate::auto::{AudioAggregator, AudioAggregatorPad};
|
||||
|
@ -31,14 +31,14 @@ pub trait AudioAggregatorExtManual: sealed::Sealed + IsA<AudioAggregator> + 'sta
|
|||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
||||
#[doc(alias = "output-buffer-duration-fraction")]
|
||||
fn output_buffer_duration_fraction(&self) -> gst::Fraction {
|
||||
glib::ObjectExt::property(self.as_ref(), "output-buffer-duration-fraction")
|
||||
ObjectExt::property(self.as_ref(), "output-buffer-duration-fraction")
|
||||
}
|
||||
|
||||
#[cfg(feature = "v1_18")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
||||
#[doc(alias = "output-buffer-duration-fraction")]
|
||||
fn set_output_buffer_duration_fraction(&self, output_buffer_duration_fraction: gst::Fraction) {
|
||||
glib::ObjectExt::set_property(
|
||||
ObjectExt::set_property(
|
||||
self.as_ref(),
|
||||
"output-buffer-duration-fraction",
|
||||
output_buffer_duration_fraction,
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
use std::mem::transmute;
|
||||
|
||||
use glib::{
|
||||
object::IsA,
|
||||
prelude::*,
|
||||
signal::{connect_raw, SignalHandlerId},
|
||||
translate::*,
|
||||
Cast,
|
||||
};
|
||||
|
||||
use crate::auto::AudioAggregatorConvertPad;
|
||||
|
@ -19,13 +18,13 @@ pub trait AudioAggregatorConvertPadExtManual:
|
|||
{
|
||||
#[doc(alias = "converter-config")]
|
||||
fn converter_config(&self) -> Option<crate::AudioConverterConfig> {
|
||||
glib::ObjectExt::property::<Option<gst::Structure>>(self.as_ref(), "converter-config")
|
||||
ObjectExt::property::<Option<gst::Structure>>(self.as_ref(), "converter-config")
|
||||
.map(|c| c.try_into().unwrap())
|
||||
}
|
||||
|
||||
#[doc(alias = "converter-config")]
|
||||
fn set_converter_config(&self, converter_config: Option<&crate::AudioConverterConfig>) {
|
||||
glib::ObjectExt::set_property(
|
||||
ObjectExt::set_property(
|
||||
self.as_ref(),
|
||||
"converter-config",
|
||||
converter_config.map(|s| s.as_ref()),
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::{mem, slice};
|
||||
|
||||
use glib::{translate::*, value::FromValue, StaticType, ToValue, Type};
|
||||
use glib::{prelude::*, translate::*, value::FromValue, Type};
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
use std::{cmp::Ordering, fmt, marker::PhantomData, str};
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, from_glib_none, FromGlib, IntoGlib, ToGlibPtr, ToGlibPtrMut},
|
||||
StaticType,
|
||||
};
|
||||
|
||||
#[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)]
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
FlagsClass, StaticType, ToValue,
|
||||
FlagsClass,
|
||||
};
|
||||
use gst::bitflags_serde_impl;
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
FlagsClass, StaticType, ToValue,
|
||||
FlagsClass,
|
||||
};
|
||||
use gst::bitflags_serde_impl;
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
FlagsClass, StaticType, ToValue,
|
||||
FlagsClass,
|
||||
};
|
||||
use gst::bitflags_serde_impl;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::object::IsA;
|
||||
use gst::prelude::*;
|
||||
|
||||
use crate::{auto::AudioVisualizer, subclass::AudioVisualizerSetupToken};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::fmt;
|
||||
|
||||
use glib::Cast;
|
||||
use glib::prelude::*;
|
||||
|
||||
use crate::{DiscovererAudioInfo, DiscovererStreamInfo};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::fmt;
|
||||
|
||||
use glib::Cast;
|
||||
use glib::prelude::*;
|
||||
|
||||
use crate::{DiscovererStreamInfo, DiscovererSubtitleInfo};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::fmt;
|
||||
|
||||
use glib::{translate::*, Cast};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
use crate::{DiscovererStreamInfo, DiscovererVideoInfo};
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
FlagsClass, StaticType, ToValue,
|
||||
FlagsClass,
|
||||
};
|
||||
use gst::bitflags_serde_impl;
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
use std::{boxed::Box as Box_, mem::transmute};
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
signal::{connect_raw, SignalHandlerId},
|
||||
translate::*,
|
||||
ObjectType,
|
||||
};
|
||||
|
||||
use crate::PlaySignalAdapter;
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
FlagsClass, StaticType, ToValue,
|
||||
FlagsClass,
|
||||
};
|
||||
use gst::{bitflags_deserialize_impl, bitflags_serde_impl, bitflags_serialize_impl};
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
FlagsClass, StaticType, ToValue,
|
||||
FlagsClass,
|
||||
};
|
||||
use gst::bitflags_serde_impl;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ use std::{
|
|||
ptr::{self, addr_of},
|
||||
};
|
||||
|
||||
use glib::{translate::*, ObjectType};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use gst_rtsp::{rtsp_message::RTSPMessage, RTSPUrl};
|
||||
|
||||
use crate::{RTSPClient, RTSPSession, RTSPToken};
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
FlagsClass, StaticType, ToValue,
|
||||
FlagsClass,
|
||||
};
|
||||
use gst::bitflags_serde_impl;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::{
|
|||
fmt, mem, ops, ptr,
|
||||
};
|
||||
|
||||
use glib::{translate::*, StaticType};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
use crate::{
|
||||
sdp_attribute::SDPAttribute,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::ops::{Bound::*, RangeBounds};
|
||||
|
||||
use glib::IntoGStr;
|
||||
use glib::translate::*;
|
||||
use gst::Caps;
|
||||
|
||||
use crate::VideoFormat;
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
FlagsClass, StaticType, ToValue,
|
||||
FlagsClass,
|
||||
};
|
||||
use gst::bitflags_serde_impl;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use glib::{object::IsA, translate::*};
|
||||
use glib::translate::*;
|
||||
use gst::prelude::*;
|
||||
|
||||
use crate::auto::VideoAggregator;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
use std::mem::transmute;
|
||||
|
||||
use glib::{
|
||||
object::IsA,
|
||||
prelude::*,
|
||||
signal::{connect_raw, SignalHandlerId},
|
||||
translate::*,
|
||||
Cast,
|
||||
};
|
||||
|
||||
use crate::auto::VideoAggregatorConvertPad;
|
||||
|
@ -19,13 +18,13 @@ pub trait VideoAggregatorConvertPadExtManual:
|
|||
{
|
||||
#[doc(alias = "converter-config")]
|
||||
fn converter_config(&self) -> Option<crate::VideoConverterConfig> {
|
||||
glib::ObjectExt::property::<Option<gst::Structure>>(self.as_ref(), "converter-config")
|
||||
ObjectExt::property::<Option<gst::Structure>>(self.as_ref(), "converter-config")
|
||||
.map(|c| c.try_into().unwrap())
|
||||
}
|
||||
|
||||
#[doc(alias = "converter-config")]
|
||||
fn set_converter_config(&self, converter_config: Option<&crate::VideoConverterConfig>) {
|
||||
glib::ObjectExt::set_property(
|
||||
ObjectExt::set_property(
|
||||
self.as_ref(),
|
||||
"converter-config",
|
||||
converter_config.map(|s| s.as_ref()),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
use std::mem;
|
||||
|
||||
use glib::{translate::*, ToSendValue};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use gst::EventType;
|
||||
|
||||
#[cfg(feature = "v1_22")]
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::ptr;
|
|||
|
||||
use glib::{
|
||||
translate::{from_glib, from_glib_full, IntoGlib, ToGlibPtr},
|
||||
ToSendValue,
|
||||
value::ToSendValue,
|
||||
};
|
||||
use gst::{ffi as gst_ffi, prelude::*, Message, Object, Seqnum};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{translate::*, Cast, IsA};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
use crate::Allocator;
|
||||
|
||||
|
|
|
@ -2,11 +2,7 @@
|
|||
|
||||
use std::{fmt, marker::PhantomData, ptr, str};
|
||||
|
||||
use glib::{
|
||||
translate::{from_glib, from_glib_full, FromGlibPtrFull, IntoGlib, IntoGlibPtr, ToGlibPtr},
|
||||
value::ToSendValue,
|
||||
IntoGStr, StaticType,
|
||||
};
|
||||
use glib::{prelude::*, translate::*, value::ToSendValue};
|
||||
|
||||
use crate::{caps_features::*, structure::*, CapsIntersectMode};
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ use std::{
|
|||
ptr, str,
|
||||
};
|
||||
|
||||
use glib::{translate::*, IntoGStr, StaticType};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
#[doc(alias = "GstCapsFeatures")]
|
||||
|
@ -854,7 +854,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_from_value_optional() {
|
||||
use glib::ToValue;
|
||||
use glib::value::ToValue;
|
||||
|
||||
crate::init().unwrap();
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
use glib::{
|
||||
translate::{FromGlib, IntoGlib},
|
||||
types::StaticType,
|
||||
value::{ToValue, ToValueOptional},
|
||||
StaticType,
|
||||
};
|
||||
use serde::{
|
||||
de::{Deserialize, Deserializer, Error},
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
use std::{cmp, ops};
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::*,
|
||||
value::{FromValue, ToValue, Value},
|
||||
StaticType, Type,
|
||||
Type,
|
||||
};
|
||||
use thiserror::Error;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{prelude::*, IntoGStr};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use thiserror::Error;
|
||||
|
||||
#[macro_export]
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
FlagsClass, StaticType, ToValue,
|
||||
FlagsClass,
|
||||
};
|
||||
|
||||
bitflags_serde_impl!(crate::BinFlags);
|
||||
|
|
|
@ -6,7 +6,8 @@ use std::{
|
|||
time::Duration,
|
||||
};
|
||||
|
||||
use glib::{translate::*, StaticType};
|
||||
use crate::prelude::*;
|
||||
use glib::translate::*;
|
||||
|
||||
use super::{
|
||||
Format, FormattedValue, FormattedValueError, FormattedValueFullRange, FormattedValueIntrinsic,
|
||||
|
@ -527,14 +528,14 @@ impl From<ClockTime> for glib::Value {
|
|||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl glib::StaticType for ClockTime {
|
||||
impl StaticType for ClockTime {
|
||||
#[inline]
|
||||
fn static_type() -> glib::Type {
|
||||
<u64 as glib::StaticType>::static_type()
|
||||
<u64 as StaticType>::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for ClockTime {
|
||||
impl HasParamSpec for ClockTime {
|
||||
type ParamSpec = glib::ParamSpecUInt64;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str) -> glib::ParamSpecUInt64Builder;
|
||||
|
|
|
@ -64,7 +64,7 @@ impl PluginApiExt for glib::Type {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use glib::StaticType;
|
||||
use glib::prelude::StaticType;
|
||||
|
||||
use super::*;
|
||||
|
||||
|
|
|
@ -4,9 +4,10 @@ use std::{any::Any, fmt, iter, marker::PhantomData, mem, ptr, sync::Arc};
|
|||
|
||||
use glib::{
|
||||
ffi::{gconstpointer, gpointer},
|
||||
prelude::*,
|
||||
translate::*,
|
||||
value::{FromValue, ToValue},
|
||||
StaticType, Value,
|
||||
Value,
|
||||
};
|
||||
use thiserror::Error;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::{borrow::Cow, ffi::CStr, fmt, ptr};
|
||||
|
||||
use glib::{ffi::gpointer, prelude::*, translate::*, IntoGStr, IntoOptionalGStr};
|
||||
use glib::{ffi::gpointer, prelude::*, translate::*};
|
||||
use libc::c_char;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
|
@ -746,7 +746,7 @@ macro_rules! log_with_level(
|
|||
#[allow(unused_unsafe)]
|
||||
#[allow(clippy::redundant_closure_call)]
|
||||
if cat.above_threshold($level) {
|
||||
use $crate::glib::Cast;
|
||||
use $crate::glib::prelude::Cast;
|
||||
|
||||
// FIXME: Once there's a function_name! macro that returns a string literal we can
|
||||
// directly pass it as `&GStr` forward
|
||||
|
@ -789,7 +789,7 @@ macro_rules! log_with_level(
|
|||
// formatted arguments are evaluated even if we end up not logging.
|
||||
#[allow(unused_unsafe)]
|
||||
if cat.above_threshold($level) {
|
||||
use $crate::glib::Cast;
|
||||
use $crate::glib::prelude::Cast;
|
||||
|
||||
// FIXME: Once there's a function_name! macro that returns a string literal we can
|
||||
// directly pass it as `&GStr` forward
|
||||
|
@ -814,7 +814,7 @@ macro_rules! log_with_level(
|
|||
#[allow(unused_unsafe)]
|
||||
#[allow(clippy::redundant_closure_call)]
|
||||
if cat.above_threshold($level) {
|
||||
use $crate::glib::Cast;
|
||||
use $crate::glib::prelude::Cast;
|
||||
|
||||
// FIXME: Once there's a function_name! macro that returns a string literal we can
|
||||
// directly pass it as `&GStr` forward
|
||||
|
@ -858,7 +858,7 @@ macro_rules! log_with_level(
|
|||
// formatted arguments are evaluated even if we end up not logging.
|
||||
#[allow(unused_unsafe)]
|
||||
if cat.above_threshold($level) {
|
||||
use $crate::glib::Cast;
|
||||
use $crate::glib::prelude::Cast;
|
||||
|
||||
// FIXME: Once there's a function_name! macro that returns a string literal we can
|
||||
// directly pass it as `&GStr` forward
|
||||
|
|
|
@ -595,7 +595,7 @@ pub struct MemoryTypeValueTypeChecker<M>(PhantomData<M>);
|
|||
|
||||
unsafe impl<M> glib::value::ValueTypeChecker for MemoryTypeValueTypeChecker<M>
|
||||
where
|
||||
M: MemoryType + glib::StaticType,
|
||||
M: MemoryType + glib::prelude::StaticType,
|
||||
<M as crate::prelude::IsMiniObject>::RefType: AsRef<MemoryRef> + AsMut<MemoryRef>,
|
||||
{
|
||||
type Error = glib::value::ValueTypeMismatchOrNoneError<MemoryTypeMismatchError>;
|
||||
|
@ -875,7 +875,7 @@ macro_rules! memory_object_wrapper {
|
|||
}
|
||||
|
||||
fn value_type(&self) -> glib::Type {
|
||||
<Self as glib::StaticType>::static_type()
|
||||
<Self as $crate::glib::prelude::StaticType>::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{translate::*, StaticType};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
use std::{alloc, mem, ptr};
|
||||
|
||||
|
|
|
@ -350,7 +350,6 @@ impl Error {
|
|||
pub fn builder_from_error<'a>(error: glib::Error) -> ErrorBuilder<'a> {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
use glib::error::ErrorDomain;
|
||||
assert!([
|
||||
crate::CoreError::domain(),
|
||||
crate::ResourceError::domain(),
|
||||
|
@ -443,8 +442,6 @@ impl Warning {
|
|||
pub fn builder_from_error<'a>(error: glib::Error) -> WarningBuilder<'a> {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
use glib::error::ErrorDomain;
|
||||
|
||||
assert!([
|
||||
crate::CoreError::domain(),
|
||||
crate::ResourceError::domain(),
|
||||
|
@ -537,8 +534,6 @@ impl Info {
|
|||
pub fn builder_from_error<'a>(error: glib::Error) -> InfoBuilder<'a> {
|
||||
assert_initialized_main_thread!();
|
||||
|
||||
use glib::error::ErrorDomain;
|
||||
|
||||
assert!([
|
||||
crate::CoreError::domain(),
|
||||
crate::ResourceError::domain(),
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use std::fmt;
|
||||
|
||||
use crate::prelude::*;
|
||||
use glib::translate::*;
|
||||
|
||||
pub trait IsMiniObject:
|
||||
|
@ -570,7 +571,7 @@ macro_rules! mini_object_wrapper (
|
|||
|
||||
#[inline]
|
||||
fn value_type(&self) -> $crate::glib::Type {
|
||||
<Self as $crate::glib::StaticType>::static_type()
|
||||
<Self as $crate::glib::prelude::StaticType>::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -617,7 +618,7 @@ macro_rules! mini_object_wrapper (
|
|||
// Can't have SetValue/SetValueOptional impls as otherwise one could use it to get
|
||||
// immutable references from a mutable reference without borrowing via the value
|
||||
|
||||
impl $crate::glib::HasParamSpec for $name {
|
||||
impl $crate::glib::prelude::HasParamSpec for $name {
|
||||
type ParamSpec = $crate::glib::ParamSpecBoxed;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str) -> $crate::glib::ParamSpecBoxedBuilder<Self>;
|
||||
|
@ -639,7 +640,7 @@ mini_object_wrapper!(MiniObject, MiniObjectRef, ffi::GstMiniObject, || {
|
|||
|
||||
impl MiniObject {
|
||||
#[inline]
|
||||
pub fn downcast<T: IsMiniObject + glib::StaticType>(self) -> Result<T, Self> {
|
||||
pub fn downcast<T: IsMiniObject + StaticType>(self) -> Result<T, Self> {
|
||||
if self.type_().is_a(T::static_type()) {
|
||||
unsafe { Ok(from_glib_full(self.into_glib_ptr() as *mut T::FfiType)) }
|
||||
} else {
|
||||
|
@ -670,7 +671,7 @@ impl MiniObjectRef {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn downcast_ref<T: IsMiniObject + glib::StaticType>(&self) -> Option<&T::RefType> {
|
||||
pub fn downcast_ref<T: IsMiniObject + StaticType>(&self) -> Option<&T::RefType> {
|
||||
if self.type_().is_a(T::static_type()) {
|
||||
unsafe { Some(&*(self as *const Self as *const T::RefType)) }
|
||||
} else {
|
||||
|
@ -679,7 +680,7 @@ impl MiniObjectRef {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn downcast_mut<T: IsMiniObject + glib::StaticType>(&mut self) -> Option<&mut T::RefType> {
|
||||
pub fn downcast_mut<T: IsMiniObject + StaticType>(&mut self) -> Option<&mut T::RefType> {
|
||||
if self.type_().is_a(T::static_type()) {
|
||||
unsafe { Some(&mut *(self as *mut Self as *mut T::RefType)) }
|
||||
} else {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::{gobject_ffi, translate::*, ParamSpec};
|
||||
use glib::{gobject_ffi, prelude::*, translate::*, ParamSpec};
|
||||
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
|
@ -26,9 +26,9 @@ impl std::ops::Deref for ParamSpecFraction {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl glib::ParamSpecType for ParamSpecFraction {}
|
||||
unsafe impl ParamSpecType for ParamSpecFraction {}
|
||||
|
||||
impl glib::HasParamSpec for crate::Fraction {
|
||||
impl HasParamSpec for crate::Fraction {
|
||||
type ParamSpec = ParamSpecFraction;
|
||||
|
||||
type SetValue = crate::Fraction;
|
||||
|
@ -222,9 +222,9 @@ impl std::ops::Deref for ParamSpecArray {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl glib::ParamSpecType for ParamSpecArray {}
|
||||
unsafe impl ParamSpecType for ParamSpecArray {}
|
||||
|
||||
impl glib::HasParamSpec for crate::Array {
|
||||
impl HasParamSpec for crate::Array {
|
||||
type ParamSpec = ParamSpecArray;
|
||||
|
||||
type SetValue = crate::Array;
|
||||
|
|
|
@ -44,7 +44,7 @@ impl StaticType for Rank {
|
|||
}
|
||||
}
|
||||
|
||||
impl glib::HasParamSpec for Rank {
|
||||
impl HasParamSpec for Rank {
|
||||
type ParamSpec = glib::ParamSpecEnum;
|
||||
type SetValue = Self;
|
||||
type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder<Self>;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::{fmt, marker::PhantomData, mem};
|
||||
|
||||
use glib::{translate::*, StaticType};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
use crate::{
|
||||
format::{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::{fmt, marker::PhantomData, ptr};
|
||||
|
||||
use glib::{translate::*, StaticType};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
use crate::Caps;
|
||||
|
||||
|
@ -31,7 +31,7 @@ impl fmt::Debug for StaticCaps {
|
|||
}
|
||||
}
|
||||
|
||||
impl glib::types::StaticType for StaticCaps {
|
||||
impl StaticType for StaticCaps {
|
||||
#[inline]
|
||||
fn static_type() -> glib::types::Type {
|
||||
unsafe { glib::translate::from_glib(ffi::gst_static_caps_get_type()) }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::{ffi::CStr, fmt, marker::PhantomData, ptr};
|
||||
|
||||
use glib::{translate::*, StaticType};
|
||||
use glib::{prelude::*, translate::*};
|
||||
|
||||
use crate::{Caps, PadTemplate};
|
||||
|
||||
|
|
|
@ -1205,7 +1205,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_from_value_optional() {
|
||||
use glib::ToValue;
|
||||
use glib::value::ToValue;
|
||||
|
||||
crate::init().unwrap();
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
use std::fmt;
|
||||
|
||||
use glib::{Date, ToValue};
|
||||
use glib::{value::ToValue, Date};
|
||||
use serde::{
|
||||
de,
|
||||
de::{Deserialize, DeserializeSeed, Deserializer, SeqAccess, Visitor},
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
use std::ptr;
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
subclass::{prelude::*, InitializingObject},
|
||||
translate::*,
|
||||
Cast, StaticType,
|
||||
};
|
||||
use libc::c_char;
|
||||
|
||||
|
|
|
@ -37,11 +37,11 @@ macro_rules! panic_to_error(
|
|||
{
|
||||
let panicked = $imp.panicked();
|
||||
let element = $crate::glib::subclass::types::ObjectSubclassExt::obj($imp);
|
||||
let element = unsafe { $crate::glib::Cast::unsafe_cast_ref::<$crate::Element>(element.as_ref()) };
|
||||
let element = unsafe { $crate::glib::prelude::Cast::unsafe_cast_ref::<$crate::Element>(element.as_ref()) };
|
||||
if panicked.load(std::sync::atomic::Ordering::Relaxed) {
|
||||
$crate::subclass::post_panic_error_message(
|
||||
element,
|
||||
$crate::glib::Cast::upcast_ref::<$crate::Object>(element),
|
||||
$crate::glib::prelude::Cast::upcast_ref::<$crate::Object>(element),
|
||||
None,
|
||||
);
|
||||
$ret
|
||||
|
@ -54,7 +54,7 @@ macro_rules! panic_to_error(
|
|||
panicked.store(true, std::sync::atomic::Ordering::Relaxed);
|
||||
$crate::subclass::post_panic_error_message(
|
||||
element,
|
||||
$crate::glib::Cast::upcast_ref::<$crate::Object>(element),
|
||||
$crate::glib::prelude::Cast::upcast_ref::<$crate::Object>(element),
|
||||
Some(err),
|
||||
);
|
||||
$ret
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
use std::{fmt, marker::PhantomData, mem};
|
||||
|
||||
use glib::{
|
||||
prelude::*,
|
||||
translate::*,
|
||||
value::{FromValue, SendValue, ToSendValue, Value},
|
||||
IntoGStr, StaticType,
|
||||
};
|
||||
|
||||
use crate::{Sample, TagError, TagMergeMode, TagScope};
|
||||
|
|
|
@ -6,7 +6,8 @@ use std::{cell::RefCell, cmp, fmt, rc::Rc};
|
|||
|
||||
use glib::{
|
||||
translate::{from_glib, ToGlibPtr},
|
||||
Date, SendValue, ToValue,
|
||||
value::{SendValue, ToValue},
|
||||
Date,
|
||||
};
|
||||
use serde::{
|
||||
de,
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||
|
||||
use glib::prelude::*;
|
||||
|
||||
// rustdoc-stripper-ignore-next
|
||||
/// Trait that allows accessing `Display` implementation on types external to this crate.
|
||||
pub trait Displayable {
|
||||
|
@ -16,13 +18,12 @@ pub struct ObjectLockGuard<'a, T: ?Sized> {
|
|||
|
||||
impl<'a, T> ObjectLockGuard<'a, T>
|
||||
where
|
||||
T: glib::IsA<crate::Object> + ?Sized,
|
||||
T: IsA<crate::Object> + ?Sized,
|
||||
{
|
||||
#[inline]
|
||||
pub fn acquire(obj: &'a T) -> ObjectLockGuard<'a, T> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
use glib::ObjectType;
|
||||
let mutex = &mut (*obj.as_ref().as_ptr()).lock;
|
||||
glib::ffi::g_mutex_lock(mutex);
|
||||
Self { obj, mutex }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::{cmp, fmt, ops, slice};
|
||||
|
||||
use glib::{translate::*, StaticType};
|
||||
use glib::{prelude::*, translate::*};
|
||||
use num_rational::Rational32;
|
||||
|
||||
#[derive(Copy, Clone, Debug, Ord, PartialOrd, Eq, PartialEq, Hash)]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
use std::{fmt, mem};
|
||||
|
||||
use glib::{Date, StaticType, ToValue};
|
||||
use glib::{prelude::*, Date};
|
||||
use num_rational::Rational32;
|
||||
use once_cell::sync::Lazy;
|
||||
use serde::{
|
||||
|
|
Loading…
Reference in a new issue