add a lot of debug output
This commit is contained in:
parent
bdba596d07
commit
15c830f0b1
|
@ -53,7 +53,7 @@ fn video_filter(
|
|||
pixel_aspect,
|
||||
fps,
|
||||
);
|
||||
eprintln!("{}", args);
|
||||
eprintln!("🎥 filter args: {}", args);
|
||||
vfilter.add(&filter::find("buffer").unwrap(), "in", &args)?;
|
||||
//scale?
|
||||
vfilter.add(&filter::find("buffersink").unwrap(), "out", "")?;
|
||||
|
@ -65,9 +65,11 @@ fn video_filter(
|
|||
|
||||
vfilter.output("in", 0)?
|
||||
.input("out", 0)?
|
||||
.parse("null")?;
|
||||
.parse("null")?; // passthrough filter for video
|
||||
|
||||
vfilter.validate()?;
|
||||
// human-readable filter graph
|
||||
eprintln!("{}", vfilter.dump());
|
||||
|
||||
Ok(vfilter)
|
||||
}
|
||||
|
@ -79,7 +81,7 @@ fn audio_filter(
|
|||
let mut afilter = filter::Graph::new();
|
||||
let sample_rate = if sample_rate == 0.0 { 32040.0 } else { sample_rate };
|
||||
let args = format!("sample_rate={}:sample_fmt=s16:channel_layout=stereo", sample_rate);
|
||||
eprintln!("{}", args);
|
||||
eprintln!("🔊 filter args: {}", args);
|
||||
afilter.add(&filter::find("abuffer").unwrap(), "in", &args)?;
|
||||
//aresample?
|
||||
afilter.add(&filter::find("abuffersink").unwrap(), "out", "")?;
|
||||
|
@ -175,6 +177,12 @@ impl MyEmulator {
|
|||
self.video_filter.get("in").unwrap().source().add(&vframe).unwrap();
|
||||
self.audio_filter.get("in").unwrap().source().add(&aframe).unwrap();
|
||||
while let Ok(..) = self.video_filter.get("out").unwrap().sink().frame(&mut vframe) {
|
||||
if self.video_filter.get("in").unwrap().source().failed_requests() > 0 {
|
||||
println!("🎥 failed to put filter input frame");
|
||||
}
|
||||
if self.video_filter.get("out").unwrap().source().failed_requests() > 0 {
|
||||
println!("🎥 failed to get filter output frame");
|
||||
}
|
||||
self.video_encoder.encode(&vframe, &mut out).unwrap();
|
||||
}
|
||||
while let Ok(..) = self.audio_filter.get("out").unwrap().sink().frame(&mut aframe) {
|
||||
|
@ -292,6 +300,11 @@ impl retro::wrapper::Handler for MyEmulator {
|
|||
self.video_filter = video_filter(&self.video_encoder, &self.av_info, pixel_format).unwrap();
|
||||
true
|
||||
}
|
||||
|
||||
|
||||
fn log_print(&mut self, level: retro::ffi::LogLevel, msg: &str) {
|
||||
eprint!("🕹️ [{:?}] {}", level, msg);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(StructOpt)]
|
||||
|
@ -341,7 +354,7 @@ fn main() -> Fallible<()> {
|
|||
emu.frame_properties_locked = true;
|
||||
octx.write_header().unwrap();
|
||||
|
||||
for _ in 0..60*60 {
|
||||
eprintln!("🖼️ frame: {}", frame);
|
||||
emu.run();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue