Skip to content

Commit

Permalink
Create two scripts, parse sequence header for key frame and parse ent…
Browse files Browse the repository at this point in the history
…ire frames
  • Loading branch information
friendlymatthew committed Oct 17, 2024
1 parent a0928d3 commit c18c0e9
Show file tree
Hide file tree
Showing 4 changed files with 568 additions and 10 deletions.
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
[package]
name = "parser"
edition = "2021"

[[bin]]
name = "decode_frames"
path = "bin/decode_frames.rs"

[[bin]]
name = "decode_key"
path = "bin/decode_key.rs"


[dependencies]
clap = { version = "4.5.20", features = ["derive"] }
Expand Down
13 changes: 3 additions & 10 deletions src/main.rs → bin/decode_frames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ extern crate eyre;
extern crate libdav1d_sys;

use clap::Parser;
use eyre::{eyre, Ok, Result};
use eyre::{eyre, Result};
use libdav1d_sys::{
dav1d_data_create, dav1d_data_wrap, dav1d_default_settings, DAV1D_ERR, dav1d_get_picture,
dav1d_open, dav1d_parse_sequence_header, dav1d_send_data, Dav1dAdaptiveBoolean,
Dav1dChromaSamplePosition, Dav1dColorPrimaries, Dav1dContext, Dav1dDecodeFrameType, Dav1dLogger,
Dav1dMatrixCoefficients, Dav1dPicAllocator, Dav1dPicture, Dav1dPixelLayout,
Dav1dSequenceHeader,
Dav1dSequenceHeader_Dav1dSequenceHeaderOperatingParameterInfo, Dav1dSequenceHeader_Dav1dSequenceHeaderOperatingPoint,
Dav1dSettings, Dav1dTransferCharacteristics,
dav1d_data_create, dav1d_default_settings, dav1d_get_picture, dav1d_open, dav1d_send_data,
Dav1dContext, Dav1dPicture, Dav1dSettings,
};

#[derive(Parser, Debug)]
Expand Down Expand Up @@ -86,8 +81,6 @@ fn main() -> Result<()> {
println!(" Show frame: {}", frame_header.show_frame);
println!(" Showable frame: {}", frame_header.showable_frame);
}

Ok(())
}

#[cfg(test)]
Expand Down
Loading

0 comments on commit c18c0e9

Please sign in to comment.