]> git.nihav.org Git - nihav.git/blobdiff - nihav-core/src/codecs/mod.rs
remove trailing whitespaces
[nihav.git] / nihav-core / src / codecs / mod.rs
index 5470325d08e72cf94ebf55c70e05e7a636230d2d..43abbfd12ebd92209d7553ed9e327f678f9935ae 100644 (file)
@@ -3,6 +3,7 @@ pub use crate::frame::*;
 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)]
@@ -76,7 +77,7 @@ impl Default for NADecoderSupport {
 }
 
 /// Decoder trait.
-pub trait NADecoder {
+pub trait NADecoder: NAOptionHandler {
     /// Initialises the decoder.
     ///
     /// It takes [`NADecoderSupport`] allocated by the caller and `NACodecInfoRef` provided by demuxer.
@@ -157,6 +158,10 @@ impl From<ByteIOError> for EncoderError {
     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.
@@ -231,7 +236,7 @@ impl Default for EncodeParameters {
 /// [`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.