From 6011e20199143f519881660144a4ca95ba77fd2d Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 14 May 2019 09:34:52 +0200 Subject: [PATCH] mark traits as dyn --- nihav-commonfmt/src/codecs/aac.rs | 2 +- nihav-commonfmt/src/codecs/atrac3.rs | 2 +- nihav-commonfmt/src/codecs/clearvideo.rs | 4 ++-- nihav-commonfmt/src/codecs/pcm.rs | 2 +- nihav-commonfmt/src/codecs/sipro.rs | 2 +- nihav-commonfmt/src/codecs/ts102366.rs | 2 +- nihav-commonfmt/src/demuxers/avi.rs | 2 +- nihav-core/src/codecs/mod.rs | 4 ++-- nihav-core/src/demuxers/mod.rs | 6 +++--- nihav-core/src/scale/colorcvt.rs | 4 ++-- nihav-core/src/scale/mod.rs | 6 +++--- nihav-core/src/scale/repack.rs | 6 +++--- nihav-core/src/scale/scale.rs | 2 +- nihav-core/src/test/dec_video.rs | 4 ++-- nihav-duck/src/codecs/dkadpcm.rs | 4 ++-- nihav-duck/src/codecs/truemotion1.rs | 2 +- nihav-duck/src/codecs/truemotion2.rs | 2 +- nihav-duck/src/codecs/truemotion2x.rs | 2 +- nihav-duck/src/codecs/truemotionrt.rs | 2 +- nihav-game/src/codecs/bmv.rs | 4 ++-- nihav-game/src/codecs/bmv3.rs | 4 ++-- nihav-game/src/codecs/gremlinvideo.rs | 4 ++-- nihav-game/src/codecs/vmd.rs | 4 ++-- nihav-game/src/demuxers/bmv.rs | 4 ++-- nihav-game/src/demuxers/gdv.rs | 2 +- nihav-game/src/demuxers/vmd.rs | 2 +- nihav-indeo/src/codecs/imc.rs | 4 ++-- nihav-indeo/src/codecs/indeo2.rs | 2 +- nihav-indeo/src/codecs/indeo3.rs | 2 +- nihav-indeo/src/codecs/indeo4.rs | 2 +- nihav-indeo/src/codecs/indeo5.rs | 2 +- nihav-indeo/src/codecs/intel263.rs | 2 +- nihav-rad/src/codecs/bink2.rs | 2 +- nihav-rad/src/codecs/binkaud.rs | 4 ++-- nihav-rad/src/codecs/binkvid.rs | 2 +- nihav-rad/src/codecs/smacker.rs | 4 ++-- nihav-rad/src/demuxers/bink.rs | 2 +- nihav-rad/src/demuxers/smacker.rs | 2 +- nihav-realmedia/src/codecs/cook.rs | 2 +- nihav-realmedia/src/codecs/ra144.rs | 2 +- nihav-realmedia/src/codecs/ra288.rs | 2 +- nihav-realmedia/src/codecs/ralf.rs | 2 +- nihav-realmedia/src/codecs/rv10.rs | 2 +- nihav-realmedia/src/codecs/rv20.rs | 2 +- nihav-realmedia/src/codecs/rv30.rs | 2 +- nihav-realmedia/src/codecs/rv3040.rs | 8 ++++---- nihav-realmedia/src/codecs/rv40.rs | 2 +- nihav-realmedia/src/codecs/rv60.rs | 2 +- nihav-realmedia/src/demuxers/realmedia.rs | 6 +++--- 49 files changed, 73 insertions(+), 73 deletions(-) diff --git a/nihav-commonfmt/src/codecs/aac.rs b/nihav-commonfmt/src/codecs/aac.rs index beb0fff..df5fda3 100644 --- a/nihav-commonfmt/src/codecs/aac.rs +++ b/nihav-commonfmt/src/codecs/aac.rs @@ -1254,7 +1254,7 @@ impl NADecoder for AACDecoder { } } -pub fn get_decoder() -> Box { +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 184b317..0d12cf3 100644 --- a/nihav-commonfmt/src/codecs/atrac3.rs +++ b/nihav-commonfmt/src/codecs/atrac3.rs @@ -691,7 +691,7 @@ impl NADecoder for Atrac3Decoder { } } -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(Atrac3Decoder::new()) } diff --git a/nihav-commonfmt/src/codecs/clearvideo.rs b/nihav-commonfmt/src/codecs/clearvideo.rs index 67a9863..0594869 100644 --- a/nihav-commonfmt/src/codecs/clearvideo.rs +++ b/nihav-commonfmt/src/codecs/clearvideo.rs @@ -761,11 +761,11 @@ impl NADecoder for ClearVideoDecoder { } } -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(ClearVideoDecoder::new(false)) } -pub fn get_decoder_rm() -> Box { +pub fn get_decoder_rm() -> Box { Box::new(ClearVideoDecoder::new(true)) } diff --git a/nihav-commonfmt/src/codecs/pcm.rs b/nihav-commonfmt/src/codecs/pcm.rs index 7ec3c1f..7967b34 100644 --- a/nihav-commonfmt/src/codecs/pcm.rs +++ b/nihav-commonfmt/src/codecs/pcm.rs @@ -58,6 +58,6 @@ impl NADecoder for PCMDecoder { } } -pub fn get_decoder() -> Box { +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 c36c7ed..e617c9e 100644 --- a/nihav-commonfmt/src/codecs/sipro.rs +++ b/nihav-commonfmt/src/codecs/sipro.rs @@ -733,7 +733,7 @@ impl NADecoder for SiproDecoder { } } -pub fn get_decoder() -> Box { +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 4858eaa..f30652c 100644 --- a/nihav-commonfmt/src/codecs/ts102366.rs +++ b/nihav-commonfmt/src/codecs/ts102366.rs @@ -1239,7 +1239,7 @@ impl NADecoder for AudioDecoder { } } -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(AudioDecoder::new()) } diff --git a/nihav-commonfmt/src/demuxers/avi.rs b/nihav-commonfmt/src/demuxers/avi.rs index 099f962..511a22f 100644 --- a/nihav-commonfmt/src/demuxers/avi.rs +++ b/nihav-commonfmt/src/demuxers/avi.rs @@ -385,7 +385,7 @@ fn parse_junk(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize) -> pub struct AVIDemuxerCreator { } impl DemuxerCreator for AVIDemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(AVIDemuxer::new(br)) } fn get_name(&self) -> &'static str { "avi" } diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index 490c7c7..4ea379d 100644 --- a/nihav-core/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -254,7 +254,7 @@ pub trait NADecoder { #[derive(Clone,Copy)] pub struct DecoderInfo { pub name: &'static str, - pub get_decoder: fn () -> Box, + pub get_decoder: fn () -> Box, } #[cfg(any(feature="h263"))] @@ -274,7 +274,7 @@ impl RegisteredDecoders { pub fn add_decoder(&mut self, dec: DecoderInfo) { self.decs.push(dec); } - pub fn find_decoder(&self, name: &str) -> Option Box> { + pub fn find_decoder(&self, name: &str) -> Option Box> { for &dec in self.decs.iter() { if dec.name == name { return Some(dec.get_decoder); diff --git a/nihav-core/src/demuxers/mod.rs b/nihav-core/src/demuxers/mod.rs index b3546fe..8470edd 100644 --- a/nihav-core/src/demuxers/mod.rs +++ b/nihav-core/src/demuxers/mod.rs @@ -138,12 +138,12 @@ impl<'a> Iterator for StreamIter<'a> { } pub struct Demuxer<'a> { - dmx: Box + 'a>, + dmx: Box + 'a>, streams: StreamManager, } impl<'a> Demuxer<'a> { - fn new(dmx: Box + 'a>, str: StreamManager) -> Self { + fn new(dmx: Box + 'a>, str: StreamManager) -> Self { Demuxer { dmx: dmx, streams: str, @@ -194,7 +194,7 @@ impl From for DemuxerError { ///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 + 'a>; + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a>; /// Get the name of current demuxer creator. fn get_name(&self) -> &'static str; } diff --git a/nihav-core/src/scale/colorcvt.rs b/nihav-core/src/scale/colorcvt.rs index 2e2f299..efe3ebc 100644 --- a/nihav-core/src/scale/colorcvt.rs +++ b/nihav-core/src/scale/colorcvt.rs @@ -230,7 +230,7 @@ println!(" [intermediate format {}]", df); } } -pub fn create_rgb2yuv() -> Box { +pub fn create_rgb2yuv() -> Box { Box::new(RgbToYuv::new()) } @@ -318,6 +318,6 @@ println!(" [intermediate format {}]", df); } } -pub fn create_yuv2rgb() -> Box { +pub fn create_yuv2rgb() -> Box { Box::new(YuvToRgb::new()) } diff --git a/nihav-core/src/scale/mod.rs b/nihav-core/src/scale/mod.rs index c569b2f..e49fecb 100644 --- a/nihav-core/src/scale/mod.rs +++ b/nihav-core/src/scale/mod.rs @@ -38,11 +38,11 @@ pub type ScaleResult = Result; struct KernelDesc { name: &'static str, - create: fn () -> Box, + create: fn () -> Box, } impl KernelDesc { - fn find(name: &str) -> ScaleResult> { + fn find(name: &str) -> ScaleResult> { for kern in KERNELS.iter() { if kern.name == name { return Ok((kern.create)()); @@ -65,7 +65,7 @@ struct Stage { fmt_out: ScaleInfo, tmp_pic: NABufferType, next: Option>, - worker: Box, + worker: Box, } pub fn get_scale_fmt_from_pic(pic: &NABufferType) -> ScaleInfo { diff --git a/nihav-core/src/scale/repack.rs b/nihav-core/src/scale/repack.rs index 4f2ce99..350ddf4 100644 --- a/nihav-core/src/scale/repack.rs +++ b/nihav-core/src/scale/repack.rs @@ -102,7 +102,7 @@ unimplemented!(); } } -pub fn create_pack() -> Box { +pub fn create_pack() -> Box { Box::new(PackKernel::new()) } @@ -216,7 +216,7 @@ unimplemented!(); } } -pub fn create_unpack() -> Box { +pub fn create_unpack() -> Box { Box::new(UnpackKernel::new()) } @@ -293,6 +293,6 @@ println!(" [intermediate format {}]", df); } } -pub fn create_depal() -> Box { +pub fn create_depal() -> Box { Box::new(DepalKernel::new()) } diff --git a/nihav-core/src/scale/scale.rs b/nihav-core/src/scale/scale.rs index 197b7c4..934d380 100644 --- a/nihav-core/src/scale/scale.rs +++ b/nihav-core/src/scale/scale.rs @@ -52,7 +52,7 @@ impl Kernel for NNResampler { } } -pub fn create_scale() -> Box { +pub fn create_scale() -> Box { Box::new(NNResampler::new()) } diff --git a/nihav-core/src/test/dec_video.rs b/nihav-core/src/test/dec_video.rs index d000e52..62672b3 100644 --- a/nihav-core/src/test/dec_video.rs +++ b/nihav-core/src/test/dec_video.rs @@ -161,7 +161,7 @@ pub fn test_file_decoding(demuxer: &str, name: &str, limit: Option, let mut br = ByteReader::new(&mut fr); let mut dmx = create_demuxer(dmx_f, &mut br).unwrap(); - let mut decs: Vec, Box)>> = Vec::new(); + let mut decs: Vec, Box)>> = Vec::new(); for i in 0..dmx.get_num_streams() { let s = dmx.get_stream(i).unwrap(); let info = s.get_info(); @@ -219,7 +219,7 @@ pub fn test_decode_audio(demuxer: &str, name: &str, limit: Option, audio_pf let mut br = ByteReader::new(&mut fr); let mut dmx = create_demuxer(dmx_f, &mut br).unwrap(); - let mut decs: Vec, Box)>> = Vec::new(); + let mut decs: Vec, Box)>> = Vec::new(); for i in 0..dmx.get_num_streams() { let s = dmx.get_stream(i).unwrap(); let info = s.get_info(); diff --git a/nihav-duck/src/codecs/dkadpcm.rs b/nihav-duck/src/codecs/dkadpcm.rs index d3bdba5..b5871ab 100644 --- a/nihav-duck/src/codecs/dkadpcm.rs +++ b/nihav-duck/src/codecs/dkadpcm.rs @@ -165,11 +165,11 @@ impl NADecoder for DuckADPCMDecoder { } } -pub fn get_decoder_dk3() -> Box { +pub fn get_decoder_dk3() -> Box { Box::new(DuckADPCMDecoder::new(true)) } -pub fn get_decoder_dk4() -> Box { +pub fn get_decoder_dk4() -> Box { Box::new(DuckADPCMDecoder::new(false)) } diff --git a/nihav-duck/src/codecs/truemotion1.rs b/nihav-duck/src/codecs/truemotion1.rs index f6fe5ca..c01fcaa 100644 --- a/nihav-duck/src/codecs/truemotion1.rs +++ b/nihav-duck/src/codecs/truemotion1.rs @@ -660,7 +660,7 @@ impl NADecoder for TM1Decoder { } } -pub fn get_decoder() -> Box { +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 84162b5..1abe444 100644 --- a/nihav-duck/src/codecs/truemotion2.rs +++ b/nihav-duck/src/codecs/truemotion2.rs @@ -589,7 +589,7 @@ impl NADecoder for TM2Decoder { } } -pub fn get_decoder() -> Box { +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 ae2efec..12366f5 100644 --- a/nihav-duck/src/codecs/truemotion2x.rs +++ b/nihav-duck/src/codecs/truemotion2x.rs @@ -692,7 +692,7 @@ impl NADecoder for TM2XDecoder { } } -pub fn get_decoder() -> Box { +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 3b4e9e8..d7b777f 100644 --- a/nihav-duck/src/codecs/truemotionrt.rs +++ b/nihav-duck/src/codecs/truemotionrt.rs @@ -84,7 +84,7 @@ impl NADecoder for TMRTDecoder { } } -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(TMRTDecoder::new()) } diff --git a/nihav-game/src/codecs/bmv.rs b/nihav-game/src/codecs/bmv.rs index 970f490..eb228bb 100644 --- a/nihav-game/src/codecs/bmv.rs +++ b/nihav-game/src/codecs/bmv.rs @@ -225,7 +225,7 @@ impl NADecoder for BMVVideoDecoder { } -pub fn get_decoder_video() -> Box { +pub fn get_decoder_video() -> Box { Box::new(BMVVideoDecoder::new()) } @@ -301,7 +301,7 @@ impl NADecoder for BMVAudioDecoder { } } -pub fn get_decoder_audio() -> Box { +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 f6067cf..b30628e 100644 --- a/nihav-game/src/codecs/bmv3.rs +++ b/nihav-game/src/codecs/bmv3.rs @@ -509,7 +509,7 @@ impl NADecoder for BMV3VideoDecoder { } -pub fn get_decoder_video() -> Box { +pub fn get_decoder_video() -> Box { Box::new(BMV3VideoDecoder::new()) } @@ -598,7 +598,7 @@ impl NADecoder for BMV3AudioDecoder { } } -pub fn get_decoder_audio() -> Box { +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 2d698cb..19021ee 100644 --- a/nihav-game/src/codecs/gremlinvideo.rs +++ b/nihav-game/src/codecs/gremlinvideo.rs @@ -460,7 +460,7 @@ impl NADecoder for GremlinVideoDecoder { } } -pub fn get_decoder_video() -> Box { +pub fn get_decoder_video() -> Box { Box::new(GremlinVideoDecoder::new()) } @@ -552,7 +552,7 @@ impl NADecoder for GremlinAudioDecoder { } } -pub fn get_decoder_audio() -> Box { +pub fn get_decoder_audio() -> Box { Box::new(GremlinAudioDecoder::new()) } diff --git a/nihav-game/src/codecs/vmd.rs b/nihav-game/src/codecs/vmd.rs index a11e26c..ea6c31d 100644 --- a/nihav-game/src/codecs/vmd.rs +++ b/nihav-game/src/codecs/vmd.rs @@ -269,7 +269,7 @@ impl NADecoder for VMDVideoDecoder { } -pub fn get_decoder_video() -> Box { +pub fn get_decoder_video() -> Box { Box::new(VMDVideoDecoder::new()) } @@ -440,7 +440,7 @@ impl NADecoder for VMDAudioDecoder { } } -pub fn get_decoder_audio() -> Box { +pub fn get_decoder_audio() -> Box { Box::new(VMDAudioDecoder::new()) } diff --git a/nihav-game/src/demuxers/bmv.rs b/nihav-game/src/demuxers/bmv.rs index ea06d7f..6ef023b 100644 --- a/nihav-game/src/demuxers/bmv.rs +++ b/nihav-game/src/demuxers/bmv.rs @@ -93,7 +93,7 @@ impl<'a> BMVDemuxer<'a> { pub struct BMVDemuxerCreator { } impl DemuxerCreator for BMVDemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(BMVDemuxer::new(br)) } fn get_name(&self) -> &'static str { "bmv" } @@ -239,7 +239,7 @@ impl<'a> BMV3Demuxer<'a> { pub struct BMV3DemuxerCreator { } impl DemuxerCreator for BMV3DemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(BMV3Demuxer::new(br)) } fn get_name(&self) -> &'static str { "bmv3" } diff --git a/nihav-game/src/demuxers/gdv.rs b/nihav-game/src/demuxers/gdv.rs index 665058e..6fde92b 100644 --- a/nihav-game/src/demuxers/gdv.rs +++ b/nihav-game/src/demuxers/gdv.rs @@ -162,7 +162,7 @@ pktdta: Vec::new(), pub struct GDVDemuxerCreator { } impl DemuxerCreator for GDVDemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(GremlinVideoDemuxer::new(br)) } fn get_name(&self) -> &'static str { "gdv" } diff --git a/nihav-game/src/demuxers/vmd.rs b/nihav-game/src/demuxers/vmd.rs index b670b63..80c503a 100644 --- a/nihav-game/src/demuxers/vmd.rs +++ b/nihav-game/src/demuxers/vmd.rs @@ -171,7 +171,7 @@ impl<'a> VMDDemuxer<'a> { pub struct VMDDemuxerCreator { } impl DemuxerCreator for VMDDemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(VMDDemuxer::new(br)) } fn get_name(&self) -> &'static str { "vmd" } diff --git a/nihav-indeo/src/codecs/imc.rs b/nihav-indeo/src/codecs/imc.rs index 3bf57f8..ce719e6 100644 --- a/nihav-indeo/src/codecs/imc.rs +++ b/nihav-indeo/src/codecs/imc.rs @@ -924,11 +924,11 @@ impl NADecoder for IMCDecoder { } } -pub fn get_decoder_imc() -> Box { +pub fn get_decoder_imc() -> Box { Box::new(IMCDecoder::new(true)) } -pub fn get_decoder_iac() -> Box { +pub fn get_decoder_iac() -> Box { Box::new(IMCDecoder::new(false)) } diff --git a/nihav-indeo/src/codecs/indeo2.rs b/nihav-indeo/src/codecs/indeo2.rs index c703718..375ffa8 100644 --- a/nihav-indeo/src/codecs/indeo2.rs +++ b/nihav-indeo/src/codecs/indeo2.rs @@ -361,7 +361,7 @@ impl NADecoder for Indeo2Decoder { } } -pub fn get_decoder() -> Box { +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 0a59030..2a51fac 100644 --- a/nihav-indeo/src/codecs/indeo3.rs +++ b/nihav-indeo/src/codecs/indeo3.rs @@ -787,7 +787,7 @@ impl NADecoder for Indeo3Decoder { } } -pub fn get_decoder() -> Box { +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 3c8179b..78555f8 100644 --- a/nihav-indeo/src/codecs/indeo4.rs +++ b/nihav-indeo/src/codecs/indeo4.rs @@ -758,7 +758,7 @@ const INDEO4_Q4_INTER: [&[u16; 16]; 5] = [ &INDEO4_QUANT4X4_INTER[3], &INDEO4_QUANT4X4_INTER[4] ]; -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(Indeo4Decoder::new()) } diff --git a/nihav-indeo/src/codecs/indeo5.rs b/nihav-indeo/src/codecs/indeo5.rs index 17ac713..aece25d 100644 --- a/nihav-indeo/src/codecs/indeo5.rs +++ b/nihav-indeo/src/codecs/indeo5.rs @@ -711,7 +711,7 @@ const INDEO5_QSCALE4_INTER: [u8; 24] = [ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23 ]; -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(Indeo5Decoder::new()) } diff --git a/nihav-indeo/src/codecs/intel263.rs b/nihav-indeo/src/codecs/intel263.rs index ed5b3b7..131f2f4 100644 --- a/nihav-indeo/src/codecs/intel263.rs +++ b/nihav-indeo/src/codecs/intel263.rs @@ -407,7 +407,7 @@ impl NADecoder for Intel263Decoder { } -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(Intel263Decoder::new()) } diff --git a/nihav-rad/src/codecs/bink2.rs b/nihav-rad/src/codecs/bink2.rs index 4c71e00..0bcfdd4 100644 --- a/nihav-rad/src/codecs/bink2.rs +++ b/nihav-rad/src/codecs/bink2.rs @@ -1937,7 +1937,7 @@ impl NADecoder for Bink2Decoder { } } -pub fn get_decoder() -> Box { +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 888a724..daae9df 100644 --- a/nihav-rad/src/codecs/binkaud.rs +++ b/nihav-rad/src/codecs/binkaud.rs @@ -275,11 +275,11 @@ impl NADecoder for BinkAudioDecoder { } } -pub fn get_decoder_dct() -> Box { +pub fn get_decoder_dct() -> Box { Box::new(BinkAudioDecoder::new(true)) } -pub fn get_decoder_rdft() -> Box { +pub fn get_decoder_rdft() -> Box { Box::new(BinkAudioDecoder::new(false)) } diff --git a/nihav-rad/src/codecs/binkvid.rs b/nihav-rad/src/codecs/binkvid.rs index e091b72..0a818cb 100644 --- a/nihav-rad/src/codecs/binkvid.rs +++ b/nihav-rad/src/codecs/binkvid.rs @@ -1264,7 +1264,7 @@ println!("decode frame {} b={} i={}", pkt.get_pts().unwrap(), self.is_ver_b, sel } } -pub fn get_decoder() -> Box { +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 f3628be..6eefdce 100644 --- a/nihav-rad/src/codecs/smacker.rs +++ b/nihav-rad/src/codecs/smacker.rs @@ -469,7 +469,7 @@ impl NADecoder for SmackerVideoDecoder { } } -pub fn get_decoder_video() -> Box { +pub fn get_decoder_video() -> Box { Box::new(SmackerVideoDecoder::new()) } @@ -593,7 +593,7 @@ impl NADecoder for SmackerAudioDecoder { } } -pub fn get_decoder_audio() -> Box { +pub fn get_decoder_audio() -> Box { Box::new(SmackerAudioDecoder::new()) } diff --git a/nihav-rad/src/demuxers/bink.rs b/nihav-rad/src/demuxers/bink.rs index ef0e148..8dfbf64 100644 --- a/nihav-rad/src/demuxers/bink.rs +++ b/nihav-rad/src/demuxers/bink.rs @@ -170,7 +170,7 @@ impl<'a> BinkDemuxer<'a> { pub struct BinkDemuxerCreator { } impl DemuxerCreator for BinkDemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(BinkDemuxer::new(br)) } fn get_name(&self) -> &'static str { "bink" } diff --git a/nihav-rad/src/demuxers/smacker.rs b/nihav-rad/src/demuxers/smacker.rs index b666cf1..6555319 100644 --- a/nihav-rad/src/demuxers/smacker.rs +++ b/nihav-rad/src/demuxers/smacker.rs @@ -284,7 +284,7 @@ impl<'a> SmackerVideoDemuxer<'a> { pub struct SMKDemuxerCreator { } impl DemuxerCreator for SMKDemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(SmackerVideoDemuxer::new(br)) } fn get_name(&self) -> &'static str { "smacker" } diff --git a/nihav-realmedia/src/codecs/cook.rs b/nihav-realmedia/src/codecs/cook.rs index ec59b63..e5dba91 100644 --- a/nihav-realmedia/src/codecs/cook.rs +++ b/nihav-realmedia/src/codecs/cook.rs @@ -671,7 +671,7 @@ impl NADecoder for CookDecoder { } } -pub fn get_decoder() -> Box { +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 06da525..b1e730f 100644 --- a/nihav-realmedia/src/codecs/ra144.rs +++ b/nihav-realmedia/src/codecs/ra144.rs @@ -309,7 +309,7 @@ impl NADecoder for RA144Decoder { } } -pub fn get_decoder() -> Box { +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 c3e23d9..4daf517 100644 --- a/nihav-realmedia/src/codecs/ra288.rs +++ b/nihav-realmedia/src/codecs/ra288.rs @@ -199,7 +199,7 @@ impl NADecoder for RA288Decoder { } } -pub fn get_decoder() -> Box { +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 dfd728d..010c03a 100644 --- a/nihav-realmedia/src/codecs/ralf.rs +++ b/nihav-realmedia/src/codecs/ralf.rs @@ -469,7 +469,7 @@ impl NADecoder for RALFDecoder { } } -pub fn get_decoder() -> Box { +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 66e8ff1..79b6a22 100644 --- a/nihav-realmedia/src/codecs/rv10.rs +++ b/nihav-realmedia/src/codecs/rv10.rs @@ -452,7 +452,7 @@ println!("???"); } -pub fn get_decoder() -> Box { +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 527c23e..a7b5f7f 100644 --- a/nihav-realmedia/src/codecs/rv20.rs +++ b/nihav-realmedia/src/codecs/rv20.rs @@ -516,7 +516,7 @@ const H263_MBB: &[MBB; 7] = &[ MBB{ blocks: 65536, bits: 14 }, ]; -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(RealVideo20Decoder::new()) } diff --git a/nihav-realmedia/src/codecs/rv30.rs b/nihav-realmedia/src/codecs/rv30.rs index d729b43..4f70280 100644 --- a/nihav-realmedia/src/codecs/rv30.rs +++ b/nihav-realmedia/src/codecs/rv30.rs @@ -161,7 +161,7 @@ println!("???"); } } -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(RealVideo30Decoder::new()) } diff --git a/nihav-realmedia/src/codecs/rv3040.rs b/nihav-realmedia/src/codecs/rv3040.rs index 42de3e4..1e83d31 100644 --- a/nihav-realmedia/src/codecs/rv3040.rs +++ b/nihav-realmedia/src/codecs/rv3040.rs @@ -716,13 +716,13 @@ fn decode_mv(br: &mut BitReader) -> DecoderResult { Ok(MV{ x: x, y: y }) } -fn do_mc_16x16(dsp: &Box, buf: &mut NAVideoBuffer, prevbuf: &NAVideoBuffer, mb_x: usize, mb_y: usize, mv: MV, avg: bool) { +fn do_mc_16x16(dsp: &Box, buf: &mut NAVideoBuffer, prevbuf: &NAVideoBuffer, 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, buf: &mut NAVideoBuffer, prevbuf: &NAVideoBuffer, mb_x: usize, xoff: usize, mb_y: usize, yoff: usize, mv: MV, avg: bool) { +fn do_mc_8x8(dsp: &Box, buf: &mut NAVideoBuffer, prevbuf: &NAVideoBuffer, 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); @@ -754,7 +754,7 @@ fn do_avg(cdsp: &RV34CommonDSP, buf: &mut NAVideoBuffer, avg_buf: &NAVideoBu pub struct RV34Decoder { is_rv30: bool, coderead: RV34Codes, - dsp: Box, + dsp: Box, cdsp: RV34CommonDSP, width: usize, height: usize, @@ -772,7 +772,7 @@ pub struct RV34Decoder { } impl RV34Decoder { - pub fn new(is_rv30: bool, dsp: Box) -> Self { + pub fn new(is_rv30: bool, dsp: Box) -> 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(); diff --git a/nihav-realmedia/src/codecs/rv40.rs b/nihav-realmedia/src/codecs/rv40.rs index 272226d..61045c2 100644 --- a/nihav-realmedia/src/codecs/rv40.rs +++ b/nihav-realmedia/src/codecs/rv40.rs @@ -354,7 +354,7 @@ println!("???"); } } -pub fn get_decoder() -> Box { +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 8ab11f1..4b7a2f2 100644 --- a/nihav-realmedia/src/codecs/rv60.rs +++ b/nihav-realmedia/src/codecs/rv60.rs @@ -1477,7 +1477,7 @@ println!("???"); } } -pub fn get_decoder() -> Box { +pub fn get_decoder() -> Box { Box::new(RealVideo60Decoder::new()) } diff --git a/nihav-realmedia/src/demuxers/realmedia.rs b/nihav-realmedia/src/demuxers/realmedia.rs index f3f73b9..30b0ccd 100644 --- a/nihav-realmedia/src/demuxers/realmedia.rs +++ b/nihav-realmedia/src/demuxers/realmedia.rs @@ -1571,7 +1571,7 @@ static RM_AUDIO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ pub struct RealMediaDemuxerCreator { } impl DemuxerCreator for RealMediaDemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(RealMediaDemuxer::new(br)) } fn get_name(&self) -> &'static str { "realmedia" } @@ -1580,7 +1580,7 @@ impl DemuxerCreator for RealMediaDemuxerCreator { pub struct RealAudioDemuxerCreator { } impl DemuxerCreator for RealAudioDemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(RealAudioDemuxer::new(br)) } fn get_name(&self) -> &'static str { "realaudio" } @@ -1589,7 +1589,7 @@ impl DemuxerCreator for RealAudioDemuxerCreator { pub struct RealIVRDemuxerCreator { } impl DemuxerCreator for RealIVRDemuxerCreator { - fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { + fn new_demuxer<'a>(&self, br: &'a mut ByteReader<'a>) -> Box + 'a> { Box::new(RealIVRDemuxer::new(br)) } fn get_name(&self) -> &'static str { "real_ivr" } -- 2.39.5