use crate::export::{EncodeError, VideoEncoder};
pub struct WebCodecsVideoEncoder {
started: bool,
}
impl WebCodecsVideoEncoder {
pub fn new() -> Self {
Self { started: false }
}
}
impl VideoEncoder for WebCodecsVideoEncoder {
fn begin(&mut self, _width: u32, _height: u32, _fps: f32) -> Result<(), EncodeError> {
self.started = true;
Err(EncodeError::NotImplemented(
"WebCodecs encoder is not yet implemented".to_string(),
))
}
fn push_frame(&mut self, _frame_index: u32, _rgba: &[u8]) -> Result<(), EncodeError> {
if !self.started {
return Err(EncodeError::NotStarted);
}
Ok(())
}
fn finish(&mut self) -> Result<(), EncodeError> {
if !self.started {
return Err(EncodeError::NotStarted);
}
Ok(())
}
}