Commit 7c789c47 authored by Raphaël Zumer's avatar Raphaël Zumer Committed by Luca Barbato
Browse files

crav1e: Support new color parameters

parent 3c89c5d1
...@@ -67,7 +67,10 @@ pub struct Packet { ...@@ -67,7 +67,10 @@ pub struct Packet {
pub frame_type: FrameType, pub frame_type: FrameType,
} }
type ChromaSamplePosition=rav1e::ChromaSamplePosition;
type ChromaSampling=rav1e::ChromaSampling; type ChromaSampling=rav1e::ChromaSampling;
type ColorDescription=rav1e::ColorDescription;
type EncoderConfig=rav1e::EncoderConfig;
type Rational=rav1e::Rational; type Rational=rav1e::Rational;
#[no_mangle] #[no_mangle]
...@@ -76,17 +79,23 @@ pub unsafe extern "C" fn rav1e_config_default( ...@@ -76,17 +79,23 @@ pub unsafe extern "C" fn rav1e_config_default(
height: u32, height: u32,
bit_depth: u8, bit_depth: u8,
chroma_sampling: ChromaSampling, chroma_sampling: ChromaSampling,
chroma_sample_position: ChromaSamplePosition,
color_description: Option<ColorDescription>,
timebase: Rational, timebase: Rational,
) -> *mut Config { ) -> *mut Config {
let mut enc: EncoderConfig = Default::default();
enc.color_description = color_description;
let cfg = rav1e::Config { let cfg = rav1e::Config {
frame_info: rav1e::FrameInfo { frame_info: rav1e::FrameInfo {
width: width as usize, width: width as usize,
height: height as usize, height: height as usize,
bit_depth: bit_depth as usize, bit_depth: bit_depth as usize,
chroma_sampling, chroma_sampling,
chroma_sample_position,
}, },
timebase, timebase,
enc: Default::default(), enc,
}; };
let c = Box::new(Config { let c = Box::new(Config {
......
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