mirror of
https://github.com/storytold/effectcraft.git
synced 2026-12-01 22:19:05 +00:00
media: supply FFV1 config_record extradata in TrackDecoder unit test
This commit is contained in:
@@ -3275,11 +3275,25 @@ mod tests {
|
||||
fn ffv1_and_apv_video_codecs_route_through_craft_video() {
|
||||
assert!(supports_video_codec(CodecId::Ffv1));
|
||||
assert!(supports_video_codec(CodecId::Apv));
|
||||
for codec in [CodecId::Ffv1, CodecId::Apv] {
|
||||
let mut params = CodecParams::new(codec);
|
||||
params.width = Some(16);
|
||||
params.height = Some(16);
|
||||
assert!(TrackDecoder::with_options(¶ms, TrackDecoderOptions { threads: Some(1), draft: false }).is_ok(), "{codec:?} decoder");
|
||||
}
|
||||
|
||||
let template = craft_video::ffv1::Frame {
|
||||
width: 16,
|
||||
height: 16,
|
||||
colorspace: craft_video::ffv1::Colorspace::YCbCr,
|
||||
bit_depth: 8,
|
||||
chroma_shift: (1, 1),
|
||||
planes: vec![vec![128; 256], vec![128; 64], vec![128; 64]],
|
||||
};
|
||||
let ffv1_enc = craft_video::ffv1::Encoder::new(&template, craft_video::ffv1::EncoderConfig::default()).expect("ffv1 encoder");
|
||||
let mut ffv1_params = CodecParams::new(CodecId::Ffv1);
|
||||
ffv1_params.width = Some(16);
|
||||
ffv1_params.height = Some(16);
|
||||
ffv1_params.extradata = ffv1_enc.config_record();
|
||||
assert!(TrackDecoder::with_options(&ffv1_params, TrackDecoderOptions { threads: Some(1), draft: false }).is_ok(), "Ffv1 decoder");
|
||||
|
||||
let mut apv_params = CodecParams::new(CodecId::Apv);
|
||||
apv_params.width = Some(16);
|
||||
apv_params.height = Some(16);
|
||||
assert!(TrackDecoder::with_options(&apv_params, TrackDecoderOptions { threads: Some(1), draft: false }).is_ok(), "Apv decoder");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user