Phase 7 step 2
This commit is contained in:
@@ -50,6 +50,33 @@ void TestLateAndDroppedSkipAhead()
|
||||
Expect(scheduler.NextScheduleTime().streamTime == 6000, "dropped completion preserves the existing two-frame skip policy");
|
||||
}
|
||||
|
||||
void TestLateAndDroppedRecoveryUsesPolicy()
|
||||
{
|
||||
VideoPlayoutPolicy policy;
|
||||
policy.lateOrDropCatchUpFrames = 4;
|
||||
|
||||
VideoPlayoutScheduler scheduler;
|
||||
scheduler.Configure(1000, 50000, policy);
|
||||
|
||||
(void)scheduler.NextScheduleTime();
|
||||
scheduler.AccountForCompletionResult(VideoIOCompletionResult::Dropped);
|
||||
Expect(scheduler.NextScheduleTime().streamTime == 5000, "drop recovery uses policy catch-up frame count");
|
||||
}
|
||||
|
||||
void TestPolicyNormalization()
|
||||
{
|
||||
VideoPlayoutPolicy policy;
|
||||
policy.outputFramePoolSize = 0;
|
||||
policy.targetPrerollFrames = 0;
|
||||
policy.targetReadyFrames = 5;
|
||||
policy.maxReadyFrames = 2;
|
||||
|
||||
VideoPlayoutPolicy normalized = NormalizeVideoPlayoutPolicy(policy);
|
||||
Expect(normalized.outputFramePoolSize == 1, "policy normalization keeps at least one output frame");
|
||||
Expect(normalized.targetPrerollFrames == 1, "policy normalization keeps at least one preroll frame");
|
||||
Expect(normalized.maxReadyFrames == normalized.targetReadyFrames, "policy normalization keeps max ready frames above target");
|
||||
}
|
||||
|
||||
void TestFrameBudgets()
|
||||
{
|
||||
VideoPlayoutScheduler scheduler;
|
||||
@@ -68,6 +95,8 @@ int main()
|
||||
{
|
||||
TestScheduleAdvancesFromZero();
|
||||
TestLateAndDroppedSkipAhead();
|
||||
TestLateAndDroppedRecoveryUsesPolicy();
|
||||
TestPolicyNormalization();
|
||||
TestFrameBudgets();
|
||||
|
||||
if (gFailures != 0)
|
||||
|
||||
Reference in New Issue
Block a user