logging
All checks were successful
CI / React UI Build (push) Successful in 38s
CI / Native Windows Build And Tests (push) Successful in 3m12s
CI / Windows Release Package (push) Successful in 3m7s

This commit is contained in:
Aiden
2026-05-12 11:58:29 +10:00
parent 511b67c9bc
commit 44b198b14d
10 changed files with 555 additions and 12 deletions

View File

@@ -1,13 +1,13 @@
#pragma once
#include "AppConfig.h"
#include "../logging/Logger.h"
#include "../runtime/RuntimeShaderBridge.h"
#include "../telemetry/TelemetryPrinter.h"
#include "../video/DeckLinkOutput.h"
#include "../video/DeckLinkOutputThread.h"
#include <chrono>
#include <iostream>
#include <string>
#include <thread>
#include <type_traits>
@@ -65,6 +65,7 @@ public:
bool Start(std::string& error)
{
Log("app", "Initializing DeckLink output.");
if (!mOutput.Initialize(
mConfig.deckLink,
[this](const VideoIOCompletion& completion) {
@@ -72,44 +73,56 @@ public:
},
error))
{
LogError("app", "DeckLink output initialization failed: " + error);
return false;
}
Log("app", "Starting render thread.");
if (!detail::StartRenderThread(mRenderThread, error, 0))
{
LogError("app", "Render thread start failed: " + error);
Stop();
return false;
}
StartRuntimeShaderBuild();
Log("app", "Waiting for rendered warmup frames.");
if (!mFrameExchange.WaitForCompletedDepth(mConfig.warmupCompletedFrames, mConfig.warmupTimeout))
{
error = "Timed out waiting for rendered warmup frames.";
LogError("app", error);
Stop();
return false;
}
Log("app", "Starting DeckLink output thread.");
if (!mOutputThread.Start())
{
error = "DeckLink output thread failed to start.";
LogError("app", error);
Stop();
return false;
}
Log("app", "Waiting for DeckLink preroll frames.");
if (!WaitForPreroll())
{
error = "Timed out waiting for DeckLink preroll frames.";
LogError("app", error);
Stop();
return false;
}
Log("app", "Starting DeckLink scheduled playback.");
if (!mOutput.StartScheduledPlayback(error))
{
LogError("app", "DeckLink scheduled playback failed: " + error);
Stop();
return false;
}
mTelemetry.Start(mFrameExchange, mOutput, mOutputThread, mRenderThread);
Log("app", "RenderCadenceCompositor started.");
mStarted = true;
return true;
}
@@ -122,6 +135,8 @@ public:
StopRuntimeShaderBuild();
mRenderThread.Stop();
mOutput.ReleaseResources();
if (mStarted)
Log("app", "RenderCadenceCompositor shutdown complete.");
mStarted = false;
}
@@ -143,13 +158,20 @@ private:
void StartRuntimeShaderBuild()
{
if (mConfig.runtimeShaderId.empty())
{
Log("runtime-shader", "Runtime shader build disabled.");
return;
}
Log("runtime-shader", "Starting background Slang build for shader '" + mConfig.runtimeShaderId + "'.");
mShaderBridge.Start(
mConfig.runtimeShaderId,
[this](const RuntimeShaderArtifact& artifact) {
mRenderThread.SubmitRuntimeShaderArtifact(artifact);
},
[](const std::string& message) {
std::cout << "Runtime Slang build failed: " << message << "\n";
LogError("runtime-shader", "Runtime Slang build failed: " + message);
});
}