Skip to main content

Fmp4Demuxer

Struct Fmp4Demuxer 

Source
pub struct Fmp4Demuxer {
    pub tracks: Vec<TrackInfo>,
    buf: Vec<u8>,
    buf_pos: u64,
    pending: Vec<PendingSample>,
    next_dts: Vec<(u32, u64)>,
}
Expand description

fMP4 デマルチプレクサ。バイト列を順に push する。

Fields§

§tracks: Vec<TrackInfo>§buf: Vec<u8>

まだ完結していないボックスのバイト列(buf_pos はその先頭のストリーム上の位置)。

§buf_pos: u64§pending: Vec<PendingSample>

直前の moof から求めたサンプル(次の mdat で中身を取り出す)。

§next_dts: Vec<(u32, u64)>

トラックごとの次の復号時刻(tfdt が無いフラグメントの続きに使う)。

Implementations§

Source§

impl Fmp4Demuxer

Source

pub fn new() -> Self

Source

pub fn track(&self, id: u32) -> Option<&TrackInfo>

Source

pub fn push(&mut self, bytes: &[u8]) -> Result<Vec<FragSample>, &'static str>

バイト列を追加し、取り出せたサンプル(復号順)を返す。

Source

fn parse_moov(&mut self, moov: &[u8]) -> Result<(), &'static str>

Source

fn parse_moof(&mut self, moof: &[u8], moof_pos: u64) -> Result<(), &'static str>

moof(moof_pos はその先頭のストリーム上の位置)から各サンプルの位置と時刻を求める。

Source

fn take_mdat(&mut self, mdat: &[u8], data_pos: u64, out: &mut Vec<FragSample>)

mdat(中身の先頭が data_pos)から、直前の moof のサンプルを取り出す。

Trait Implementations§

Source§

impl Default for Fmp4Demuxer

Source§

fn default() -> Fmp4Demuxer

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> 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> Same for T

Source§

type Output = T

Should always be Self
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.