Skip to main content

H264Decoder

Struct H264Decoder 

Source
pub struct H264Decoder {
    sps: Option<Sps>,
    pps: Option<Pps>,
    width: u32,
    height: u32,
}

Fields§

§sps: Option<Sps>§pps: Option<Pps>§width: u32§height: u32

Implementations§

Source§

impl H264Decoder

Source

pub fn new() -> Self

Source

pub fn set_parameter_sets( &mut self, sps_payloads: &[Vec<u8>], pps_payloads: &[Vec<u8>], )

avcC 由来の SPS/PPS を事前登録する(MP4 経路用)。

Source

pub fn decode_nal( &mut self, nal_data: &[u8], ) -> Result<DecodedVideoFrame, &'static str>

1つの NAL(Annex-B でも AVCC 単体でも、先頭にスタートコードがあれば剥がす)を処理。 互換性のため従来シグネチャを維持。

Source

pub fn decode_access_unit_avcc( &mut self, sample: &[u8], length_size: usize, ) -> Option<DecodedVideoFrame>

AVCC(長さ前置)の1サンプル=アクセスユニットを処理し、含まれる picture を返す。 MP4 経路ではこちらを使う(SPS/PPS は事前に set_parameter_sets 済みが前提だが、 in-band の SPS/PPS が来た場合もここで取り込む)。

Source

fn decode_slice( &mut self, _rbsp: &[u8], _is_idr: bool, ) -> Result<DecodedVideoFrame, &'static str>

Trait Implementations§

Source§

impl Default for H264Decoder

Source§

fn default() -> Self

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.