use crate::io::byteio::ByteIOError;
use crate::io::bitreader::BitReaderError;
use crate::io::codebook::CodebookError;
+pub use crate::options::*;
/// A list specifying general decoding errors.
#[derive(Debug,Clone,Copy,PartialEq)]
/// [`negotiate_format`]: ./trait.NAEncoder.html#tymethod.negotiate_format
/// [`encode`]: ./trait.NAEncoder.html#tymethod.encode
/// [`get_packet`]: ./trait.NAEncoder.html#tymethod.get_packet
-pub trait NAEncoder {
+pub trait NAEncoder: NAOptionHandler {
/// Tries to negotiate input format.
///
/// This function takes input encoding parameters and returns adjusted encoding parameters if input ones make sense.
}
}
+impl NAOptionHandler for MSADPCMEncoder {
+ fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+ fn set_options(&mut self, _options: &[NAOption]) { }
+ fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
pub fn get_encoder() -> Box<dyn NAEncoder + Send> {
Box::new(MSADPCMEncoder::new())
}
}
}
+impl NAOptionHandler for MSVideo1Encoder {
+ fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+ fn set_options(&mut self, _options: &[NAOption]) { }
+ fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
pub fn get_encoder() -> Box<dyn NAEncoder + Send> {
Box::new(MSVideo1Encoder::new())
}