Skip to main content

ToyDecoder

Struct ToyDecoder 

Source
pub struct ToyDecoder { /* private fields */ }
Expand description

Toy decoder. Pictures come out one packet late (a one-packet reorder), so output trails input; a show-existing flag re-presents the previous picture. Holds at most max_queued_frames before pushing back.

Implementations§

Source§

impl ToyDecoder

Source

pub fn new(max_queued_frames: usize) -> Self

A decoder holding at most max_queued_frames (at least 1) frames.

Trait Implementations§

Source§

impl VideoDecoder for ToyDecoder

Source§

type Error = ToyError

The implementation’s error.
Source§

fn configure( &mut self, config: &CodecConfig, stop: Option<&dyn Pulse>, ) -> Result<(), SessionError<ToyError>>

Start a configuration epoch. Called before the first send and on every epoch change (new sequence header, new stsd entry).
Source§

fn send( &mut self, packet: &mut Packet, stop: Option<&dyn Pulse>, ) -> Result<SendStatus, SessionError<ToyError>>

Offer one packet. Accepted takes its payload; ReceivePending leaves it intact for retry after receive.
Source§

fn receive( &mut self, stop: Option<&dyn Pulse>, ) -> Result<Receive<Frame>, SessionError<ToyError>>

One frame at a time, in presentation order.
Source§

fn end_input(&mut self) -> Result<(), SessionError<ToyError>>

Declare end of input; idempotent. Then receive until EndOfStream.
Source§

fn reset(&mut self) -> Result<(), SessionError<ToyError>>

Discard queued input, output and references; keep configuration. Frames already returned stay valid.
Source§

fn stream_info(&self) -> Option<&VideoStreamInfo>

Facts about the stream seen so far.

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, 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.