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>
impl<'a> ValidChannels<'a>
Sourcepub fn new(
count: u32,
spatial_audio: impl Into<EnumeratedStringList<'a, AudioCodingIdentifier>>,
special_usage: impl Into<EnumeratedStringList<'a, ChannelSpecialUsageIdentifier>>,
) -> Self
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<'_>
impl ValidChannels<'_>
Sourcepub fn count(&self) -> u32
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.
Sourcepub fn spatial_audio(&self) -> EnumeratedStringList<'_, AudioCodingIdentifier>
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).
Sourcepub fn special_usage(
&self,
) -> EnumeratedStringList<'_, ChannelSpecialUsageIdentifier>
pub fn special_usage( &self, ) -> EnumeratedStringList<'_, ChannelSpecialUsageIdentifier>
Provides supplementary indications of special channel usage that are necessary for informed selection and processing.
Sourcepub fn unknown_parameters(&self) -> Split<'_, char>
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<'_>
impl AsRef<str> for ValidChannels<'_>
Source§impl<'a> Clone for ValidChannels<'a>
impl<'a> Clone for ValidChannels<'a>
Source§fn clone(&self) -> ValidChannels<'a>
fn clone(&self) -> ValidChannels<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more