Skip to content

Commit

Permalink
Freshen the example tool
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed Jan 19, 2021
1 parent 7c0f29a commit e287ae6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Luca Barbato <lu_zero@gentoo.org>"]
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"
14 changes: 4 additions & 10 deletions tools/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mod ivf {
use bitstream_io::{BitReader, LittleEndian};
use bitstream_io::{BitRead, BitReader, LittleEndian};
use std::io;

#[derive(Debug, PartialEq)]
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e287ae6

Please sign in to comment.