Trait Frame

Source
pub trait Frame {
Show 18 methods // Required methods fn dts(&self) -> u64; fn pts(&self) -> i64; fn codec(&self) -> Fourcc; fn flags(&self) -> FrameFlags; fn track(&self) -> u32; fn timestamp(&self) -> Option<u64>; fn params(&self) -> impl Iterator<Item = &[u8]>; fn units(&self) -> impl Iterator<Item = &[u8]>; // Provided methods fn is_keyframe(&self) -> bool { ... } fn is_multichannel(&self) -> bool { ... } fn is_compressed(&self) -> bool { ... } fn is_last(&self) -> bool { ... } fn has_params(&self) -> bool { ... } fn has_timestamp(&self) -> bool { ... } fn is_audio(&self) -> bool { ... } fn is_video(&self) -> bool { ... } fn is_metadata(&self) -> bool { ... } fn units_annexb(&self) -> impl Iterator<Item = &[u8]> { ... }
}

Required Methods§

Source

fn dts(&self) -> u64

Decoding timestamp in microseconds (monotonic increasing timestamp starting from 0 (usually) at the first frame)

Source

fn pts(&self) -> i64

Presentation timestamp in microseconds - same as DTS, but with frame presentation offset correction

Source

fn codec(&self) -> Fourcc

Fourcc signature of the payload type

Source

fn flags(&self) -> FrameFlags

Frame Flags (keyframe, last, multitrack, live etc.)

Source

fn track(&self) -> u32

Track Number frame belongs to (always 0 for singletrack)

Source

fn timestamp(&self) -> Option<u64>

The begging of translation timestamp (unixtimespamp in ms from 01:01:1970)

Source

fn params(&self) -> impl Iterator<Item = &[u8]>

Iterator by NAL units of the parameters (for h264/h265 - VPS,SPS,PPS), without annexb prefix

Source

fn units(&self) -> impl Iterator<Item = &[u8]>

Iterator by NAL units without annexb prefix

Provided Methods§

Source

fn is_keyframe(&self) -> bool

true if frame is IDR (not depends on other frames)

Source

fn is_multichannel(&self) -> bool

true if frame is part of multichannel translation

Source

fn is_compressed(&self) -> bool

true if frame is compressed

Source

fn is_last(&self) -> bool

true if frame is last one in the seq

Source

fn has_params(&self) -> bool

frame needs updated decoding params

Source

fn has_timestamp(&self) -> bool

live stream has timestamp of starting of the translation

Source

fn is_audio(&self) -> bool

Audio Frame

Source

fn is_video(&self) -> bool

Video Frame

Source

fn is_metadata(&self) -> bool

Metadata Frame

Source

fn units_annexb(&self) -> impl Iterator<Item = &[u8]>

Iterator by NAL units of the parameters (for h264/h265 - VPS,SPS,PPS), with annexb prefix

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§