35 lines
906 B
C++
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;
|
|
}
|