}
}
+#[cfg(feature="decoder_ms_adpcm")]
struct MSADPCMDecoder {
ainfo: NAAudioInfo,
chmap: NAChannelMap,
block_samps: usize,
}
+#[cfg(feature="decoder_ms_adpcm")]
impl MSADPCMDecoder {
fn new() -> Self {
Self {
}
}
+#[cfg(feature="decoder_ms_adpcm")]
impl NADecoder for MSADPCMDecoder {
#[allow(clippy::int_plus_one)]
fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
}
}
+#[cfg(feature="decoder_ms_adpcm")]
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 }
}
+#[cfg(feature="decoder_ms_adpcm")]
pub fn get_decoder() -> Box<dyn NADecoder + Send> {
Box::new(MSADPCMDecoder::new())
}
#[derive(Default)]
+#[cfg(feature="encoder_ms_adpcm")]
struct MSADPCMEncoder {
stream: Option<NAStreamRef>,
samples: Vec<i16>,
srate: u32,
}
+#[cfg(feature="encoder_ms_adpcm")]
const DEFAULT_BLOCK_LEN: usize = 256;
+#[cfg(feature="encoder_ms_adpcm")]
impl MSADPCMEncoder {
fn new() -> Self { Self::default() }
fn encode_packet(&mut self) -> EncoderResult<NAPacket> {
}
}
+#[cfg(feature="encoder_ms_adpcm")]
impl NAEncoder for MSADPCMEncoder {
fn negotiate_format(&self, encinfo: &EncodeParameters) -> EncoderResult<EncodeParameters> {
match encinfo.format {
}
}
+#[cfg(feature="encoder_ms_adpcm")]
impl NAOptionHandler for MSADPCMEncoder {
fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
fn set_options(&mut self, _options: &[NAOption]) { }
fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
}
+#[cfg(feature="encoder_ms_adpcm")]
pub fn get_encoder() -> Box<dyn NAEncoder + Send> {
Box::new(MSADPCMEncoder::new())
}
let mut enc_reg = RegisteredEncoders::new();
ms_register_all_encoders(&mut enc_reg);
+ // sample: https://samples.mplayerhq.hu/V-codecs/RT21/320x240/laser05.avi
let dec_config = DecoderTestParams {
demuxer: "avi",
in_name: "assets/Indeo/laser05.avi",