pub struct StreamFormat(pub u64);Expand description
A stream format, kept as its 64 bits.
Tuple Fields§
§0: u64Implementations§
Source§impl StreamFormat
impl StreamFormat
pub fn kind(self) -> FormatKind
Sourcepub fn sample_rate(self) -> Option<u32>
pub fn sample_rate(self) -> Option<u32>
The nominal sample or clock rate in hertz, where the format gives one.
Sourcepub fn is_class_b(self) -> bool
pub fn is_class_b(self) -> bool
Whether a stream in it is SR class B’s: AAF whose frames each hold a class B interval’s samples, 4000 frames a second. Others go one frame each class A interval, as Milan’s do, or slower, as a media clock’s.
Sourcepub fn wire_bandwidth(self) -> Option<u64>
pub fn wire_bandwidth(self) -> Option<u64>
The bandwidth the stream takes on an Ethernet link in bits per
second, frames counted with their preamble, VLAN tag, frame check
and gap: AAF and AM824 sent 8000 times a second as class A sends
them, CRF as often as its timestamps fill a frame. None for a
format whose frame size is not known.
Sourcepub fn same_but_rate(self, other: StreamFormat) -> bool
pub fn same_but_rate(self, other: StreamFormat) -> bool
Whether two audio formats pack samples alike but for their rate: the same AAF sample format, depth and channels sent as many frames a second, so in the same SR class, or the same IEC 61883-6 packing, quadlets and labels. An entity changing its sampling rate moves its streams to the format that matches this way.
Sourcepub fn same_but_rate_and_channels(self, other: StreamFormat) -> bool
pub fn same_but_rate_and_channels(self, other: StreamFormat) -> bool
Whether two audio formats pack samples alike but for their rate
and channels: as same_but_rate has it,
whatever their channels, or their quadlets and labels in IEC
61883-6. An entity changing its sampling rate falls back on it for
a stream whose channels take more than a frame at the new rate.
Sourcepub fn suits(self, listener: StreamFormat) -> bool
pub fn suits(self, listener: StreamFormat) -> bool
Whether a stream in self, a talker’s current format, can be
received by a stream input that supports listener: the same
format, or one the listener takes with fewer channels.
Sourcepub fn admits(self, set: StreamFormat) -> bool
pub fn admits(self, set: StreamFormat) -> bool
Whether a stream may be set to set where self is one of its
formats: self itself, or, self being an up-to format, self
with as many channels or fewer, the up-to flag set or not, as a
controller adapts it to a talker (IEEE 1722.1-2021, 7.3.3).
Sourcepub fn adapted(self, like: StreamFormat) -> StreamFormat
pub fn adapted(self, like: StreamFormat) -> StreamFormat
self adapted as like is: its channels and up-to flag, and in IEC
61883-6 its quadlets and labels, the rest self’s.