Struct gstreamer_audio::AudioCapsBuilder

source ·
pub struct AudioCapsBuilder<T> { /* private fields */ }

Implementations§

source§

impl AudioCapsBuilder<NoFeature>

source

pub fn new() -> Self

Constructs an AudioCapsBuilder for the “audio/x-raw” encoding.

If left unchanged, the resulting Caps will be initialized with:

  • “audio/x-raw” encoding.
  • maximum rate range.
  • maximum channels range.
  • both interleaved and non-interleaved layouts.
  • all available formats.

Use AudioCapsBuilder::for_encoding to specify another encoding.

source

pub fn new_interleaved() -> Self

Constructs an AudioCapsBuilder for the “audio/x-raw” encoding with interleaved layout.

If left unchanged, the resulting Caps will be initialized with:

  • “audio/x-raw” encoding.
  • maximum rate range.
  • maximum channels range.
  • interleaved layout.
  • all available formats.

Use AudioCapsBuilder::for_encoding to specify another encoding.

source

pub fn for_encoding(encoding: impl IntoGStr) -> Self

Constructs an AudioCapsBuilder for the specified encoding.

The resulting Caps will use the encoding argument as name and will not contain any additional fields unless explicitly added.

source

pub fn any_features(self) -> AudioCapsBuilder<HasFeatures>

source

pub fn features( self, features: impl IntoIterator<Item = impl IntoGStr>, ) -> AudioCapsBuilder<HasFeatures>

source§

impl<T> AudioCapsBuilder<T>

source

pub fn format(self, format: AudioFormat) -> Self

source

pub fn format_if(self, format: AudioFormat, predicate: bool) -> Self

source

pub fn format_if_some(self, format: Option<AudioFormat>) -> Self

source

pub fn format_list(self, formats: impl IntoIterator<Item = AudioFormat>) -> Self

source

pub fn format_list_if( self, formats: impl IntoIterator<Item = AudioFormat>, predicate: bool, ) -> Self

source

pub fn format_list_if_some( self, formats: Option<impl IntoIterator<Item = AudioFormat>>, ) -> Self

source

pub fn format_list_if_not_empty( self, formats: impl IntoIterator<Item = AudioFormat>, ) -> Self

source

pub fn rate(self, rate: i32) -> Self

source

pub fn rate_if(self, rate: i32, predicate: bool) -> Self

source

pub fn rate_if_some(self, rate: Option<i32>) -> Self

source

pub fn rate_range(self, rates: impl RangeBounds<i32>) -> Self

source

pub fn rate_range_if( self, rates: impl RangeBounds<i32>, predicate: bool, ) -> Self

source

pub fn rate_range_if_some(self, rates: Option<impl RangeBounds<i32>>) -> Self

source

pub fn rate_list(self, rates: impl IntoIterator<Item = i32>) -> Self

source

pub fn rate_list_if( self, rates: impl IntoIterator<Item = i32>, predicate: bool, ) -> Self

source

pub fn rate_list_if_some( self, rates: Option<impl IntoIterator<Item = i32>>, ) -> Self

source

pub fn rate_list_if_not_empty( self, rates: impl IntoIterator<Item = i32>, ) -> Self

source

pub fn channels(self, channels: i32) -> Self

source

pub fn channels_if(self, channels: i32, predicate: bool) -> Self

source

pub fn channels_if_some(self, channels: Option<i32>) -> Self

source

pub fn channels_range(self, channels: impl RangeBounds<i32>) -> Self

source

pub fn channels_range_if( self, channels: impl RangeBounds<i32>, predicate: bool, ) -> Self

source

pub fn channels_range_if_some( self, channels: Option<impl RangeBounds<i32>>, ) -> Self

source

pub fn channels_list(self, channels: impl IntoIterator<Item = i32>) -> Self

source

pub fn channels_list_if( self, channels: impl IntoIterator<Item = i32>, predicate: bool, ) -> Self

source

pub fn channels_list_if_some( self, channels: Option<impl IntoIterator<Item = i32>>, ) -> Self

source

pub fn channels_list_if_not_empty( self, channels: impl IntoIterator<Item = i32>, ) -> Self

source

pub fn layout(self, layout: AudioLayout) -> Self

source

pub fn layout_if(self, layout: AudioLayout, predicate: bool) -> Self

source

pub fn layout_if_some(self, layout: Option<AudioLayout>) -> Self

source

pub fn layout_list(self, layouts: impl IntoIterator<Item = AudioLayout>) -> Self

source

pub fn layout_list_if( self, layouts: impl IntoIterator<Item = AudioLayout>, predicate: bool, ) -> Self

source

pub fn layout_list_if_some( self, layouts: Option<impl IntoIterator<Item = AudioLayout>>, ) -> Self

source

pub fn layout_list_if_not_empty( self, layouts: impl IntoIterator<Item = AudioLayout>, ) -> Self

source

pub fn channel_mask(self, channel_mask: u64) -> Self

source

pub fn channel_mask_if(self, channel_mask: u64, predicate: bool) -> Self

source

pub fn channel_mask_if_some(self, channel_mask: Option<u64>) -> Self

source

pub fn fallback_channel_mask(self) -> Self

source

pub fn field(self, name: impl IntoGStr, value: impl Into<Value> + Send) -> Self

Sets field name to the given value value.

Overrides any default or previously defined value for name.

source

pub fn field_if( self, name: impl IntoGStr, value: impl Into<Value> + Send, predicate: bool, ) -> Self

Sets field name to the given inner value if the predicate evaluates to true.

This has no effect if the predicate evaluates to false, i.e. default or previous value for name is kept.

source

pub fn field_if_some( self, name: impl IntoGStr, value: Option<impl Into<Value> + Send>, ) -> Self

Sets field name to the given inner value if value is Some.

This has no effect if the value is None, i.e. default or previous value for name is kept.

source

pub fn field_from_iter<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>( self, name: impl IntoGStr, iter: impl IntoIterator<Item = impl ToSendValue>, ) -> Self

Sets field name using the given ValueType V built from iter’s the Items.

Overrides any default or previously defined value for name.

source

pub fn field_if_not_empty<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>( self, name: impl IntoGStr, iter: impl IntoIterator<Item = impl ToSendValue>, ) -> Self

Sets field name using the given ValueType V built from iter’s Items, if iter` is not empty.

This has no effect if iter is empty, i.e. previous value for name is unchanged.

source

pub fn build(self) -> Caps

Trait Implementations§

source§

impl Default for AudioCapsBuilder<NoFeature>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> Freeze for AudioCapsBuilder<T>

§

impl<T> RefUnwindSafe for AudioCapsBuilder<T>
where T: RefUnwindSafe,

§

impl<T> Send for AudioCapsBuilder<T>
where T: Send,

§

impl<T> Sync for AudioCapsBuilder<T>
where T: Sync,

§

impl<T> Unpin for AudioCapsBuilder<T>
where T: Unpin,

§

impl<T> UnwindSafe for AudioCapsBuilder<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.