Skip to main content

ValidChannels

Struct ValidChannels 

Source
pub struct ValidChannels<'a> { /* private fields */ }
Expand description

Describes a CHANNELS attribute value that has at least a valid count.

The format described in HLS is a slash separated list of parameters. At the time of writing there were 3 defined parameters:

  • The count of audio channels
  • An indicator of spatial audio of some kind
  • Supplementary indication of special channel usage

Implementations§

Source§

impl<'a> ValidChannels<'a>

Source

pub fn new( count: u32, spatial_audio: impl Into<EnumeratedStringList<'a, AudioCodingIdentifier>>, special_usage: impl Into<EnumeratedStringList<'a, ChannelSpecialUsageIdentifier>>, ) -> Self

Construct a new ValidChannels.

Note that AudioCodingIdentifier and ChannelSpecialUsageIdentifier can be used directly here. For example:

let channels = ValidChannels::new(
    16,
    EnumeratedStringList::from([AudioCodingIdentifier::JointObjectCoding]),
    EnumeratedStringList::from([ChannelSpecialUsageIdentifier::Binaural])
);

Since &str implements Into<EnumeratedStringList> we can also use string slice directly, but care should be taken to follow the correct format:

let channels = ValidChannels::new(16, "JOC", "BINAURAL");
Source§

impl ValidChannels<'_>

Source

pub fn count(&self) -> u32

Incicates a count of audio, incicating the maximum number of independent, simultaneous audio channels present in any Media Segment in the Rendition. For example, an AC-3 5.1 Rendition would have a value of 6.

Source

pub fn spatial_audio(&self) -> EnumeratedStringList<'_, AudioCodingIdentifier>

Identifies the presence of spatial audio of some kind, for example, object-based audio, in the Rendition. This is described as a list of audio coding identifiers (which can be codec specific).

Source

pub fn special_usage( &self, ) -> EnumeratedStringList<'_, ChannelSpecialUsageIdentifier>

Provides supplementary indications of special channel usage that are necessary for informed selection and processing.

Source

pub fn unknown_parameters(&self) -> Split<'_, char>

At the time of writing the HLS specification only defined 3 parameters (described here via Self::count, Self::spatial_audio, and Self::special_usage). In case more parameters are added later, this method will expose those as a split on '/'.

Trait Implementations§

Source§

impl AsRef<str> for ValidChannels<'_>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> Clone for ValidChannels<'a>

Source§

fn clone(&self) -> ValidChannels<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ValidChannels<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ValidChannels<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<ValidChannels<'a>> for Cow<'a, str>

Source§

fn from(value: ValidChannels<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> PartialEq for ValidChannels<'a>

Source§

fn eq(&self, other: &ValidChannels<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> TryFrom<&'a str> for ValidChannels<'a>

Source§

type Error = UnrecognizedEnumerationError<'a>

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

fn try_from(value: &'a str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> StructuralPartialEq for ValidChannels<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ValidChannels<'a>

§

impl<'a> RefUnwindSafe for ValidChannels<'a>

§

impl<'a> Send for ValidChannels<'a>

§

impl<'a> Sync for ValidChannels<'a>

§

impl<'a> Unpin for ValidChannels<'a>

§

impl<'a> UnsafeUnpin for ValidChannels<'a>

§

impl<'a> UnwindSafe for ValidChannels<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.