}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(AACDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(Atrac3Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(CinepakDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(ClearVideoDecoder::new(false))
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(PCMDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(SiproDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(AudioDecoder::new())
}
}
/// Decoder trait.
-pub trait NADecoder {
+pub trait NADecoder: NAOptionHandler {
/// Initialises the decoder.
///
/// It takes [`NADecoderSupport`] allocated by the caller and `NACodecInfoRef` provided by demuxer.
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_dk3() -> Box<dyn NADecoder + Send> {
Box::new(DuckADPCMDecoder::new(true))
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_500() -> Box<dyn NADecoder + Send> {
Box::new(AVCDecoder::new(500))
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(TM1Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(TM2Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(TM2XDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(TMRTDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_vp3() -> Box<NADecoder + Send> {
Box::new(VP34Decoder::new(3))
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<NADecoder + Send> {
Box::new(VP5Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_vp6() -> Box<NADecoder + Send> {
Box::new(VP6Decoder::new(false))
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<NADecoder + Send> {
Box::new(VP7Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_video() -> Box<dyn NADecoder + Send> {
Box::new(BMVVideoDecoder::new())
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_audio() -> Box<dyn NADecoder + Send> {
Box::new(BMVAudioDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_video() -> Box<dyn NADecoder + Send> {
Box::new(BMV3VideoDecoder::new())
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_audio() -> Box<dyn NADecoder + Send> {
Box::new(BMV3AudioDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_video() -> Box<dyn NADecoder + Send> {
Box::new(GremlinVideoDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_audio() -> Box<dyn NADecoder + Send> {
Box::new(GremlinAudioDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(LHDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_video() -> Box<dyn NADecoder + Send> {
Box::new(MidividDecoder::new())
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_video() -> Box<dyn NADecoder + Send> {
Box::new(Midivid3Decoder::new())
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_video() -> Box<dyn NADecoder + Send> {
Box::new(VMDVideoDecoder::new())
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_audio() -> Box<dyn NADecoder + Send> {
Box::new(VMDAudioDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_imc() -> Box<dyn NADecoder + Send> {
Box::new(IMCDecoder::new(true))
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(Indeo2Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(Indeo3Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
const INDEO4_PICTURE_SIZE_TAB: [[usize; 2]; 7] = [
[640, 480], [320, 240], [160, 120], [704, 480], [352, 240], [352, 288], [176, 144]
];
}
}
+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<NAValue> { 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]
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(Intel263Decoder::new())
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(IMAADPCMDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(MSADPCMDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(Video1Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(Bink2Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_dct() -> Box<dyn NADecoder + Send> {
Box::new(BinkAudioDecoder::new(true))
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(BinkDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_video() -> Box<dyn NADecoder + Send> {
Box::new(SmackerVideoDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder_audio() -> Box<dyn NADecoder + Send> {
Box::new(SmackerAudioDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(CookDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(RA144Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(RA288Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(RALFDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(RealVideo10Decoder::new())
}
}
+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<NAValue> { None }
+}
+
struct MBB { blocks: usize, bits: u8 }
const H263_MBB: &[MBB; 7] = &[
MBB{ blocks: 47, bits: 6 },
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(RealVideo30Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(RealVideo40Decoder::new())
}
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};
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(RealVideo60Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(G7231Decoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(SirenDecoder::new())
}
}
}
+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<NAValue> { None }
+}
+
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(VivoDecoder::new())