Skip to content

Commit

Permalink
Add minimum frame delay test.
Browse files Browse the repository at this point in the history
Currently the latency is 3 frames.
  • Loading branch information
tdaede committed May 14, 2020
1 parent 5d7599c commit a4840d9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/api/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,34 @@ fn switch_frame_interval() {
);
}

#[test]
fn minimum_frame_delay() {
let mut ctx = setup_encoder::<u8>(
64,
80,
10,
100,
8,
ChromaSampling::Cs420,
5,
5,
0,
true,
0,
true,
1,
);

let limit = 4; // 4 frames in for 1 frame out (delay of 3 frames)
send_frames(&mut ctx, limit, 0);

let data = get_frame_invariants(ctx)
.map(|fi| (fi.input_frameno, fi.frame_type))
.collect::<Vec<_>>();

assert_eq!(&data[..], &[(0, FrameType::KEY),][..]);
}

#[interpolate_test(0, 0)]
#[interpolate_test(1, 1)]
fn pyramid_level_low_latency_minus(missing: u64) {
Expand Down

0 comments on commit a4840d9

Please sign in to comment.