Phase 3 refactor in progress
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "RuntimeCoordinator.h"
|
||||
#include "RuntimeEventDispatcher.h"
|
||||
#include "RuntimeParameterUtils.h"
|
||||
#include "RuntimeServiceLiveBridge.h"
|
||||
#include "RuntimeServices.h"
|
||||
#include "RuntimeSnapshotProvider.h"
|
||||
#include "RuntimeStore.h"
|
||||
@@ -302,61 +303,30 @@ void OpenGLComposite::renderEffect()
|
||||
{
|
||||
if (mRuntimeUpdateController)
|
||||
mRuntimeUpdateController->ProcessRuntimeWork();
|
||||
std::vector<RuntimeServices::AppliedOscUpdate> appliedOscUpdates;
|
||||
std::vector<RuntimeServices::CompletedOscCommit> completedOscCommits;
|
||||
if (mRuntimeServices)
|
||||
{
|
||||
std::string oscError;
|
||||
if (!mRuntimeServices->ApplyPendingOscUpdates(appliedOscUpdates, oscError) && !oscError.empty())
|
||||
OutputDebugStringA(("OSC apply failed: " + oscError + "\n").c_str());
|
||||
mRuntimeServices->ConsumeCompletedOscCommits(completedOscCommits);
|
||||
}
|
||||
|
||||
std::vector<RenderEngine::OscOverlayUpdate> overlayUpdates;
|
||||
overlayUpdates.reserve(appliedOscUpdates.size());
|
||||
for (const RuntimeServices::AppliedOscUpdate& update : appliedOscUpdates)
|
||||
{
|
||||
overlayUpdates.push_back({ update.routeKey, update.layerKey, update.parameterKey, update.targetValue });
|
||||
}
|
||||
|
||||
std::vector<RenderEngine::OscOverlayCommitCompletion> overlayCommitCompletions;
|
||||
overlayCommitCompletions.reserve(completedOscCommits.size());
|
||||
for (const RuntimeServices::CompletedOscCommit& completedCommit : completedOscCommits)
|
||||
{
|
||||
overlayCommitCompletions.push_back({ completedCommit.routeKey, completedCommit.generation });
|
||||
}
|
||||
|
||||
if (mRenderEngine)
|
||||
mRenderEngine->UpdateOscOverlayState(overlayUpdates, overlayCommitCompletions);
|
||||
|
||||
const bool hasInputSource = mVideoBackend->HasInputSource();
|
||||
std::vector<RuntimeRenderState> layerStates;
|
||||
std::vector<RenderEngine::OscOverlayCommitRequest> overlayCommitRequests;
|
||||
const double smoothing = mRuntimeStore ? mRuntimeStore->GetConfiguredOscSmoothing() : 0.0;
|
||||
mRenderEngine->ResolveRenderLayerStates(
|
||||
mRuntimeCoordinator && mRuntimeCoordinator->UseCommittedLayerStates(),
|
||||
mVideoBackend->InputFrameWidth(),
|
||||
mVideoBackend->InputFrameHeight(),
|
||||
smoothing,
|
||||
&overlayCommitRequests,
|
||||
layerStates);
|
||||
if (mRuntimeServices)
|
||||
{
|
||||
for (const RenderEngine::OscOverlayCommitRequest& commitRequest : overlayCommitRequests)
|
||||
{
|
||||
std::string commitError;
|
||||
if (!mRuntimeServices->QueueOscCommit(
|
||||
commitRequest.routeKey,
|
||||
commitRequest.layerKey,
|
||||
commitRequest.parameterKey,
|
||||
commitRequest.value,
|
||||
commitRequest.generation,
|
||||
commitError) &&
|
||||
!commitError.empty())
|
||||
{
|
||||
OutputDebugStringA(("OSC commit queue failed: " + commitError + "\n").c_str());
|
||||
}
|
||||
}
|
||||
RuntimeServiceLiveBridge::PrepareLiveRenderLayerStates(
|
||||
*mRuntimeServices,
|
||||
*mRenderEngine,
|
||||
mRuntimeCoordinator && mRuntimeCoordinator->UseCommittedLayerStates(),
|
||||
mVideoBackend->InputFrameWidth(),
|
||||
mVideoBackend->InputFrameHeight(),
|
||||
smoothing,
|
||||
layerStates);
|
||||
}
|
||||
else
|
||||
{
|
||||
mRenderEngine->ResolveRenderLayerStates(
|
||||
mRuntimeCoordinator && mRuntimeCoordinator->UseCommittedLayerStates(),
|
||||
mVideoBackend->InputFrameWidth(),
|
||||
mVideoBackend->InputFrameHeight(),
|
||||
smoothing,
|
||||
nullptr,
|
||||
layerStates);
|
||||
}
|
||||
const unsigned historyCap = mRuntimeStore ? mRuntimeStore->GetConfiguredMaxTemporalHistoryFrames() : 0;
|
||||
mRenderEngine->RenderLayerStack(
|
||||
|
||||
Reference in New Issue
Block a user