pub trait VideoDecoderBackend: Send {
// Required methods
fn backend_kind(&self) -> HardwareDecoderKind;
fn capabilities(&self) -> HardwareDecoderCapabilities;
fn configure(&mut self, config: &VideoDecoderConfig) -> Result<(), String>;
fn decode_packet(
&mut self,
packet: &EncodedVideoPacket,
pool: &VideoFramePool,
) -> Result<Option<DecodedVideoFrame>, String>;
fn flush(&mut self);
}Expand description
Pluggable hardware or software video decoder backend interface.
Required Methods§
Sourcefn backend_kind(&self) -> HardwareDecoderKind
fn backend_kind(&self) -> HardwareDecoderKind
Sourcefn capabilities(&self) -> HardwareDecoderCapabilities
fn capabilities(&self) -> HardwareDecoderCapabilities
Sourcefn decode_packet(
&mut self,
packet: &EncodedVideoPacket,
pool: &VideoFramePool,
) -> Result<Option<DecodedVideoFrame>, String>
fn decode_packet( &mut self, packet: &EncodedVideoPacket, pool: &VideoFramePool, ) -> Result<Option<DecodedVideoFrame>, String>
Decodes a single demuxed packet into an optional decoded video frame backed by GPU surface or pooled CPU memory.
§Arguments
&Self- Mutable decoder backend.&EncodedVideoPacket- Demuxed compressed or structured frame packet with DTS/PTS and generation tag.&VideoFramePool- Bounded CPU pixel buffer pool for software fallback frames.
§Returns
Result<Option<DecodedVideoFrame>, String>- Decoded frame ready for the PTS queue,Nonewhen buffered internally, or error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl VideoDecoderBackend for HardwareZeroCopyDecoder
Zero-copy GPU surface VideoDecoderBackend implementation for HardwareZeroCopyDecoder.
impl VideoDecoderBackend for SoftwareVideoDecoder
Pure-Rust software fallback VideoDecoderBackend implementation for SoftwareVideoDecoder.