From e287ae6221f48b1941b21155a85775d9256137ff Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Tue, 19 Jan 2021 16:23:18 +0100 Subject: [PATCH] Freshen the example tool --- tools/Cargo.toml | 2 +- tools/src/main.rs | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/tools/Cargo.toml b/tools/Cargo.toml index cb8fbbb..154e3e9 100644 --- a/tools/Cargo.toml +++ b/tools/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Luca Barbato "] edition = "2018" [dependencies] -dav1d = { path = "..", version = "0.5.0" } +dav1d = { path = "..", version = "0.6.0" } bitstream-io = "1.0" log = "0.4" structopt = "0.3" diff --git a/tools/src/main.rs b/tools/src/main.rs index c84a2e0..b5dd4ac 100644 --- a/tools/src/main.rs +++ b/tools/src/main.rs @@ -1,5 +1,5 @@ mod ivf { - use bitstream_io::{BitReader, LittleEndian}; + use bitstream_io::{BitRead, BitReader, LittleEndian}; use std::io; #[derive(Debug, PartialEq)] @@ -86,18 +86,12 @@ fn main() -> std::io::Result<()> { while let Ok(packet) = ivf::read_packet(&mut r) { println!("Packet {}", packet.pts); - dec.send_data(packet.data); + dec.send_data(packet.data, None, None, None).unwrap(); loop { match dec.get_picture() { - Ok(p) => unsafe { - let frame_hdr = *p.frame_hdr; - println!( - " Frame {} {} {}", - frame_hdr.frame_id, frame_hdr.show_frame, frame_hdr.showable_frame - ); - }, + Ok(p) => println!("{:?}", p), Err(e) => { - if e == -(dav1d::EAGAIN as i32) { + if e.is_again() { break; } else { panic!("Error {}", e);