}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(AACDecoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(Atrac3Decoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(ClearVideoDecoder::new(false))
}
-pub fn get_decoder_rm() -> Box<NADecoder> {
+pub fn get_decoder_rm() -> Box<dyn NADecoder> {
Box::new(ClearVideoDecoder::new(true))
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(PCMDecoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(SiproDecoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(AudioDecoder::new())
}
pub struct AVIDemuxerCreator { }
impl DemuxerCreator for AVIDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(AVIDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "avi" }
#[derive(Clone,Copy)]
pub struct DecoderInfo {
pub name: &'static str,
- pub get_decoder: fn () -> Box<NADecoder>,
+ pub get_decoder: fn () -> Box<dyn NADecoder>,
}
#[cfg(any(feature="h263"))]
pub fn add_decoder(&mut self, dec: DecoderInfo) {
self.decs.push(dec);
}
- pub fn find_decoder(&self, name: &str) -> Option<fn () -> Box<NADecoder>> {
+ pub fn find_decoder(&self, name: &str) -> Option<fn () -> Box<dyn NADecoder>> {
for &dec in self.decs.iter() {
if dec.name == name {
return Some(dec.get_decoder);
}
pub struct Demuxer<'a> {
- dmx: Box<DemuxCore<'a> + 'a>,
+ dmx: Box<dyn DemuxCore<'a> + 'a>,
streams: StreamManager,
}
impl<'a> Demuxer<'a> {
- fn new(dmx: Box<DemuxCore<'a> + 'a>, str: StreamManager) -> Self {
+ fn new(dmx: Box<dyn DemuxCore<'a> + 'a>, str: StreamManager) -> Self {
Demuxer {
dmx: dmx,
streams: str,
///The structure used to create demuxers.
pub trait DemuxerCreator {
/// Create new demuxer instance that will use `ByteReader` source as an input.
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a>;
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a>;
/// Get the name of current demuxer creator.
fn get_name(&self) -> &'static str;
}
}
}
-pub fn create_rgb2yuv() -> Box<Kernel> {
+pub fn create_rgb2yuv() -> Box<dyn Kernel> {
Box::new(RgbToYuv::new())
}
}
}
-pub fn create_yuv2rgb() -> Box<Kernel> {
+pub fn create_yuv2rgb() -> Box<dyn Kernel> {
Box::new(YuvToRgb::new())
}
struct KernelDesc {
name: &'static str,
- create: fn () -> Box<kernel::Kernel>,
+ create: fn () -> Box<dyn kernel::Kernel>,
}
impl KernelDesc {
- fn find(name: &str) -> ScaleResult<Box<kernel::Kernel>> {
+ fn find(name: &str) -> ScaleResult<Box<dyn kernel::Kernel>> {
for kern in KERNELS.iter() {
if kern.name == name {
return Ok((kern.create)());
fmt_out: ScaleInfo,
tmp_pic: NABufferType,
next: Option<Box<Stage>>,
- worker: Box<kernel::Kernel>,
+ worker: Box<dyn kernel::Kernel>,
}
pub fn get_scale_fmt_from_pic(pic: &NABufferType) -> ScaleInfo {
}
}
-pub fn create_pack() -> Box<Kernel> {
+pub fn create_pack() -> Box<dyn Kernel> {
Box::new(PackKernel::new())
}
}
}
-pub fn create_unpack() -> Box<Kernel> {
+pub fn create_unpack() -> Box<dyn Kernel> {
Box::new(UnpackKernel::new())
}
}
}
-pub fn create_depal() -> Box<Kernel> {
+pub fn create_depal() -> Box<dyn Kernel> {
Box::new(DepalKernel::new())
}
}
}
-pub fn create_scale() -> Box<Kernel> {
+pub fn create_scale() -> Box<dyn Kernel> {
Box::new(NNResampler::new())
}
let mut br = ByteReader::new(&mut fr);
let mut dmx = create_demuxer(dmx_f, &mut br).unwrap();
- let mut decs: Vec<Option<(Box<NADecoderSupport>, Box<NADecoder>)>> = Vec::new();
+ let mut decs: Vec<Option<(Box<NADecoderSupport>, Box<dyn NADecoder>)>> = Vec::new();
for i in 0..dmx.get_num_streams() {
let s = dmx.get_stream(i).unwrap();
let info = s.get_info();
let mut br = ByteReader::new(&mut fr);
let mut dmx = create_demuxer(dmx_f, &mut br).unwrap();
- let mut decs: Vec<Option<(Box<NADecoderSupport>, Box<NADecoder>)>> = Vec::new();
+ let mut decs: Vec<Option<(Box<NADecoderSupport>, Box<dyn NADecoder>)>> = Vec::new();
for i in 0..dmx.get_num_streams() {
let s = dmx.get_stream(i).unwrap();
let info = s.get_info();
}
}
-pub fn get_decoder_dk3() -> Box<NADecoder> {
+pub fn get_decoder_dk3() -> Box<dyn NADecoder> {
Box::new(DuckADPCMDecoder::new(true))
}
-pub fn get_decoder_dk4() -> Box<NADecoder> {
+pub fn get_decoder_dk4() -> Box<dyn NADecoder> {
Box::new(DuckADPCMDecoder::new(false))
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(TM1Decoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(TM2Decoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(TM2XDecoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(TMRTDecoder::new())
}
}
-pub fn get_decoder_video() -> Box<NADecoder> {
+pub fn get_decoder_video() -> Box<dyn NADecoder> {
Box::new(BMVVideoDecoder::new())
}
}
}
-pub fn get_decoder_audio() -> Box<NADecoder> {
+pub fn get_decoder_audio() -> Box<dyn NADecoder> {
Box::new(BMVAudioDecoder::new())
}
}
-pub fn get_decoder_video() -> Box<NADecoder> {
+pub fn get_decoder_video() -> Box<dyn NADecoder> {
Box::new(BMV3VideoDecoder::new())
}
}
}
-pub fn get_decoder_audio() -> Box<NADecoder> {
+pub fn get_decoder_audio() -> Box<dyn NADecoder> {
Box::new(BMV3AudioDecoder::new())
}
}
}
-pub fn get_decoder_video() -> Box<NADecoder> {
+pub fn get_decoder_video() -> Box<dyn NADecoder> {
Box::new(GremlinVideoDecoder::new())
}
}
}
-pub fn get_decoder_audio() -> Box<NADecoder> {
+pub fn get_decoder_audio() -> Box<dyn NADecoder> {
Box::new(GremlinAudioDecoder::new())
}
}
-pub fn get_decoder_video() -> Box<NADecoder> {
+pub fn get_decoder_video() -> Box<dyn NADecoder> {
Box::new(VMDVideoDecoder::new())
}
}
}
-pub fn get_decoder_audio() -> Box<NADecoder> {
+pub fn get_decoder_audio() -> Box<dyn NADecoder> {
Box::new(VMDAudioDecoder::new())
}
pub struct BMVDemuxerCreator { }
impl DemuxerCreator for BMVDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(BMVDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "bmv" }
pub struct BMV3DemuxerCreator { }
impl DemuxerCreator for BMV3DemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(BMV3Demuxer::new(br))
}
fn get_name(&self) -> &'static str { "bmv3" }
pub struct GDVDemuxerCreator { }
impl DemuxerCreator for GDVDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(GremlinVideoDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "gdv" }
pub struct VMDDemuxerCreator { }
impl DemuxerCreator for VMDDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(VMDDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "vmd" }
}
}
-pub fn get_decoder_imc() -> Box<NADecoder> {
+pub fn get_decoder_imc() -> Box<dyn NADecoder> {
Box::new(IMCDecoder::new(true))
}
-pub fn get_decoder_iac() -> Box<NADecoder> {
+pub fn get_decoder_iac() -> Box<dyn NADecoder> {
Box::new(IMCDecoder::new(false))
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(Indeo2Decoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(Indeo3Decoder::new())
}
&INDEO4_QUANT4X4_INTER[3], &INDEO4_QUANT4X4_INTER[4]
];
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(Indeo4Decoder::new())
}
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23
];
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(Indeo5Decoder::new())
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(Intel263Decoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(Bink2Decoder::new())
}
}
}
-pub fn get_decoder_dct() -> Box<NADecoder> {
+pub fn get_decoder_dct() -> Box<dyn NADecoder> {
Box::new(BinkAudioDecoder::new(true))
}
-pub fn get_decoder_rdft() -> Box<NADecoder> {
+pub fn get_decoder_rdft() -> Box<dyn NADecoder> {
Box::new(BinkAudioDecoder::new(false))
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(BinkDecoder::new())
}
}
}
-pub fn get_decoder_video() -> Box<NADecoder> {
+pub fn get_decoder_video() -> Box<dyn NADecoder> {
Box::new(SmackerVideoDecoder::new())
}
}
}
-pub fn get_decoder_audio() -> Box<NADecoder> {
+pub fn get_decoder_audio() -> Box<dyn NADecoder> {
Box::new(SmackerAudioDecoder::new())
}
pub struct BinkDemuxerCreator { }
impl DemuxerCreator for BinkDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(BinkDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "bink" }
pub struct SMKDemuxerCreator { }
impl DemuxerCreator for SMKDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(SmackerVideoDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "smacker" }
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(CookDecoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(RA144Decoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(RA288Decoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(RALFDecoder::new())
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(RealVideo10Decoder::new())
}
MBB{ blocks: 65536, bits: 14 },
];
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(RealVideo20Decoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(RealVideo30Decoder::new())
}
Ok(MV{ x: x, y: y })
}
-fn do_mc_16x16(dsp: &Box<RV34DSP>, buf: &mut NAVideoBuffer<u8>, prevbuf: &NAVideoBuffer<u8>, mb_x: usize, mb_y: usize, mv: MV, avg: bool) {
+fn do_mc_16x16(dsp: &Box<dyn RV34DSP>, buf: &mut NAVideoBuffer<u8>, prevbuf: &NAVideoBuffer<u8>, mb_x: usize, mb_y: usize, mv: MV, avg: bool) {
dsp.do_luma_mc (buf, prevbuf, mb_x * 16, mb_y * 16, mv, true, avg);
dsp.do_chroma_mc(buf, prevbuf, mb_x * 8, mb_y * 8, 1, mv, true, avg);
dsp.do_chroma_mc(buf, prevbuf, mb_x * 8, mb_y * 8, 2, mv, true, avg);
}
-fn do_mc_8x8(dsp: &Box<RV34DSP>, buf: &mut NAVideoBuffer<u8>, prevbuf: &NAVideoBuffer<u8>, mb_x: usize, xoff: usize, mb_y: usize, yoff: usize, mv: MV, avg: bool) {
+fn do_mc_8x8(dsp: &Box<dyn RV34DSP>, buf: &mut NAVideoBuffer<u8>, prevbuf: &NAVideoBuffer<u8>, mb_x: usize, xoff: usize, mb_y: usize, yoff: usize, mv: MV, avg: bool) {
dsp.do_luma_mc (buf, prevbuf, mb_x * 16 + xoff * 8, mb_y * 16 + yoff * 8, mv, false, avg);
dsp.do_chroma_mc(buf, prevbuf, mb_x * 8 + xoff * 4, mb_y * 8 + yoff * 4, 1, mv, false, avg);
dsp.do_chroma_mc(buf, prevbuf, mb_x * 8 + xoff * 4, mb_y * 8 + yoff * 4, 2, mv, false, avg);
pub struct RV34Decoder {
is_rv30: bool,
coderead: RV34Codes,
- dsp: Box<RV34DSP>,
+ dsp: Box<dyn RV34DSP>,
cdsp: RV34CommonDSP,
width: usize,
height: usize,
}
impl RV34Decoder {
- pub fn new(is_rv30: bool, dsp: Box<RV34DSP>) -> Self {
+ pub fn new(is_rv30: bool, dsp: Box<dyn RV34DSP>) -> Self {
let tmp_vinfo = NAVideoInfo::new(16, 16, false, YUV420_FORMAT);
let vt = alloc_video_buffer(tmp_vinfo, 4).unwrap();
let vb = vt.get_vbuf();
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(RealVideo40Decoder::new())
}
}
}
-pub fn get_decoder() -> Box<NADecoder> {
+pub fn get_decoder() -> Box<dyn NADecoder> {
Box::new(RealVideo60Decoder::new())
}
pub struct RealMediaDemuxerCreator { }
impl DemuxerCreator for RealMediaDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(RealMediaDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "realmedia" }
pub struct RealAudioDemuxerCreator { }
impl DemuxerCreator for RealAudioDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(RealAudioDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "realaudio" }
pub struct RealIVRDemuxerCreator { }
impl DemuxerCreator for RealIVRDemuxerCreator {
- fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<DemuxCore<'a> + 'a> {
+ fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box<dyn DemuxCore<'a> + 'a> {
Box::new(RealIVRDemuxer::new(br))
}
fn get_name(&self) -> &'static str { "real_ivr" }