Struct gstreamer_audio::AudioCapsBuilder
source · pub struct AudioCapsBuilder<T> { /* private fields */ }
Implementations§
source§impl AudioCapsBuilder<NoFeature>
impl AudioCapsBuilder<NoFeature>
sourcepub fn new() -> Self
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.
sourcepub fn new_interleaved() -> Self
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.
sourcepub fn for_encoding(encoding: impl IntoGStr) -> Self
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.
pub fn any_features(self) -> AudioCapsBuilder<HasFeatures>
pub fn features( self, features: impl IntoIterator<Item = impl IntoGStr>, ) -> AudioCapsBuilder<HasFeatures>
source§impl<T> AudioCapsBuilder<T>
impl<T> AudioCapsBuilder<T>
pub fn format(self, format: AudioFormat) -> Self
pub fn format_if(self, format: AudioFormat, predicate: bool) -> Self
pub fn format_if_some(self, format: Option<AudioFormat>) -> Self
pub fn format_list(self, formats: impl IntoIterator<Item = AudioFormat>) -> Self
pub fn format_list_if( self, formats: impl IntoIterator<Item = AudioFormat>, predicate: bool, ) -> Self
pub fn format_list_if_some( self, formats: Option<impl IntoIterator<Item = AudioFormat>>, ) -> Self
pub fn format_list_if_not_empty( self, formats: impl IntoIterator<Item = AudioFormat>, ) -> Self
pub fn rate(self, rate: i32) -> Self
pub fn rate_if(self, rate: i32, predicate: bool) -> Self
pub fn rate_if_some(self, rate: Option<i32>) -> Self
pub fn rate_range(self, rates: impl RangeBounds<i32>) -> Self
pub fn rate_range_if( self, rates: impl RangeBounds<i32>, predicate: bool, ) -> Self
pub fn rate_range_if_some(self, rates: Option<impl RangeBounds<i32>>) -> Self
pub fn rate_list(self, rates: impl IntoIterator<Item = i32>) -> Self
pub fn rate_list_if( self, rates: impl IntoIterator<Item = i32>, predicate: bool, ) -> Self
pub fn rate_list_if_some( self, rates: Option<impl IntoIterator<Item = i32>>, ) -> Self
pub fn rate_list_if_not_empty( self, rates: impl IntoIterator<Item = i32>, ) -> Self
pub fn channels(self, channels: i32) -> Self
pub fn channels_if(self, channels: i32, predicate: bool) -> Self
pub fn channels_if_some(self, channels: Option<i32>) -> Self
pub fn channels_range(self, channels: impl RangeBounds<i32>) -> Self
pub fn channels_range_if( self, channels: impl RangeBounds<i32>, predicate: bool, ) -> Self
pub fn channels_range_if_some( self, channels: Option<impl RangeBounds<i32>>, ) -> Self
pub fn channels_list(self, channels: impl IntoIterator<Item = i32>) -> Self
pub fn channels_list_if( self, channels: impl IntoIterator<Item = i32>, predicate: bool, ) -> Self
pub fn channels_list_if_some( self, channels: Option<impl IntoIterator<Item = i32>>, ) -> Self
pub fn channels_list_if_not_empty( self, channels: impl IntoIterator<Item = i32>, ) -> Self
pub fn layout(self, layout: AudioLayout) -> Self
pub fn layout_if(self, layout: AudioLayout, predicate: bool) -> Self
pub fn layout_if_some(self, layout: Option<AudioLayout>) -> Self
pub fn layout_list(self, layouts: impl IntoIterator<Item = AudioLayout>) -> Self
pub fn layout_list_if( self, layouts: impl IntoIterator<Item = AudioLayout>, predicate: bool, ) -> Self
pub fn layout_list_if_some( self, layouts: Option<impl IntoIterator<Item = AudioLayout>>, ) -> Self
pub fn layout_list_if_not_empty( self, layouts: impl IntoIterator<Item = AudioLayout>, ) -> Self
pub fn channel_mask(self, channel_mask: u64) -> Self
pub fn channel_mask_if(self, channel_mask: u64, predicate: bool) -> Self
pub fn channel_mask_if_some(self, channel_mask: Option<u64>) -> Self
pub fn fallback_channel_mask(self) -> Self
sourcepub fn field(self, name: impl IntoGStr, value: impl Into<Value> + Send) -> Self
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
.
sourcepub fn field_if(
self,
name: impl IntoGStr,
value: impl Into<Value> + Send,
predicate: bool,
) -> Self
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.
sourcepub fn field_if_some(
self,
name: impl IntoGStr,
value: Option<impl Into<Value> + Send>,
) -> Self
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.
sourcepub fn field_from_iter<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>(
self,
name: impl IntoGStr,
iter: impl IntoIterator<Item = impl ToSendValue>,
) -> Self
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 Item
s.
Overrides any default or previously defined value for name
.
sourcepub fn field_if_not_empty<V: ValueType + Into<Value> + FromIterator<SendValue> + Send>(
self,
name: impl IntoGStr,
iter: impl IntoIterator<Item = impl ToSendValue>,
) -> Self
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.
pub fn build(self) -> Caps
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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