From 7d57ae2f680d7a1eba7af2ee831f305b2f0f9324 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Mon, 1 Jun 2020 11:52:15 +0200 Subject: [PATCH] introduce option handling for decoders --- nihav-commonfmt/src/codecs/aac.rs | 6 ++++++ nihav-commonfmt/src/codecs/atrac3.rs | 6 ++++++ nihav-commonfmt/src/codecs/cinepak.rs | 6 ++++++ nihav-commonfmt/src/codecs/clearvideo.rs | 6 ++++++ nihav-commonfmt/src/codecs/pcm.rs | 6 ++++++ nihav-commonfmt/src/codecs/sipro.rs | 6 ++++++ nihav-commonfmt/src/codecs/ts102366.rs | 6 ++++++ nihav-core/src/codecs/mod.rs | 2 +- nihav-duck/src/codecs/dkadpcm.rs | 6 ++++++ nihav-duck/src/codecs/on2avc.rs | 6 ++++++ nihav-duck/src/codecs/truemotion1.rs | 6 ++++++ nihav-duck/src/codecs/truemotion2.rs | 6 ++++++ nihav-duck/src/codecs/truemotion2x.rs | 6 ++++++ nihav-duck/src/codecs/truemotionrt.rs | 6 ++++++ nihav-duck/src/codecs/vp3.rs | 6 ++++++ nihav-duck/src/codecs/vp5.rs | 6 ++++++ nihav-duck/src/codecs/vp6.rs | 6 ++++++ nihav-duck/src/codecs/vp7.rs | 6 ++++++ nihav-game/src/codecs/bmv.rs | 12 ++++++++++++ nihav-game/src/codecs/bmv3.rs | 12 ++++++++++++ nihav-game/src/codecs/gremlinvideo.rs | 12 ++++++++++++ nihav-game/src/codecs/lhst500f22.rs | 6 ++++++ nihav-game/src/codecs/midivid.rs | 6 ++++++ nihav-game/src/codecs/midivid3.rs | 6 ++++++ nihav-game/src/codecs/vmd.rs | 12 ++++++++++++ nihav-indeo/src/codecs/imc.rs | 6 ++++++ nihav-indeo/src/codecs/indeo2.rs | 6 ++++++ nihav-indeo/src/codecs/indeo3.rs | 6 ++++++ nihav-indeo/src/codecs/indeo4.rs | 6 ++++++ nihav-indeo/src/codecs/indeo5.rs | 6 ++++++ nihav-indeo/src/codecs/intel263.rs | 6 ++++++ nihav-ms/src/codecs/imaadpcm.rs | 6 ++++++ nihav-ms/src/codecs/msadpcm.rs | 6 ++++++ nihav-ms/src/codecs/msvideo1.rs | 6 ++++++ nihav-rad/src/codecs/bink2.rs | 6 ++++++ nihav-rad/src/codecs/binkaud.rs | 6 ++++++ nihav-rad/src/codecs/binkvid.rs | 6 ++++++ nihav-rad/src/codecs/smacker.rs | 12 ++++++++++++ nihav-realmedia/src/codecs/cook.rs | 6 ++++++ nihav-realmedia/src/codecs/ra144.rs | 6 ++++++ nihav-realmedia/src/codecs/ra288.rs | 6 ++++++ nihav-realmedia/src/codecs/ralf.rs | 6 ++++++ nihav-realmedia/src/codecs/rv10.rs | 6 ++++++ nihav-realmedia/src/codecs/rv20.rs | 6 ++++++ nihav-realmedia/src/codecs/rv30.rs | 6 ++++++ nihav-realmedia/src/codecs/rv40.rs | 6 ++++++ nihav-realmedia/src/codecs/rv60.rs | 7 +++++++ nihav-vivo/src/codecs/g723_1.rs | 6 ++++++ nihav-vivo/src/codecs/siren.rs | 6 ++++++ nihav-vivo/src/codecs/vivo.rs | 6 ++++++ 50 files changed, 326 insertions(+), 1 deletion(-) diff --git a/nihav-commonfmt/src/codecs/aac.rs b/nihav-commonfmt/src/codecs/aac.rs index 6de5a96..0c65d50 100644 --- a/nihav-commonfmt/src/codecs/aac.rs +++ b/nihav-commonfmt/src/codecs/aac.rs @@ -1258,6 +1258,12 @@ impl NADecoder for AACDecoder { } } +impl NAOptionHandler for AACDecoder { + 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(AACDecoder::new()) } diff --git a/nihav-commonfmt/src/codecs/atrac3.rs b/nihav-commonfmt/src/codecs/atrac3.rs index 44f49f7..b74c533 100644 --- a/nihav-commonfmt/src/codecs/atrac3.rs +++ b/nihav-commonfmt/src/codecs/atrac3.rs @@ -695,6 +695,12 @@ impl NADecoder for Atrac3Decoder { } } +impl NAOptionHandler for Atrac3Decoder { + 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(Atrac3Decoder::new()) } diff --git a/nihav-commonfmt/src/codecs/cinepak.rs b/nihav-commonfmt/src/codecs/cinepak.rs index b3e1b18..5f03e14 100644 --- a/nihav-commonfmt/src/codecs/cinepak.rs +++ b/nihav-commonfmt/src/codecs/cinepak.rs @@ -380,6 +380,12 @@ impl NADecoder for CinepakDecoder { } } +impl NAOptionHandler for CinepakDecoder { + 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(CinepakDecoder::new()) } diff --git a/nihav-commonfmt/src/codecs/clearvideo.rs b/nihav-commonfmt/src/codecs/clearvideo.rs index 4236ae0..3d0f7bc 100644 --- a/nihav-commonfmt/src/codecs/clearvideo.rs +++ b/nihav-commonfmt/src/codecs/clearvideo.rs @@ -707,6 +707,12 @@ impl NADecoder for ClearVideoDecoder { } } +impl NAOptionHandler for ClearVideoDecoder { + 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(ClearVideoDecoder::new(false)) } diff --git a/nihav-commonfmt/src/codecs/pcm.rs b/nihav-commonfmt/src/codecs/pcm.rs index 13eee09..b4ded87 100644 --- a/nihav-commonfmt/src/codecs/pcm.rs +++ b/nihav-commonfmt/src/codecs/pcm.rs @@ -60,6 +60,12 @@ impl NADecoder for PCMDecoder { } } +impl NAOptionHandler for PCMDecoder { + 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(PCMDecoder::new()) } diff --git a/nihav-commonfmt/src/codecs/sipro.rs b/nihav-commonfmt/src/codecs/sipro.rs index f52fa31..03cd762 100644 --- a/nihav-commonfmt/src/codecs/sipro.rs +++ b/nihav-commonfmt/src/codecs/sipro.rs @@ -736,6 +736,12 @@ impl NADecoder for SiproDecoder { } } +impl NAOptionHandler for SiproDecoder { + 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(SiproDecoder::new()) } diff --git a/nihav-commonfmt/src/codecs/ts102366.rs b/nihav-commonfmt/src/codecs/ts102366.rs index 4f270cc..25f342b 100644 --- a/nihav-commonfmt/src/codecs/ts102366.rs +++ b/nihav-commonfmt/src/codecs/ts102366.rs @@ -1240,6 +1240,12 @@ impl NADecoder for AudioDecoder { } } +impl NAOptionHandler for AudioDecoder { + 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(AudioDecoder::new()) } diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index 86441e6..516d9ac 100644 --- a/nihav-core/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -77,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. diff --git a/nihav-duck/src/codecs/dkadpcm.rs b/nihav-duck/src/codecs/dkadpcm.rs index 65576e8..be128db 100644 --- a/nihav-duck/src/codecs/dkadpcm.rs +++ b/nihav-duck/src/codecs/dkadpcm.rs @@ -140,6 +140,12 @@ impl NADecoder for DuckADPCMDecoder { } } +impl NAOptionHandler for DuckADPCMDecoder { + 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_dk3() -> Box { Box::new(DuckADPCMDecoder::new(true)) } diff --git a/nihav-duck/src/codecs/on2avc.rs b/nihav-duck/src/codecs/on2avc.rs index f3e757d..2cd7a88 100644 --- a/nihav-duck/src/codecs/on2avc.rs +++ b/nihav-duck/src/codecs/on2avc.rs @@ -1048,6 +1048,12 @@ impl NADecoder for AVCDecoder { } } +impl NAOptionHandler for AVCDecoder { + 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_500() -> Box { Box::new(AVCDecoder::new(500)) } diff --git a/nihav-duck/src/codecs/truemotion1.rs b/nihav-duck/src/codecs/truemotion1.rs index 29d85ac..b95b410 100644 --- a/nihav-duck/src/codecs/truemotion1.rs +++ b/nihav-duck/src/codecs/truemotion1.rs @@ -659,6 +659,12 @@ impl NADecoder for TM1Decoder { } } +impl NAOptionHandler for TM1Decoder { + 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(TM1Decoder::new()) } diff --git a/nihav-duck/src/codecs/truemotion2.rs b/nihav-duck/src/codecs/truemotion2.rs index 8be4561..d0ef793 100644 --- a/nihav-duck/src/codecs/truemotion2.rs +++ b/nihav-duck/src/codecs/truemotion2.rs @@ -581,6 +581,12 @@ impl NADecoder for TM2Decoder { } } +impl NAOptionHandler for TM2Decoder { + 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(TM2Decoder::new()) } diff --git a/nihav-duck/src/codecs/truemotion2x.rs b/nihav-duck/src/codecs/truemotion2x.rs index 586c26e..e2325ab 100644 --- a/nihav-duck/src/codecs/truemotion2x.rs +++ b/nihav-duck/src/codecs/truemotion2x.rs @@ -692,6 +692,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()) } diff --git a/nihav-duck/src/codecs/truemotionrt.rs b/nihav-duck/src/codecs/truemotionrt.rs index 1bbcb0f..554715f 100644 --- a/nihav-duck/src/codecs/truemotionrt.rs +++ b/nihav-duck/src/codecs/truemotionrt.rs @@ -84,6 +84,12 @@ impl NADecoder for TMRTDecoder { } } +impl NAOptionHandler for TMRTDecoder { + 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(TMRTDecoder::new()) } diff --git a/nihav-duck/src/codecs/vp3.rs b/nihav-duck/src/codecs/vp3.rs index c33f97b..e456cfa 100644 --- a/nihav-duck/src/codecs/vp3.rs +++ b/nihav-duck/src/codecs/vp3.rs @@ -1864,6 +1864,12 @@ impl NADecoder for VP34Decoder { } } +impl NAOptionHandler for VP34Decoder { + 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_vp3() -> Box { Box::new(VP34Decoder::new(3)) } diff --git a/nihav-duck/src/codecs/vp5.rs b/nihav-duck/src/codecs/vp5.rs index eb39468..179227a 100644 --- a/nihav-duck/src/codecs/vp5.rs +++ b/nihav-duck/src/codecs/vp5.rs @@ -278,6 +278,12 @@ impl NADecoder for VP5Decoder { } } +impl NAOptionHandler for VP5Decoder { + 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(VP5Decoder::new()) } diff --git a/nihav-duck/src/codecs/vp6.rs b/nihav-duck/src/codecs/vp6.rs index 241a13a..4f014fa 100644 --- a/nihav-duck/src/codecs/vp6.rs +++ b/nihav-duck/src/codecs/vp6.rs @@ -715,6 +715,12 @@ impl NADecoder for VP6Decoder { } } +impl NAOptionHandler for VP6Decoder { + 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_vp6() -> Box { Box::new(VP6Decoder::new(false)) } diff --git a/nihav-duck/src/codecs/vp7.rs b/nihav-duck/src/codecs/vp7.rs index 9e34150..4d300cc 100644 --- a/nihav-duck/src/codecs/vp7.rs +++ b/nihav-duck/src/codecs/vp7.rs @@ -1423,6 +1423,12 @@ impl NADecoder for VP7Decoder { } } +impl NAOptionHandler for VP7Decoder { + 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(VP7Decoder::new()) } diff --git a/nihav-game/src/codecs/bmv.rs b/nihav-game/src/codecs/bmv.rs index e94fbaf..2e42390 100644 --- a/nihav-game/src/codecs/bmv.rs +++ b/nihav-game/src/codecs/bmv.rs @@ -220,6 +220,12 @@ impl NADecoder for BMVVideoDecoder { } } +impl NAOptionHandler for BMVVideoDecoder { + 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_video() -> Box { Box::new(BMVVideoDecoder::new()) @@ -299,6 +305,12 @@ impl NADecoder for BMVAudioDecoder { } } +impl NAOptionHandler for BMVAudioDecoder { + 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_audio() -> Box { Box::new(BMVAudioDecoder::new()) } diff --git a/nihav-game/src/codecs/bmv3.rs b/nihav-game/src/codecs/bmv3.rs index 5921205..a9d7f71 100644 --- a/nihav-game/src/codecs/bmv3.rs +++ b/nihav-game/src/codecs/bmv3.rs @@ -503,6 +503,12 @@ impl NADecoder for BMV3VideoDecoder { } } +impl NAOptionHandler for BMV3VideoDecoder { + 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_video() -> Box { Box::new(BMV3VideoDecoder::new()) @@ -595,6 +601,12 @@ impl NADecoder for BMV3AudioDecoder { } } +impl NAOptionHandler for BMV3AudioDecoder { + 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_audio() -> Box { Box::new(BMV3AudioDecoder::new()) } diff --git a/nihav-game/src/codecs/gremlinvideo.rs b/nihav-game/src/codecs/gremlinvideo.rs index c8059fa..73f4225 100644 --- a/nihav-game/src/codecs/gremlinvideo.rs +++ b/nihav-game/src/codecs/gremlinvideo.rs @@ -460,6 +460,12 @@ impl NADecoder for GremlinVideoDecoder { } } +impl NAOptionHandler for GremlinVideoDecoder { + 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_video() -> Box { Box::new(GremlinVideoDecoder::new()) } @@ -554,6 +560,12 @@ impl NADecoder for GremlinAudioDecoder { } } +impl NAOptionHandler for GremlinAudioDecoder { + 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_audio() -> Box { Box::new(GremlinAudioDecoder::new()) } diff --git a/nihav-game/src/codecs/lhst500f22.rs b/nihav-game/src/codecs/lhst500f22.rs index eea2c9f..e3535f5 100644 --- a/nihav-game/src/codecs/lhst500f22.rs +++ b/nihav-game/src/codecs/lhst500f22.rs @@ -418,6 +418,12 @@ impl NADecoder for LHDecoder { } } +impl NAOptionHandler for LHDecoder { + 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(LHDecoder::new()) } diff --git a/nihav-game/src/codecs/midivid.rs b/nihav-game/src/codecs/midivid.rs index 1234426..74ec75f 100644 --- a/nihav-game/src/codecs/midivid.rs +++ b/nihav-game/src/codecs/midivid.rs @@ -175,6 +175,12 @@ impl NADecoder for MidividDecoder { } } +impl NAOptionHandler for MidividDecoder { + 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_video() -> Box { Box::new(MidividDecoder::new()) diff --git a/nihav-game/src/codecs/midivid3.rs b/nihav-game/src/codecs/midivid3.rs index d65e448..7ffb045 100644 --- a/nihav-game/src/codecs/midivid3.rs +++ b/nihav-game/src/codecs/midivid3.rs @@ -509,6 +509,12 @@ impl NADecoder for Midivid3Decoder { } } +impl NAOptionHandler for Midivid3Decoder { + 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_video() -> Box { Box::new(Midivid3Decoder::new()) diff --git a/nihav-game/src/codecs/vmd.rs b/nihav-game/src/codecs/vmd.rs index 65d5de3..939dcd6 100644 --- a/nihav-game/src/codecs/vmd.rs +++ b/nihav-game/src/codecs/vmd.rs @@ -335,6 +335,12 @@ impl NADecoder for VMDVideoDecoder { } } +impl NAOptionHandler for VMDVideoDecoder { + 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_video() -> Box { Box::new(VMDVideoDecoder::new()) @@ -667,6 +673,12 @@ impl NADecoder for VMDAudioDecoder { } } +impl NAOptionHandler for VMDAudioDecoder { + 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_audio() -> Box { Box::new(VMDAudioDecoder::new()) } diff --git a/nihav-indeo/src/codecs/imc.rs b/nihav-indeo/src/codecs/imc.rs index 8d8f103..c766861 100644 --- a/nihav-indeo/src/codecs/imc.rs +++ b/nihav-indeo/src/codecs/imc.rs @@ -926,6 +926,12 @@ impl NADecoder for IMCDecoder { } } +impl NAOptionHandler for IMCDecoder { + 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_imc() -> Box { Box::new(IMCDecoder::new(true)) } diff --git a/nihav-indeo/src/codecs/indeo2.rs b/nihav-indeo/src/codecs/indeo2.rs index 14d3c0a..38079ce 100644 --- a/nihav-indeo/src/codecs/indeo2.rs +++ b/nihav-indeo/src/codecs/indeo2.rs @@ -365,6 +365,12 @@ impl NADecoder for Indeo2Decoder { } } +impl NAOptionHandler for Indeo2Decoder { + 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(Indeo2Decoder::new()) } diff --git a/nihav-indeo/src/codecs/indeo3.rs b/nihav-indeo/src/codecs/indeo3.rs index 2f9b16c..224c3ec 100644 --- a/nihav-indeo/src/codecs/indeo3.rs +++ b/nihav-indeo/src/codecs/indeo3.rs @@ -792,6 +792,12 @@ impl NADecoder for Indeo3Decoder { } } +impl NAOptionHandler for Indeo3Decoder { + 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(Indeo3Decoder::new()) } diff --git a/nihav-indeo/src/codecs/indeo4.rs b/nihav-indeo/src/codecs/indeo4.rs index c035eec..879f850 100644 --- a/nihav-indeo/src/codecs/indeo4.rs +++ b/nihav-indeo/src/codecs/indeo4.rs @@ -461,6 +461,12 @@ impl NADecoder for Indeo4Decoder { } } +impl NAOptionHandler for Indeo4Decoder { + fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] } + fn set_options(&mut self, _options: &[NAOption]) { } + fn query_option_value(&self, _name: &str) -> Option { None } +} + const INDEO4_PICTURE_SIZE_TAB: [[usize; 2]; 7] = [ [640, 480], [320, 240], [160, 120], [704, 480], [352, 240], [352, 288], [176, 144] ]; diff --git a/nihav-indeo/src/codecs/indeo5.rs b/nihav-indeo/src/codecs/indeo5.rs index 2ae5295..c1c7cb5 100644 --- a/nihav-indeo/src/codecs/indeo5.rs +++ b/nihav-indeo/src/codecs/indeo5.rs @@ -536,6 +536,12 @@ impl NADecoder for Indeo5Decoder { } } +impl NAOptionHandler for Indeo5Decoder { + fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] } + fn set_options(&mut self, _options: &[NAOption]) { } + fn query_option_value(&self, _name: &str) -> Option { None } +} + const INDEO5_PICTURE_SIZE_TAB: [[usize; 2]; 15] = [ [640, 480], [320, 240], [160, 120], [704, 480], [352, 240], [352, 288], [176, 144], [240, 180], [640, 240], [704, 240], [80, 60], [88, 72], [0, 0], [0, 0], [0, 0] diff --git a/nihav-indeo/src/codecs/intel263.rs b/nihav-indeo/src/codecs/intel263.rs index a1a0ace..e74f684 100644 --- a/nihav-indeo/src/codecs/intel263.rs +++ b/nihav-indeo/src/codecs/intel263.rs @@ -732,6 +732,12 @@ impl NADecoder for Intel263Decoder { } } +impl NAOptionHandler for Intel263Decoder { + 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(Intel263Decoder::new()) diff --git a/nihav-ms/src/codecs/imaadpcm.rs b/nihav-ms/src/codecs/imaadpcm.rs index 42730ee..2ee538d 100644 --- a/nihav-ms/src/codecs/imaadpcm.rs +++ b/nihav-ms/src/codecs/imaadpcm.rs @@ -82,6 +82,12 @@ impl NADecoder for IMAADPCMDecoder { } } +impl NAOptionHandler for IMAADPCMDecoder { + 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(IMAADPCMDecoder::new()) } diff --git a/nihav-ms/src/codecs/msadpcm.rs b/nihav-ms/src/codecs/msadpcm.rs index d906e4c..de6f447 100644 --- a/nihav-ms/src/codecs/msadpcm.rs +++ b/nihav-ms/src/codecs/msadpcm.rs @@ -161,6 +161,12 @@ impl NADecoder for MSADPCMDecoder { } } +impl NAOptionHandler for MSADPCMDecoder { + 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(MSADPCMDecoder::new()) } diff --git a/nihav-ms/src/codecs/msvideo1.rs b/nihav-ms/src/codecs/msvideo1.rs index 42a9a2e..938dc0f 100644 --- a/nihav-ms/src/codecs/msvideo1.rs +++ b/nihav-ms/src/codecs/msvideo1.rs @@ -277,6 +277,12 @@ if !found_pal { } } +impl NAOptionHandler for Video1Decoder { + 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(Video1Decoder::new()) } diff --git a/nihav-rad/src/codecs/bink2.rs b/nihav-rad/src/codecs/bink2.rs index 7532c02..1305878 100644 --- a/nihav-rad/src/codecs/bink2.rs +++ b/nihav-rad/src/codecs/bink2.rs @@ -1943,6 +1943,12 @@ impl NADecoder for Bink2Decoder { } } +impl NAOptionHandler for Bink2Decoder { + 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(Bink2Decoder::new()) } diff --git a/nihav-rad/src/codecs/binkaud.rs b/nihav-rad/src/codecs/binkaud.rs index 479ee35..aee9bbc 100644 --- a/nihav-rad/src/codecs/binkaud.rs +++ b/nihav-rad/src/codecs/binkaud.rs @@ -278,6 +278,12 @@ impl NADecoder for BinkAudioDecoder { } } +impl NAOptionHandler for BinkAudioDecoder { + 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_dct() -> Box { Box::new(BinkAudioDecoder::new(true)) } diff --git a/nihav-rad/src/codecs/binkvid.rs b/nihav-rad/src/codecs/binkvid.rs index 509b115..4de23e7 100644 --- a/nihav-rad/src/codecs/binkvid.rs +++ b/nihav-rad/src/codecs/binkvid.rs @@ -1249,6 +1249,12 @@ impl NADecoder for BinkDecoder { } } +impl NAOptionHandler for BinkDecoder { + 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(BinkDecoder::new()) } diff --git a/nihav-rad/src/codecs/smacker.rs b/nihav-rad/src/codecs/smacker.rs index b29e186..8b24c6d 100644 --- a/nihav-rad/src/codecs/smacker.rs +++ b/nihav-rad/src/codecs/smacker.rs @@ -469,6 +469,12 @@ impl NADecoder for SmackerVideoDecoder { } } +impl NAOptionHandler for SmackerVideoDecoder { + 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_video() -> Box { Box::new(SmackerVideoDecoder::new()) } @@ -594,6 +600,12 @@ impl NADecoder for SmackerAudioDecoder { } } +impl NAOptionHandler for SmackerAudioDecoder { + 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_audio() -> Box { Box::new(SmackerAudioDecoder::new()) } diff --git a/nihav-realmedia/src/codecs/cook.rs b/nihav-realmedia/src/codecs/cook.rs index 448ccae..b4e2ea9 100644 --- a/nihav-realmedia/src/codecs/cook.rs +++ b/nihav-realmedia/src/codecs/cook.rs @@ -676,6 +676,12 @@ impl NADecoder for CookDecoder { } } +impl NAOptionHandler for CookDecoder { + 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(CookDecoder::new()) } diff --git a/nihav-realmedia/src/codecs/ra144.rs b/nihav-realmedia/src/codecs/ra144.rs index abb7f38..31f2c01 100644 --- a/nihav-realmedia/src/codecs/ra144.rs +++ b/nihav-realmedia/src/codecs/ra144.rs @@ -311,6 +311,12 @@ impl NADecoder for RA144Decoder { } } +impl NAOptionHandler for RA144Decoder { + 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(RA144Decoder::new()) } diff --git a/nihav-realmedia/src/codecs/ra288.rs b/nihav-realmedia/src/codecs/ra288.rs index dc4add3..1d98331 100644 --- a/nihav-realmedia/src/codecs/ra288.rs +++ b/nihav-realmedia/src/codecs/ra288.rs @@ -201,6 +201,12 @@ impl NADecoder for RA288Decoder { } } +impl NAOptionHandler for RA288Decoder { + 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(RA288Decoder::new()) } diff --git a/nihav-realmedia/src/codecs/ralf.rs b/nihav-realmedia/src/codecs/ralf.rs index dd8b698..56af967 100644 --- a/nihav-realmedia/src/codecs/ralf.rs +++ b/nihav-realmedia/src/codecs/ralf.rs @@ -471,6 +471,12 @@ impl NADecoder for RALFDecoder { } } +impl NAOptionHandler for RALFDecoder { + 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(RALFDecoder::new()) } diff --git a/nihav-realmedia/src/codecs/rv10.rs b/nihav-realmedia/src/codecs/rv10.rs index f5e0c8d..e729b0d 100644 --- a/nihav-realmedia/src/codecs/rv10.rs +++ b/nihav-realmedia/src/codecs/rv10.rs @@ -460,6 +460,12 @@ impl NADecoder for RealVideo10Decoder { } } +impl NAOptionHandler for RealVideo10Decoder { + 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(RealVideo10Decoder::new()) diff --git a/nihav-realmedia/src/codecs/rv20.rs b/nihav-realmedia/src/codecs/rv20.rs index 3b8e441..39254db 100644 --- a/nihav-realmedia/src/codecs/rv20.rs +++ b/nihav-realmedia/src/codecs/rv20.rs @@ -667,6 +667,12 @@ impl NADecoder for RealVideo20Decoder { } } +impl NAOptionHandler for RealVideo20Decoder { + fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] } + fn set_options(&mut self, _options: &[NAOption]) { } + fn query_option_value(&self, _name: &str) -> Option { None } +} + struct MBB { blocks: usize, bits: u8 } const H263_MBB: &[MBB; 7] = &[ MBB{ blocks: 47, bits: 6 }, diff --git a/nihav-realmedia/src/codecs/rv30.rs b/nihav-realmedia/src/codecs/rv30.rs index 81021d4..1827980 100644 --- a/nihav-realmedia/src/codecs/rv30.rs +++ b/nihav-realmedia/src/codecs/rv30.rs @@ -165,6 +165,12 @@ println!("???"); } } +impl NAOptionHandler for RealVideo30Decoder { + 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(RealVideo30Decoder::new()) } diff --git a/nihav-realmedia/src/codecs/rv40.rs b/nihav-realmedia/src/codecs/rv40.rs index 91f6e78..95e2325 100644 --- a/nihav-realmedia/src/codecs/rv40.rs +++ b/nihav-realmedia/src/codecs/rv40.rs @@ -358,6 +358,12 @@ println!("???"); } } +impl NAOptionHandler for RealVideo40Decoder { + 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(RealVideo40Decoder::new()) } diff --git a/nihav-realmedia/src/codecs/rv60.rs b/nihav-realmedia/src/codecs/rv60.rs index 45322b5..a32bba1 100644 --- a/nihav-realmedia/src/codecs/rv60.rs +++ b/nihav-realmedia/src/codecs/rv60.rs @@ -1,6 +1,7 @@ use nihav_core::formats::YUV420_FORMAT; use nihav_core::frame::*; use nihav_core::codecs::{NADecoder, NADecoderSupport, DecoderError, DecoderResult}; +use nihav_core::options::*; use nihav_codec_support::codecs::{MV, ZERO_MV, IPBShuffler}; use nihav_core::io::byteio::{MemoryReader,ByteReader}; use nihav_core::io::bitreader::{BitReader,BitReaderMode}; @@ -1521,6 +1522,12 @@ println!("???"); } } +impl NAOptionHandler for RealVideo60Decoder { + 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(RealVideo60Decoder::new()) } diff --git a/nihav-vivo/src/codecs/g723_1.rs b/nihav-vivo/src/codecs/g723_1.rs index 840bb94..5824501 100644 --- a/nihav-vivo/src/codecs/g723_1.rs +++ b/nihav-vivo/src/codecs/g723_1.rs @@ -960,6 +960,12 @@ impl NADecoder for G7231Decoder { } } +impl NAOptionHandler for G7231Decoder { + 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(G7231Decoder::new()) } diff --git a/nihav-vivo/src/codecs/siren.rs b/nihav-vivo/src/codecs/siren.rs index d36e798..3dd130c 100644 --- a/nihav-vivo/src/codecs/siren.rs +++ b/nihav-vivo/src/codecs/siren.rs @@ -382,6 +382,12 @@ impl NADecoder for SirenDecoder { } } +impl NAOptionHandler for SirenDecoder { + 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(SirenDecoder::new()) } diff --git a/nihav-vivo/src/codecs/vivo.rs b/nihav-vivo/src/codecs/vivo.rs index 807814d..9c5b5d1 100644 --- a/nihav-vivo/src/codecs/vivo.rs +++ b/nihav-vivo/src/codecs/vivo.rs @@ -475,6 +475,12 @@ impl NADecoder for VivoDecoder { } } +impl NAOptionHandler for VivoDecoder { + 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(VivoDecoder::new()) -- 2.30.2