Skip to content

Commit 41c700a

Browse files
tdaedebarrbrain
authored andcommitted
Add minimum frame delay test.
Currently the latency is 3 frames.
1 parent 27f71de commit 41c700a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/api/test.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,34 @@ fn switch_frame_interval() {
307307
);
308308
}
309309

310+
#[test]
311+
fn minimum_frame_delay() {
312+
let mut ctx = setup_encoder::<u8>(
313+
64,
314+
80,
315+
10,
316+
100,
317+
8,
318+
ChromaSampling::Cs420,
319+
5,
320+
5,
321+
0,
322+
true,
323+
0,
324+
true,
325+
1,
326+
);
327+
328+
let limit = 4; // 4 frames in for 1 frame out (delay of 3 frames)
329+
send_frames(&mut ctx, limit, 0);
330+
331+
let data = get_frame_invariants(ctx)
332+
.map(|fi| (fi.input_frameno, fi.frame_type))
333+
.collect::<Vec<_>>();
334+
335+
assert_eq!(&data[..], &[(0, FrameType::KEY),][..]);
336+
}
337+
310338
#[interpolate_test(0, 0)]
311339
#[interpolate_test(1, 1)]
312340
fn pyramid_level_low_latency_minus(missing: u64) {

0 commit comments

Comments
 (0)