aac: clear M/S flags
[nihav.git] / nihav-itu / src / codecs / mod.rs
index ac1f7d6d68aec57ea6fc6d4a8a32ca73363fb4a4..2014f0af26ea8e2183c9f22cc58a53203f9d1aa5 100644 (file)
@@ -1,10 +1,16 @@
 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")]
@@ -21,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);
+    }
+}