aac: clear M/S flags
[nihav.git] / nihav-itu / src / codecs / mod.rs
index efb24bc2b99e81d578fc33121be391846a2acade..2014f0af26ea8e2183c9f22cc58a53203f9d1aa5 100644 (file)
@@ -1,10 +1,18 @@
 use nihav_core::codecs::*;
 
+#[cfg(debug_assertions)]
 macro_rules! validate {
     ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DecoderError::InvalidData); } };
 }
+#[cfg(not(debug_assertions))]
+macro_rules! validate {
+    ($a:expr) => { if !$a { return Err(DecoderError::InvalidData); } };
+}
 
+#[allow(clippy::collapsible_else_if)]
+#[allow(clippy::manual_range_contains)]
 #[allow(clippy::too_many_arguments)]
+#[allow(clippy::upper_case_acronyms)]
 #[cfg(feature="decoder_h264")]
 mod h264;
 
@@ -19,3 +27,15 @@ pub fn itu_register_all_decoders(rd: &mut RegisteredDecoders) {
         rd.add_decoder(*decoder);
     }
 }
+
+const ITU_MT_CODECS: &[MTDecoderInfo] = &[
+#[cfg(feature="decoder_h264")]
+    MTDecoderInfo { name: "h264", get_decoder: h264::get_decoder_mt },
+];
+
+/// Registers all available multi-threaded decoders provided by this crate.
+pub fn itu_register_all_mt_decoders(rd: &mut RegisteredMTDecoders) {
+    for decoder in ITU_MT_CODECS.iter() {
+        rd.add_decoder(*decoder);
+    }
+}