}
impl<'a> DispQueue<'a> {
- fn new(texture_creator: &'a TextureCreator<WindowContext>, width: usize, height: usize, len: usize) -> Self {
- let pool = SDLPool::new(texture_creator, width, height, len);
+ fn new(texture_creator: &'a TextureCreator<WindowContext>, width: usize, height: usize, orig_w: usize, orig_h: usize, len: usize) -> Self {
+ let pool = SDLPool::new(texture_creator, orig_w, orig_h, len);
let mut empty_tex = texture_creator.create_texture_streaming(PixelFormatEnum::RGB24, width as u32, height as u32).expect("failed to create RGB texture");
empty_tex.with_lock(None, |buffer: &mut [u8], _pitch: usize| {
window.show();
let mut canvas = window.into_canvas().build().expect("should be able to build canvas");
let texture_creator = canvas.texture_creator();
- let mut disp_q = DispQueue::new(&texture_creator, width, height, if self.has_video { FRAME_QUEUE_LEN } else { 0 });
+ let mut disp_q = DispQueue::new(&texture_creator, width, height, dec_w, dec_h, if self.has_video { FRAME_QUEUE_LEN } else { 0 });
if !self.has_video {
canvas.clear();
canvas.copy(disp_q.get_last_texture(), None, None).expect("blit failure");