diff --git a/src/codec/decoder/check.rs b/src/codec/decoder/check.rs new file mode 100644 index 0000000..e705511 --- /dev/null +++ b/src/codec/decoder/check.rs @@ -0,0 +1,16 @@ +use libc::c_int; +use ffi::*; + +bitflags! { + flags Check: c_int { + const CHECK_CRC = AV_EF_CRCCHECK, + const CHECK_BISTREAM = AV_EF_BITSTREAM, + const CHECK_BUFFER = AV_EF_BUFFER, + const CHECK_EXPLODE = AV_EF_EXPLODE, + + const CHECK_IGNORE_ERROR = AV_EF_IGNORE_ERR, + const CHECK_CAREFUL = AV_EF_CAREFUL, + const CHECK_COMPLIANT = AV_EF_COMPLIANT, + const CHECK_AGGRESSIVE = AV_EF_AGGRESSIVE, + } +} diff --git a/src/codec/decoder/mod.rs b/src/codec/decoder/mod.rs index 8eaa006..62c652d 100644 --- a/src/codec/decoder/mod.rs +++ b/src/codec/decoder/mod.rs @@ -12,6 +12,9 @@ pub mod slice; pub mod conceal; pub use self::conceal::*; +pub mod check; +pub use self::check::*; + use std::ffi::CString; use std::ptr; use std::ops::Deref; @@ -57,6 +60,12 @@ impl Decoder { (*self.ptr).error_concealment = value.bits(); } } + + pub fn check(&mut self, value: Check) { + unsafe { + (*self.ptr).err_recognition = value.bits(); + } + } } impl Deref for Decoder {