Skip to main content

VideoDecoder

Trait VideoDecoder 

Source
pub trait VideoDecoder {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn configure(
        &mut self,
        config: &CodecConfig,
        pulse: Option<&dyn Pulse>,
    ) -> Result<(), SessionError<Self::Error>>;
    fn send(
        &mut self,
        packet: &mut Packet,
        pulse: Option<&dyn Pulse>,
    ) -> Result<SendStatus, SessionError<Self::Error>>;
    fn receive(
        &mut self,
        pulse: Option<&dyn Pulse>,
    ) -> Result<Receive<Frame>, SessionError<Self::Error>>;
    fn end_input(&mut self) -> Result<(), SessionError<Self::Error>>;
    fn reset(&mut self) -> Result<(), SessionError<Self::Error>>;
    fn stream_info(&self) -> Option<&VideoStreamInfo>;
}
Expand description

A video decoder session: packets in, frames out, in presentation order. See the module docs for the protocol.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The implementation’s error.

Required Methods§

Source

fn configure( &mut self, config: &CodecConfig, pulse: Option<&dyn Pulse>, ) -> Result<(), SessionError<Self::Error>>

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, pulse: Option<&dyn Pulse>, ) -> Result<SendStatus, SessionError<Self::Error>>

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

Source

fn receive( &mut self, pulse: Option<&dyn Pulse>, ) -> Result<Receive<Frame>, SessionError<Self::Error>>

One frame at a time, in presentation order.

Source

fn end_input(&mut self) -> Result<(), SessionError<Self::Error>>

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

Source

fn reset(&mut self) -> Result<(), SessionError<Self::Error>>

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<D: VideoDecoder + ?Sized> VideoDecoder for Box<D>

Source§

type Error = <D as VideoDecoder>::Error

Source§

fn configure( &mut self, config: &CodecConfig, pulse: Option<&dyn Pulse>, ) -> Result<(), SessionError<D::Error>>

Source§

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

Source§

fn receive( &mut self, pulse: Option<&dyn Pulse>, ) -> Result<Receive<Frame>, SessionError<D::Error>>

Source§

fn end_input(&mut self) -> Result<(), SessionError<D::Error>>

Source§

fn reset(&mut self) -> Result<(), SessionError<D::Error>>

Source§

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

Implementors§