INput
All checks were successful
CI / React UI Build (push) Successful in 10s
CI / Native Windows Build And Tests (push) Successful in 2m59s
CI / Windows Release Package (push) Has been skipped

This commit is contained in:
Aiden
2026-05-12 18:39:08 +10:00
parent 6e32941675
commit 0a8b335048
14 changed files with 822 additions and 24 deletions

View File

@@ -1,9 +1,11 @@
#include "app/AppConfig.h"
#include "app/AppConfigProvider.h"
#include "app/RenderCadenceApp.h"
#include "frames/InputFrameMailbox.h"
#include "frames/SystemFrameExchange.h"
#include "logging/Logger.h"
#include "render/RenderThread.h"
#include "video/SyntheticInputProducer.h"
#include "VideoIOFormat.h"
#include <windows.h>
@@ -80,13 +82,33 @@ int main(int argc, char** argv)
SystemFrameExchange frameExchange(frameExchangeConfig);
InputFrameMailboxConfig inputMailboxConfig;
RenderCadenceCompositor::VideoFormatDimensions(
appConfig.inputVideoFormat,
inputMailboxConfig.width,
inputMailboxConfig.height);
inputMailboxConfig.pixelFormat = VideoIOPixelFormat::Bgra8;
inputMailboxConfig.rowBytes = VideoIORowBytes(inputMailboxConfig.pixelFormat, inputMailboxConfig.width);
inputMailboxConfig.capacity = 4;
InputFrameMailbox inputMailbox(inputMailboxConfig);
RenderCadenceCompositor::SyntheticInputProducerConfig inputProducerConfig;
inputProducerConfig.width = inputMailboxConfig.width;
inputProducerConfig.height = inputMailboxConfig.height;
inputProducerConfig.frameDurationMilliseconds = RenderCadenceCompositor::FrameDurationMillisecondsFromRateString(appConfig.inputFrameRate);
RenderCadenceCompositor::SyntheticInputProducer syntheticInput(inputMailbox, inputProducerConfig);
if (syntheticInput.Start())
RenderCadenceCompositor::Log("app", "Synthetic BGRA8 input producer started.");
else
RenderCadenceCompositor::LogWarning("app", "Synthetic input producer did not start; shaders will use fallback input.");
RenderThread::Config renderConfig;
renderConfig.width = frameExchangeConfig.width;
renderConfig.height = frameExchangeConfig.height;
renderConfig.frameDurationMilliseconds = RenderCadenceCompositor::FrameDurationMillisecondsFromRateString(appConfig.outputFrameRate);
renderConfig.pboDepth = 6;
RenderThread renderThread(frameExchange, renderConfig);
RenderThread renderThread(frameExchange, &inputMailbox, renderConfig);
RenderCadenceCompositor::RenderCadenceApp<RenderThread, SystemFrameExchange> app(renderThread, frameExchange, appConfig);
@@ -94,6 +116,7 @@ int main(int argc, char** argv)
if (!app.Start(error))
{
RenderCadenceCompositor::LogError("app", "RenderCadenceCompositor start failed: " + error);
syntheticInput.Stop();
RenderCadenceCompositor::Logger::Instance().Stop();
return 1;
}
@@ -101,6 +124,7 @@ int main(int argc, char** argv)
std::string line;
std::getline(std::cin, line);
app.Stop();
syntheticInput.Stop();
RenderCadenceCompositor::Log("app", "RenderCadenceCompositor stopped.");
RenderCadenceCompositor::Logger::Instance().Stop();
return 0;