gst/lib: cleanup format re-exports

This commit is contained in:
François Laignel 2022-10-09 18:37:45 +02:00
parent a4d901ee63
commit 8e2c621a9f
20 changed files with 59 additions and 62 deletions

View file

@ -176,9 +176,9 @@ impl AudioInfo {
}
#[doc(alias = "gst_audio_info_convert")]
pub fn convert<U: gst::SpecificFormattedValueFullRange>(
pub fn convert<U: gst::format::SpecificFormattedValueFullRange>(
&self,
src_val: impl gst::FormattedValue,
src_val: impl gst::format::FormattedValue,
) -> Option<U> {
assert_initialized_main_thread!();
unsafe {
@ -199,7 +199,7 @@ impl AudioInfo {
pub fn convert_generic(
&self,
src_val: impl gst::FormattedValue,
src_val: impl gst::format::FormattedValue,
dest_fmt: gst::Format,
) -> Option<gst::GenericFormattedValue> {
assert_initialized_main_thread!();

View file

@ -23,7 +23,7 @@ unsafe impl Sync for AudioClippingMeta {}
impl AudioClippingMeta {
#[doc(alias = "gst_buffer_add_audio_clipping_meta")]
pub fn add<V: gst::FormattedValue>(
pub fn add<V: gst::format::FormattedValue>(
buffer: &mut gst::BufferRef,
start: V,
end: V,

View file

@ -6,7 +6,7 @@ use glib::prelude::*;
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use glib::signal::{connect_raw, SignalHandlerId};
use glib::translate::*;
use gst::FormattedValue;
use gst::format::FormattedValue;
#[cfg(any(feature = "v1_16", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
use std::boxed::Box as Box_;
@ -53,7 +53,10 @@ pub trait AggregatorExtManual: 'static {
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_aggregator_update_segment")]
fn update_segment<F: gst::FormattedValueIntrinsic>(&self, segment: &gst::FormattedSegment<F>);
fn update_segment<F: gst::format::FormattedValueIntrinsic>(
&self,
segment: &gst::FormattedSegment<F>,
);
fn set_position(&self, position: impl FormattedValue);
@ -158,7 +161,10 @@ impl<O: IsA<Aggregator>> AggregatorExtManual for O {
}
#[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn update_segment<F: gst::FormattedValueIntrinsic>(&self, segment: &gst::FormattedSegment<F>) {
fn update_segment<F: gst::format::FormattedValueIntrinsic>(
&self,
segment: &gst::FormattedSegment<F>,
) {
unsafe {
ffi::gst_aggregator_update_segment(
self.as_ref().to_glib_none().0,

View file

@ -4,6 +4,7 @@ use crate::BaseParse;
use crate::BaseParseFrame;
use glib::prelude::*;
use glib::translate::*;
use gst::format::{FormattedValue, SpecificFormattedValueFullRange};
use std::mem;
pub trait BaseParseExtManual: 'static {
@ -13,18 +14,18 @@ pub trait BaseParseExtManual: 'static {
fn src_pad(&self) -> &gst::Pad;
#[doc(alias = "gst_base_parse_set_duration")]
fn set_duration(&self, duration: impl gst::FormattedValue, interval: u32);
fn set_duration(&self, duration: impl FormattedValue, interval: u32);
#[doc(alias = "gst_base_parse_set_frame_rate")]
fn set_frame_rate(&self, fps: gst::Fraction, lead_in: u32, lead_out: u32);
#[doc(alias = "gst_base_parse_convert_default")]
fn convert_default<U: gst::SpecificFormattedValueFullRange>(
fn convert_default<U: SpecificFormattedValueFullRange>(
&self,
src_val: impl gst::FormattedValue,
src_val: impl FormattedValue,
) -> Option<U>;
fn convert_default_generic(
&self,
src_val: impl gst::FormattedValue,
src_val: impl FormattedValue,
dest_format: gst::Format,
) -> Option<gst::GenericFormattedValue>;
@ -51,7 +52,7 @@ impl<O: IsA<BaseParse>> BaseParseExtManual for O {
}
}
fn set_duration(&self, duration: impl gst::FormattedValue, interval: u32) {
fn set_duration(&self, duration: impl FormattedValue, interval: u32) {
unsafe {
ffi::gst_base_parse_set_duration(
self.as_ref().to_glib_none().0,
@ -75,9 +76,9 @@ impl<O: IsA<BaseParse>> BaseParseExtManual for O {
}
}
fn convert_default<U: gst::SpecificFormattedValueFullRange>(
fn convert_default<U: SpecificFormattedValueFullRange>(
&self,
src_val: impl gst::FormattedValue,
src_val: impl FormattedValue,
) -> Option<U> {
unsafe {
let mut dest_val = mem::MaybeUninit::uninit();
@ -98,7 +99,7 @@ impl<O: IsA<BaseParse>> BaseParseExtManual for O {
fn convert_default_generic(
&self,
src_val: impl gst::FormattedValue,
src_val: impl FormattedValue,
dest_format: gst::Format,
) -> Option<gst::GenericFormattedValue> {
unsafe {

View file

@ -5,7 +5,6 @@ use std::mem;
use crate::prelude::*;
use glib::translate::*;
use gst::subclass::prelude::*;
use crate::BaseParse;
@ -33,7 +32,7 @@ pub trait BaseParseImpl: BaseParseImplExt + ElementImpl {
fn convert(
&self,
src_val: impl gst::FormattedValue,
src_val: impl gst::format::FormattedValue,
dest_format: gst::Format,
) -> Option<gst::GenericFormattedValue> {
self.parent_convert(src_val, dest_format)
@ -54,7 +53,7 @@ pub trait BaseParseImplExt: ObjectSubclass {
fn parent_convert(
&self,
src_val: impl gst::FormattedValue,
src_val: impl gst::format::FormattedValue,
dest_format: gst::Format,
) -> Option<gst::GenericFormattedValue>;
}
@ -160,7 +159,7 @@ impl<T: BaseParseImpl> BaseParseImplExt for T {
fn parent_convert(
&self,
src_val: impl gst::FormattedValue,
src_val: impl gst::format::FormattedValue,
dest_format: gst::Format,
) -> Option<gst::GenericFormattedValue> {
unsafe {

View file

@ -744,9 +744,9 @@ impl VideoInfo {
}
#[doc(alias = "gst_video_info_convert")]
pub fn convert<U: gst::SpecificFormattedValueFullRange>(
pub fn convert<U: gst::format::SpecificFormattedValueFullRange>(
&self,
src_val: impl gst::FormattedValue,
src_val: impl gst::format::FormattedValue,
) -> Option<U> {
skip_assert_initialized!();
unsafe {
@ -767,7 +767,7 @@ impl VideoInfo {
pub fn convert_generic(
&self,
src_val: impl gst::FormattedValue,
src_val: impl gst::format::FormattedValue,
dest_fmt: gst::Format,
) -> Option<gst::GenericFormattedValue> {
skip_assert_initialized!();

View file

@ -260,7 +260,7 @@ impl BufferPoolAcquireParams {
})
}
pub fn with_start_stop<T: crate::SpecificFormattedValue>(
pub fn with_start_stop<T: crate::format::SpecificFormattedValue>(
start: T,
stop: T,
flags: crate::BufferPoolAcquireFlags,

View file

@ -4,6 +4,10 @@ use crate::Element;
use once_cell::sync::Lazy;
use crate::format::{
CompatibleFormattedValue, FormattedValue, SpecificFormattedValueFullRange,
SpecificFormattedValueIntrinsic,
};
use crate::prelude::*;
use crate::ClockTime;
use crate::ElementFlags;
@ -14,10 +18,7 @@ use crate::Plugin;
use crate::QueryRef;
use crate::Rank;
use crate::State;
use crate::{
CompatibleFormattedValue, Format, FormattedValue, GenericFormattedValue,
SpecificFormattedValueFullRange,
};
use crate::{Format, GenericFormattedValue};
use glib::translate::*;

View file

@ -1,8 +1,10 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::format::{
CompatibleFormattedValue, FormattedValue, FormattedValueIntrinsic, GenericFormattedValue,
};
use crate::structure::*;
use crate::ClockTime;
use crate::{CompatibleFormattedValue, FormattedValue, GenericFormattedValue};
use std::borrow::Borrow;
use std::cmp;
@ -550,12 +552,12 @@ declare_concrete_event!(@sticky Segment, T);
impl Segment<Event> {
#[doc(alias = "gst_event_new_segment")]
#[allow(clippy::new_ret_no_self)]
pub fn new<F: crate::FormattedValueIntrinsic>(segment: &crate::FormattedSegment<F>) -> Event {
pub fn new<F: FormattedValueIntrinsic>(segment: &crate::FormattedSegment<F>) -> Event {
skip_assert_initialized!();
Self::builder(segment).build()
}
pub fn builder<F: crate::FormattedValueIntrinsic>(
pub fn builder<F: FormattedValueIntrinsic>(
segment: &crate::FormattedSegment<F>,
) -> SegmentBuilder {
assert_initialized_main_thread!();

View file

@ -517,7 +517,7 @@ impl std::iter::Sum for ClockTime {
#[cfg(test)]
mod tests {
use super::*;
use crate::{Signed, UnsignedIntoSigned};
use crate::format::{Signed, UnsignedIntoSigned};
use opt_ops::prelude::*;
const CT_1: ClockTime = ClockTime::from_nseconds(1);

View file

@ -14,7 +14,7 @@ use super::{FormattedValue, SpecificFormattedValue};
/// Consider the following function:
///
/// ```rust
/// # use gstreamer::{ClockTime, CompatibleFormattedValue, FormattedValue, GenericFormattedValue};
/// # use gstreamer::format::{ClockTime, CompatibleFormattedValue, FormattedValue, GenericFormattedValue};
/// fn with_compatible_formats<V: FormattedValue>(
/// arg1: V,
/// arg2: impl CompatibleFormattedValue<V>,

View file

@ -185,7 +185,7 @@ macro_rules! impl_unsigned_int_into_signed(
($typ:ty) => {
impl crate::format::SignedIntrinsic for $typ {}
impl crate::UnsignedIntoSigned for $typ {
impl crate::format::UnsignedIntoSigned for $typ {
type Signed = crate::Signed<$typ>;
fn into_positive(self) -> Self::Signed {
@ -197,7 +197,7 @@ macro_rules! impl_unsigned_int_into_signed(
}
}
impl crate::UnsignedIntoSigned for Option<$typ> {
impl crate::format::UnsignedIntoSigned for Option<$typ> {
type Signed = Option<crate::Signed<$typ>>;
fn into_positive(self) -> Self::Signed {

View file

@ -49,7 +49,7 @@
//!
//! ```
//! # use gstreamer as gst;
//! # use gst::FormattedValue;
//! # use gst::format::FormattedValue;
//! # gst::init();
//! # let segment = gst::FormattedSegment::<gst::ClockTime>::new().upcast();
//! // Downcasting the generic `segment` for `gst::ClockTime` use.

View file

@ -218,12 +218,7 @@ pub use crate::typefind::*;
mod typefind_factory;
pub mod format;
pub use crate::format::{
ClockTime, CompatibleFormattedValue, FormattedValue, FormattedValueFullRange,
FormattedValueIntrinsic, FormattedValueNoneBuilder, GenericFormattedValue, NoneSignedBuilder,
Signed, SpecificFormattedValue, SpecificFormattedValueFullRange,
SpecificFormattedValueIntrinsic, UnsignedIntoSigned,
};
pub use crate::format::{ClockTime, GenericFormattedValue, GenericSignedFormattedValue, Signed};
mod segment;
pub use crate::segment::*;
@ -344,9 +339,7 @@ pub mod prelude {
pub use muldiv::MulDiv;
pub use crate::format::{
CompatibleFormattedValue, FormattedValue, FormattedValueFullRange, FormattedValueIntrinsic,
FormattedValueNoneBuilder, NoneSignedBuilder, SpecificFormattedValue,
SpecificFormattedValueFullRange, SpecificFormattedValueIntrinsic, UnsignedIntoSigned,
FormattedValue, FormattedValueNoneBuilder, NoneSignedBuilder, UnsignedIntoSigned,
};
pub use crate::utils::Displayable;

View file

@ -1,5 +1,6 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::format::{CompatibleFormattedValue, FormattedValue};
use crate::prelude::*;
use crate::structure::*;
use crate::GenericFormattedValue;

View file

@ -1,5 +1,8 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::format::{
FormattedValue, SpecificFormattedValueFullRange, SpecificFormattedValueIntrinsic,
};
use crate::Buffer;
use crate::BufferList;
use crate::Event;
@ -14,10 +17,7 @@ use crate::PadProbeType;
use crate::Query;
use crate::QueryRef;
use crate::StaticPadTemplate;
use crate::{
Format, FormattedValue, GenericFormattedValue, SpecificFormattedValueFullRange,
SpecificFormattedValueIntrinsic,
};
use crate::{Format, GenericFormattedValue};
use std::mem;
use std::num::NonZeroU64;

View file

@ -1,7 +1,7 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::format::{CompatibleFormattedValue, FormattedValue, GenericFormattedValue};
use crate::structure::*;
use crate::{CompatibleFormattedValue, FormattedValue, GenericFormattedValue};
use std::borrow::{Borrow, BorrowMut};
use std::ffi::CStr;

View file

@ -5,6 +5,7 @@ use std::ptr;
use glib::translate::{from_glib_full, from_glib_none, mut_override, IntoGlibPtr, ToGlibPtr};
use crate::format::FormattedValueIntrinsic;
use crate::Buffer;
use crate::BufferList;
use crate::BufferListRef;
@ -12,7 +13,6 @@ use crate::BufferRef;
use crate::Caps;
use crate::CapsRef;
use crate::FormattedSegment;
use crate::FormattedValueIntrinsic;
use crate::Segment;
use crate::Structure;
use crate::StructureRef;

View file

@ -1,13 +1,13 @@
// Take a look at the license at the top of the repository in the LICENSE file.
use crate::format::{
CompatibleFormattedValue, FormattedValue, FormattedValueFullRange, FormattedValueIntrinsic,
FormattedValueNoneBuilder, NoneSignedBuilder, UnsignedIntoSigned,
};
use crate::Format;
use crate::GenericFormattedValue;
use crate::SeekFlags;
use crate::SeekType;
use crate::{
CompatibleFormattedValue, FormattedValue, FormattedValueFullRange, FormattedValueIntrinsic,
FormattedValueNoneBuilder, NoneSignedBuilder, UnsignedIntoSigned,
};
use glib::translate::*;
use glib::StaticType;
use std::fmt;

View file

@ -4,14 +4,8 @@ use serde::de;
use serde::de::{Deserialize, Deserializer};
use serde::ser::{Serialize, Serializer};
use crate::Format;
use crate::FormattedSegment;
use crate::FormattedValue;
use crate::FormattedValueIntrinsic;
use crate::GenericFormattedValue;
use crate::Segment;
use crate::SegmentFlags;
use crate::SpecificFormattedValueIntrinsic;
use crate::format::{FormattedValue, FormattedValueIntrinsic, SpecificFormattedValueIntrinsic};
use crate::{Format, FormattedSegment, GenericFormattedValue, Segment, SegmentFlags};
#[derive(serde::Serialize, serde::Deserialize)]
struct FormattedSegmentSerde {