pub struct TimingInfo {
pub num_units_in_tick: NonZeroU32,
pub time_scale: NonZeroU32,
}
Expand description
TimingInfo
contains the fields that are set when timing_info_present_flag == 1
.
This contains the following fields: num_units_in_tick
and time_scale
.
ISO/IEC-14496-10-2022 - E.2.1
Refer to the direct fields for more information.
Fields§
§num_units_in_tick: NonZeroU32
The num_units_in_tick
is the smallest unit used to measure time.
It is used alongside time_scale
to compute the frame_rate
as follows:
frame_rate = time_scale / (2 * num_units_in_tick)
It must be greater than 0, therefore, it is a NonZeroU32
.
If it is 0, it will fail to parse.
ISO/IEC-14496-10-2022 - E.2.1
time_scale: NonZeroU32
The time_scale
is the number of time units that pass in 1 second (hz).
It is used alongside num_units_in_tick
to compute the frame_rate
as follows:
frame_rate = time_scale / (2 * num_units_in_tick)
It must be greater than 0, therefore, it is a NonZeroU32
.
If it is 0, it will fail to parse.
ISO/IEC-14496-10-2022 - E.2.1
Implementations§
Source§impl TimingInfo
impl TimingInfo
Sourcepub fn parse<T: Read>(reader: &mut BitReader<T>) -> Result<Self>
pub fn parse<T: Read>(reader: &mut BitReader<T>) -> Result<Self>
Parses the fields defined when the timing_info_present_flag == 1
from a bitstream.
Returns a TimingInfo
struct.
Sourcepub fn build<T: Write>(&self, writer: &mut BitWriter<T>) -> Result<()>
pub fn build<T: Write>(&self, writer: &mut BitWriter<T>) -> Result<()>
Builds the TimingInfo struct into a byte stream. Returns a built byte stream.
Sourcepub fn bitsize(&self) -> u64
pub fn bitsize(&self) -> u64
Returns the total bits of the TimingInfo struct. It is always 64 bits (8 bytes).
Sourcepub fn bytesize(&self) -> u64
pub fn bytesize(&self) -> u64
Returns the total bytes of the TimingInfo struct. It is always 8 bytes (64 bits).
Sourcepub fn frame_rate(&self) -> f64
pub fn frame_rate(&self) -> f64
Returns the frame rate of the TimingInfo struct.
Trait Implementations§
Source§impl Clone for TimingInfo
impl Clone for TimingInfo
Source§fn clone(&self) -> TimingInfo
fn clone(&self) -> TimingInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more