X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-duck%2Fsrc%2Fcodecs%2Ftruemotion2x.rs;h=7f4ac524062903d4129f13ea9405faeaeb66437c;hp=22322635a20cd332e9f25e10592b78ad087ddc18;hb=78fb6560c73965d834b215fb0b49505ae5443288;hpb=e12643e6d022aabf97b868f9dc1d8a2d4342043a diff --git a/nihav-duck/src/codecs/truemotion2x.rs b/nihav-duck/src/codecs/truemotion2x.rs index 2232263..7f4ac52 100644 --- a/nihav-duck/src/codecs/truemotion2x.rs +++ b/nihav-duck/src/codecs/truemotion2x.rs @@ -227,7 +227,7 @@ impl TM2XDecoder { br.read_skip(len)?; let _smth = br.read_u32be()?; } - + Ok(()) } fn parse_tabs(&mut self) -> DecoderResult<()> { @@ -275,6 +275,9 @@ impl TM2XDecoder { Ok(()) } + #[allow(clippy::int_plus_one)] + #[allow(clippy::manual_memcpy)] + #[allow(clippy::cyclomatic_complexity)] fn decode_frame(&mut self, src: &[u8]) -> DecoderResult<()> { let mut mr = MemoryReader::new_read(src); let mut br = ByteReader::new(&mut mr); @@ -692,6 +695,12 @@ impl NADecoder for TM2XDecoder { } } +impl NAOptionHandler for TM2XDecoder { + fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] } + fn set_options(&mut self, _options: &[NAOption]) { } + fn query_option_value(&self, _name: &str) -> Option { None } +} + pub fn get_decoder() -> Box { Box::new(TM2XDecoder::new()) } @@ -700,15 +709,15 @@ pub fn get_decoder() -> Box { mod test { use nihav_core::codecs::RegisteredDecoders; use nihav_core::demuxers::RegisteredDemuxers; - use nihav_core::test::dec_video::*; - use crate::codecs::duck_register_all_codecs; - use nihav_commonfmt::demuxers::generic_register_all_demuxers; + use nihav_codec_support::test::dec_video::*; + use crate::duck_register_all_decoders; + use nihav_commonfmt::generic_register_all_demuxers; #[test] fn test_tm2x() { let mut dmx_reg = RegisteredDemuxers::new(); generic_register_all_demuxers(&mut dmx_reg); let mut dec_reg = RegisteredDecoders::new(); - duck_register_all_codecs(&mut dec_reg); + duck_register_all_decoders(&mut dec_reg); test_decoding("avi", "truemotion2x", "assets/Duck/TM2x.avi", None, &dmx_reg, &dec_reg, ExpectedTestResult::MD5Frames(vec![