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§
Required Methods§
Sourcefn configure(
&mut self,
config: &CodecConfig,
pulse: Option<&dyn Pulse>,
) -> Result<(), SessionError<Self::Error>>
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).
Sourcefn send(
&mut self,
packet: &mut Packet,
pulse: Option<&dyn Pulse>,
) -> Result<SendStatus, SessionError<Self::Error>>
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.
Sourcefn receive(
&mut self,
pulse: Option<&dyn Pulse>,
) -> Result<Receive<Frame>, SessionError<Self::Error>>
fn receive( &mut self, pulse: Option<&dyn Pulse>, ) -> Result<Receive<Frame>, SessionError<Self::Error>>
One frame at a time, in presentation order.
Sourcefn end_input(&mut self) -> Result<(), SessionError<Self::Error>>
fn end_input(&mut self) -> Result<(), SessionError<Self::Error>>
Declare end of input; idempotent. Then receive until EndOfStream.
Sourcefn reset(&mut self) -> Result<(), SessionError<Self::Error>>
fn reset(&mut self) -> Result<(), SessionError<Self::Error>>
Discard queued input, output and references; keep configuration. Frames already returned stay valid.
Sourcefn stream_info(&self) -> Option<&VideoStreamInfo>
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".