Files
video-shader-toys/apps/LoopThroughWithOpenGLCompositing/videoio/VideoPlayoutPolicy.h
Aiden 52eaf16a8c
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 2m44s
CI / Windows Release Package (push) Successful in 2m57s
Phase 7 step 2
2026-05-11 20:45:58 +10:00

35 lines
906 B
C++

#pragma once
#include <cstdint>
enum class VideoUnderrunBehavior
{
ReuseLastCompletedFrame,
BlackFrame
};
struct VideoPlayoutPolicy
{
unsigned outputFramePoolSize = 10;
unsigned targetPrerollFrames = 12;
unsigned targetReadyFrames = 2;
unsigned maxReadyFrames = 4;
unsigned minimumSpareDeviceFrames = 1;
uint64_t lateOrDropCatchUpFrames = 2;
VideoUnderrunBehavior underrunBehavior = VideoUnderrunBehavior::ReuseLastCompletedFrame;
bool adaptiveHeadroomEnabled = false;
};
inline VideoPlayoutPolicy NormalizeVideoPlayoutPolicy(VideoPlayoutPolicy policy)
{
if (policy.outputFramePoolSize == 0)
policy.outputFramePoolSize = 1;
if (policy.targetPrerollFrames == 0)
policy.targetPrerollFrames = 1;
if (policy.targetReadyFrames == 0)
policy.targetReadyFrames = 1;
if (policy.maxReadyFrames < policy.targetReadyFrames)
policy.maxReadyFrames = policy.targetReadyFrames;
return policy;
}