Frame timing
This commit is contained in:
@@ -94,6 +94,29 @@ void TestOverflowReleasesDroppedFrame()
|
||||
Expect(gReleasedFrames == 1, "pop transfers ownership without releasing");
|
||||
}
|
||||
|
||||
void TestDropOldestFrameReleasesFrame()
|
||||
{
|
||||
gReleasedFrames = 0;
|
||||
VideoPlayoutPolicy policy;
|
||||
policy.maxReadyFrames = 2;
|
||||
RenderOutputQueue queue(policy);
|
||||
|
||||
queue.Push(MakeOwnedFrame(1));
|
||||
queue.Push(MakeOwnedFrame(2));
|
||||
|
||||
Expect(queue.DropOldestFrame(), "oldest ready frame can be explicitly dropped");
|
||||
Expect(gReleasedFrames == 1, "explicit drop releases oldest frame");
|
||||
|
||||
RenderOutputQueueMetrics metrics = queue.GetMetrics();
|
||||
Expect(metrics.depth == 1, "explicit drop reduces queue depth");
|
||||
Expect(metrics.droppedCount == 1, "explicit drop increments dropped count");
|
||||
|
||||
RenderOutputFrame frame;
|
||||
Expect(queue.TryPop(frame), "newest frame remains after explicit drop");
|
||||
Expect(frame.frameIndex == 2, "explicit drop keeps newest frame");
|
||||
Expect(!queue.DropOldestFrame(), "empty queue cannot drop a frame");
|
||||
}
|
||||
|
||||
void TestUnderrunIsCounted()
|
||||
{
|
||||
RenderOutputQueue queue;
|
||||
@@ -169,6 +192,7 @@ int main()
|
||||
TestQueuePreservesOrdering();
|
||||
TestBoundedQueueDropsOldestFrame();
|
||||
TestOverflowReleasesDroppedFrame();
|
||||
TestDropOldestFrameReleasesFrame();
|
||||
TestUnderrunIsCounted();
|
||||
TestConfigureShrinksDepthToNewCapacity();
|
||||
TestConfigureReleasesTrimmedFrames();
|
||||
|
||||
Reference in New Issue
Block a user