Files
wz-phone/crates/wzp-video/src/decoder.rs
Siavash Sameni e8f139588a
Some checks failed
Mirror to GitHub / mirror (push) Failing after 26s
Build Release Binaries / build-amd64 (push) Failing after 3m30s
chore(video): sample decoded frames periodically
2026-05-25 21:14:32 +04:00

21 lines
732 B
Rust

//! Video decoder trait and platform implementations.
use crate::encoder::{VideoError, VideoFrame};
/// Trait for video decoders.
///
/// Implementations are platform-specific (VideoToolbox on macOS, MediaCodec on
/// Android, OpenH264 as software fallback).
pub trait VideoDecoder: Send {
/// Decode one H.264 access unit into a raw video frame.
///
/// Returns `Ok(Some(frame))` when a frame is ready, `Ok(None)` if more
/// data is needed (e.g., for reordering), or an error.
fn decode(&mut self, access_unit: &[u8]) -> Result<Option<VideoFrame>, VideoError>;
/// Compact implementation-specific state useful for field diagnostics.
fn debug_snapshot(&self) -> Option<String> {
None
}
}