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)]
}
/// Decoder trait.
-pub trait NADecoder {
+pub trait NADecoder: NAOptionHandler {
/// Initialises the decoder.
///
/// It takes [`NADecoderSupport`] allocated by the caller and `NACodecInfoRef` provided by demuxer.
fn from(_: ByteIOError) -> Self { EncoderError::Bug }
}
+impl From<AllocatorError> for EncoderError {
+ fn from(_: AllocatorError) -> Self { EncoderError::AllocError }
+}
+
/// Encoding parameter flag to force constant bitrate mode.
pub const ENC_MODE_CBR: u64 = 1 << 0;
/// Encoding parameter flag to force constant framerate mode.
/// [`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.