Commit 39e2d7ab authored by Luca Barbato's avatar Luca Barbato Committed by Luca Barbato

Add Display for Context

And use it in rav1e to output the same stats it did before.
parent 8a59a709
......@@ -3,6 +3,7 @@ use context::CDFContext;
use partition::LAST_FRAME;
use std::collections::VecDeque;
use std::fmt;
use std::sync::Arc;
// TODO: use the num crate?
......@@ -148,3 +149,9 @@ impl Context {
self.frame_q.push_back(None);
}
}
impl fmt::Display for Context {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Frame {} - {}", self.fi.number, self.fi.frame_type)
}
}
......@@ -126,6 +126,7 @@ pub fn process_frame(ctx: &mut Context,
_ => panic! ("unknown input bit depth!"),
}
eprintln!("{}", ctx);
let _ = ctx.send_frame(input);
let pkt = ctx.receive_packet().unwrap();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment