WIP get compiling again

This commit is contained in:
lif 2020-01-24 23:58:04 -08:00
parent b9023a0131
commit e4046986d2
2 changed files with 9 additions and 3 deletions

View File

@ -19,4 +19,4 @@ sdl2 = "^0.32"
crossbeam-channel = "^0.4"
structopt = "^0.3"
# example: ffmpeg_recorder
ffmpeg4 = "*"
ffmpeg4 = "0.4.0"

View File

@ -19,6 +19,7 @@ use ffmpeg::util::rational::Rational;
struct MyEmulator {
retro: retro::wrapper::LibretroWrapper,
sys_info: SystemInfo,
av_info: SystemAvInfo,
audio_buf: Vec<(i16, i16)>,
video_pixel_format: format::Pixel,
video_frames: VecDeque<frame::Video>,
@ -109,9 +110,10 @@ impl MyEmulator {
video_encoder.set_height(av_info.geometry.base_height);
video_encoder.set_aspect_ratio(av_info.geometry.aspect_ratio as f64);
audio_encoder.set_rate(system_av_info.timing.sample_rate.round() as i32);
audio_encoder.set_rate(av_info.timing.sample_rate.round() as i32);
let video_filter = video_filter(&video_encoder, &av_info).unwrap();
let pix_fmt = PixelFormat::ARGB1555; // temporary until env call is made
let video_filter = video_filter(&video_encoder, &av_info, pix_fmt).unwrap();
let audio_filter = audio_filter(&audio_encoder, av_info.timing.sample_rate).unwrap();
let video_encoder = video_encoder.open().unwrap();
@ -120,6 +122,7 @@ impl MyEmulator {
let emu = MyEmulator {
retro,
sys_info,
av_info: av_info.clone(),
audio_buf: Default::default(),
video_pixel_format: format::Pixel::RGB555,
video_frames: Default::default(),
@ -223,6 +226,7 @@ impl retro::wrapper::Handler for MyEmulator {
PixelFormat::ARGB8888 => format::Pixel::RGB32,
PixelFormat::RGB565 => format::Pixel::RGB565,
};
self.video_filter = video_filter(&self.video_encoder, &self.av_info, format).unwrap();
true
}
@ -230,6 +234,7 @@ impl retro::wrapper::Handler for MyEmulator {
self.video_encoder.set_frame_rate(system_av_info.timing.fps.into());
self.audio_encoder.set_rate(system_av_info.timing.sample_rate.round() as i32);
self.set_geometry(system_av_info.geometry);
self.av_info.timing = system_av_info.timing;
true
}
@ -237,6 +242,7 @@ impl retro::wrapper::Handler for MyEmulator {
self.video_encoder.set_width(geometry.base_width);
self.video_encoder.set_height(geometry.base_height);
self.video_encoder.set_aspect_ratio(geometry.aspect_ratio as f64);
self.av_info.geometry = geometry;
true
}
}