Phase 7 step 2
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user