Stage 1 rewrite
This commit is contained in:
@@ -513,7 +513,6 @@ void VideoBackend::ProcessOutputFrameCompletion(const VideoIOCompletion& complet
|
||||
}
|
||||
NotifyOutputProducer();
|
||||
|
||||
NotifyOutputProducer();
|
||||
RecordBackendPlayoutHealth(completion.result, recoveryDecision);
|
||||
RecordSystemMemoryPlayoutStats();
|
||||
}
|
||||
@@ -702,10 +701,12 @@ bool VideoBackend::ScheduleReadyOutputFrame()
|
||||
|
||||
if (!ScheduleOutputFrame(readyFrame.frame))
|
||||
{
|
||||
RecordDeckLinkBufferTelemetry();
|
||||
mSystemOutputFramePool.ReleaseSlotByBuffer(readyFrame.frame.bytes);
|
||||
return false;
|
||||
}
|
||||
|
||||
RecordDeckLinkBufferTelemetry();
|
||||
PublishOutputFrameScheduled(readyFrame.frame);
|
||||
RecordSystemMemoryPlayoutStats();
|
||||
return true;
|
||||
@@ -726,10 +727,12 @@ bool VideoBackend::ScheduleBlackUnderrunFrame()
|
||||
|
||||
if (!ScheduleOutputFrame(outputFrame))
|
||||
{
|
||||
RecordDeckLinkBufferTelemetry();
|
||||
ApplyLifecycleTransition(VideoBackendLifecycleState::Degraded, "Output underrun: black fallback frame scheduling failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
RecordDeckLinkBufferTelemetry();
|
||||
ApplyLifecycleTransition(VideoBackendLifecycleState::Degraded, "Output underrun: scheduled black fallback frame.");
|
||||
PublishOutputFrameScheduled(outputFrame);
|
||||
return true;
|
||||
@@ -787,10 +790,25 @@ void VideoBackend::RecordReadyQueueDepthSample(const RenderOutputQueueMetrics& m
|
||||
++mReadyQueueZeroDepthCount;
|
||||
}
|
||||
|
||||
void VideoBackend::RecordDeckLinkBufferTelemetry()
|
||||
{
|
||||
if (!mVideoIODevice)
|
||||
return;
|
||||
|
||||
const VideoIOState& state = mVideoIODevice->State();
|
||||
mHealthTelemetry.TryRecordDeckLinkBufferTelemetry(
|
||||
state.actualDeckLinkBufferedFramesAvailable,
|
||||
state.actualDeckLinkBufferedFrames,
|
||||
static_cast<std::size_t>(mPlayoutPolicy.targetPrerollFrames),
|
||||
state.deckLinkScheduleCallMilliseconds,
|
||||
state.deckLinkScheduleFailureCount);
|
||||
}
|
||||
|
||||
void VideoBackend::RecordSystemMemoryPlayoutStats()
|
||||
{
|
||||
const SystemOutputFramePoolMetrics poolMetrics = mSystemOutputFramePool.GetMetrics();
|
||||
const RenderOutputQueueMetrics queueMetrics = mReadyOutputQueue.GetMetrics();
|
||||
RecordDeckLinkBufferTelemetry();
|
||||
mHealthTelemetry.TryRecordSystemMemoryPlayoutStats(
|
||||
poolMetrics.freeCount,
|
||||
poolMetrics.readyCount,
|
||||
|
||||
Reference in New Issue
Block a user