intial phase 1 subsytem split
This commit is contained in:
@@ -98,12 +98,16 @@ set(APP_SOURCES
|
|||||||
"${APP_DIR}/resource.h"
|
"${APP_DIR}/resource.h"
|
||||||
"${APP_DIR}/runtime/RuntimeHost.cpp"
|
"${APP_DIR}/runtime/RuntimeHost.cpp"
|
||||||
"${APP_DIR}/runtime/RuntimeHost.h"
|
"${APP_DIR}/runtime/RuntimeHost.h"
|
||||||
|
"${APP_DIR}/runtime/RuntimeSnapshotProvider.cpp"
|
||||||
|
"${APP_DIR}/runtime/RuntimeSnapshotProvider.h"
|
||||||
"${APP_DIR}/runtime/RuntimeClock.cpp"
|
"${APP_DIR}/runtime/RuntimeClock.cpp"
|
||||||
"${APP_DIR}/runtime/RuntimeClock.h"
|
"${APP_DIR}/runtime/RuntimeClock.h"
|
||||||
"${APP_DIR}/runtime/RuntimeJson.cpp"
|
"${APP_DIR}/runtime/RuntimeJson.cpp"
|
||||||
"${APP_DIR}/runtime/RuntimeJson.h"
|
"${APP_DIR}/runtime/RuntimeJson.h"
|
||||||
"${APP_DIR}/runtime/RuntimeParameterUtils.cpp"
|
"${APP_DIR}/runtime/RuntimeParameterUtils.cpp"
|
||||||
"${APP_DIR}/runtime/RuntimeParameterUtils.h"
|
"${APP_DIR}/runtime/RuntimeParameterUtils.h"
|
||||||
|
"${APP_DIR}/runtime/RuntimeStore.cpp"
|
||||||
|
"${APP_DIR}/runtime/RuntimeStore.h"
|
||||||
"${APP_DIR}/shader/ShaderCompiler.cpp"
|
"${APP_DIR}/shader/ShaderCompiler.cpp"
|
||||||
"${APP_DIR}/shader/ShaderCompiler.h"
|
"${APP_DIR}/shader/ShaderCompiler.h"
|
||||||
"${APP_DIR}/shader/ShaderPackageRegistry.cpp"
|
"${APP_DIR}/shader/ShaderPackageRegistry.cpp"
|
||||||
|
|||||||
@@ -104,6 +104,8 @@ OpenGLComposite::OpenGLComposite(HWND hWnd, HDC hDC, HGLRC hRC) :
|
|||||||
{
|
{
|
||||||
InitializeCriticalSection(&pMutex);
|
InitializeCriticalSection(&pMutex);
|
||||||
mRuntimeHost = std::make_unique<RuntimeHost>();
|
mRuntimeHost = std::make_unique<RuntimeHost>();
|
||||||
|
mRuntimeStore = std::make_unique<RuntimeStore>(*mRuntimeHost);
|
||||||
|
mRuntimeSnapshotProvider = std::make_unique<RuntimeSnapshotProvider>(*mRuntimeHost);
|
||||||
mRenderPipeline = std::make_unique<OpenGLRenderPipeline>(
|
mRenderPipeline = std::make_unique<OpenGLRenderPipeline>(
|
||||||
*mRenderer,
|
*mRenderer,
|
||||||
*mRuntimeHost,
|
*mRuntimeHost,
|
||||||
@@ -119,8 +121,8 @@ OpenGLComposite::OpenGLComposite(HWND hWnd, HDC hDC, HGLRC hRC) :
|
|||||||
hGLDC,
|
hGLDC,
|
||||||
hGLRC);
|
hGLRC);
|
||||||
mRenderPass = std::make_unique<OpenGLRenderPass>(*mRenderer);
|
mRenderPass = std::make_unique<OpenGLRenderPass>(*mRenderer);
|
||||||
mShaderPrograms = std::make_unique<OpenGLShaderPrograms>(*mRenderer, *mRuntimeHost);
|
mShaderPrograms = std::make_unique<OpenGLShaderPrograms>(*mRenderer, *mRuntimeHost, *mRuntimeSnapshotProvider);
|
||||||
mShaderBuildQueue = std::make_unique<ShaderBuildQueue>(*mRuntimeHost);
|
mShaderBuildQueue = std::make_unique<ShaderBuildQueue>(*mRuntimeSnapshotProvider);
|
||||||
mRuntimeServices = std::make_unique<RuntimeServices>();
|
mRuntimeServices = std::make_unique<RuntimeServices>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,23 +148,23 @@ bool OpenGLComposite::InitVideoIO()
|
|||||||
VideoFormatSelection videoModes;
|
VideoFormatSelection videoModes;
|
||||||
std::string initFailureReason;
|
std::string initFailureReason;
|
||||||
|
|
||||||
if (mRuntimeHost && mRuntimeHost->GetRepoRoot().empty())
|
if (mRuntimeStore && mRuntimeStore->GetRepoRoot().empty())
|
||||||
{
|
{
|
||||||
std::string runtimeError;
|
std::string runtimeError;
|
||||||
if (!mRuntimeHost->Initialize(runtimeError))
|
if (!mRuntimeStore->Initialize(runtimeError))
|
||||||
{
|
{
|
||||||
MessageBoxA(NULL, runtimeError.c_str(), "Runtime host failed to initialize", MB_OK);
|
MessageBoxA(NULL, runtimeError.c_str(), "Runtime host failed to initialize", MB_OK);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mRuntimeHost)
|
if (mRuntimeStore)
|
||||||
{
|
{
|
||||||
if (!ResolveConfiguredVideoFormats(
|
if (!ResolveConfiguredVideoFormats(
|
||||||
mRuntimeHost->GetInputVideoFormat(),
|
mRuntimeStore->GetInputVideoFormat(),
|
||||||
mRuntimeHost->GetInputFrameRate(),
|
mRuntimeStore->GetInputFrameRate(),
|
||||||
mRuntimeHost->GetOutputVideoFormat(),
|
mRuntimeStore->GetOutputVideoFormat(),
|
||||||
mRuntimeHost->GetOutputFrameRate(),
|
mRuntimeStore->GetOutputFrameRate(),
|
||||||
videoModes,
|
videoModes,
|
||||||
initFailureReason))
|
initFailureReason))
|
||||||
{
|
{
|
||||||
@@ -179,7 +181,7 @@ bool OpenGLComposite::InitVideoIO()
|
|||||||
MessageBoxA(NULL, initFailureReason.c_str(), title, MB_OK | MB_ICONERROR);
|
MessageBoxA(NULL, initFailureReason.c_str(), title, MB_OK | MB_ICONERROR);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const bool outputAlphaRequired = mRuntimeHost && mRuntimeHost->ExternalKeyingEnabled();
|
const bool outputAlphaRequired = mRuntimeStore && mRuntimeStore->ExternalKeyingEnabled();
|
||||||
if (!mVideoIO->SelectPreferredFormats(videoModes, outputAlphaRequired, initFailureReason))
|
if (!mVideoIO->SelectPreferredFormats(videoModes, outputAlphaRequired, initFailureReason))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@@ -214,7 +216,7 @@ bool OpenGLComposite::InitVideoIO()
|
|||||||
mRuntimeHost->SetSignalStatus(false, mVideoIO->InputFrameWidth(), mVideoIO->InputFrameHeight(), mVideoIO->InputDisplayModeName());
|
mRuntimeHost->SetSignalStatus(false, mVideoIO->InputFrameWidth(), mVideoIO->InputFrameHeight(), mVideoIO->InputDisplayModeName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mVideoIO->ConfigureOutput([this](const VideoIOCompletion& completion) { mVideoIOBridge->PlayoutFrameCompleted(completion); }, videoModes.output, mRuntimeHost && mRuntimeHost->ExternalKeyingEnabled(), initFailureReason))
|
if (!mVideoIO->ConfigureOutput([this](const VideoIOCompletion& completion) { mVideoIOBridge->PlayoutFrameCompleted(completion); }, videoModes.output, mRuntimeStore && mRuntimeStore->ExternalKeyingEnabled(), initFailureReason))
|
||||||
{
|
{
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@@ -237,7 +239,7 @@ void OpenGLComposite::paintGL(bool force)
|
|||||||
if (IsIconic(hGLWnd))
|
if (IsIconic(hGLWnd))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const unsigned previewFps = mRuntimeHost ? mRuntimeHost->GetPreviewFps() : 30u;
|
const unsigned previewFps = mRuntimeStore ? mRuntimeStore->GetPreviewFps() : 30u;
|
||||||
if (previewFps == 0)
|
if (previewFps == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -292,7 +294,7 @@ void OpenGLComposite::PublishVideoIOStatus(const std::string& statusMessage)
|
|||||||
mVideoIO->SupportsInternalKeying(),
|
mVideoIO->SupportsInternalKeying(),
|
||||||
mVideoIO->SupportsExternalKeying(),
|
mVideoIO->SupportsExternalKeying(),
|
||||||
mVideoIO->KeyerInterfaceAvailable(),
|
mVideoIO->KeyerInterfaceAvailable(),
|
||||||
mRuntimeHost->ExternalKeyingEnabled(),
|
mRuntimeStore ? mRuntimeStore->ExternalKeyingEnabled() : false,
|
||||||
mVideoIO->ExternalKeyingActive(),
|
mVideoIO->ExternalKeyingActive(),
|
||||||
mVideoIO->StatusMessage());
|
mVideoIO->StatusMessage());
|
||||||
}
|
}
|
||||||
@@ -303,7 +305,7 @@ bool OpenGLComposite::InitOpenGLState()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::string runtimeError;
|
std::string runtimeError;
|
||||||
if (mRuntimeHost->GetRepoRoot().empty() && !mRuntimeHost->Initialize(runtimeError))
|
if (mRuntimeStore->GetRepoRoot().empty() && !mRuntimeStore->Initialize(runtimeError))
|
||||||
{
|
{
|
||||||
MessageBoxA(NULL, runtimeError.c_str(), "Runtime host failed to initialize", MB_OK);
|
MessageBoxA(NULL, runtimeError.c_str(), "Runtime host failed to initialize", MB_OK);
|
||||||
return false;
|
return false;
|
||||||
@@ -381,8 +383,8 @@ bool OpenGLComposite::ReloadShader(bool preserveFeedbackState)
|
|||||||
mPreserveFeedbackOnNextShaderBuild = preserveFeedbackState;
|
mPreserveFeedbackOnNextShaderBuild = preserveFeedbackState;
|
||||||
if (mRuntimeHost)
|
if (mRuntimeHost)
|
||||||
{
|
{
|
||||||
mRuntimeHost->SetCompileStatus(true, "Shader rebuild queued.");
|
mRuntimeStore->SetCompileStatus(true, "Shader rebuild queued.");
|
||||||
mRuntimeHost->ClearReloadRequest();
|
mRuntimeStore->ClearReloadRequest();
|
||||||
}
|
}
|
||||||
RequestShaderBuild();
|
RequestShaderBuild();
|
||||||
broadcastRuntimeState();
|
broadcastRuntimeState();
|
||||||
@@ -456,7 +458,7 @@ void OpenGLComposite::renderEffect()
|
|||||||
if (states.empty() || mOscOverlayStates.empty() || !mRuntimeHost)
|
if (states.empty() || mOscOverlayStates.empty() || !mRuntimeHost)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const double smoothing = ClampOscAlpha(mRuntimeHost->GetOscSmoothing());
|
const double smoothing = ClampOscAlpha(mRuntimeStore ? mRuntimeStore->GetOscSmoothing() : 0.0);
|
||||||
std::vector<std::string> overlayKeysToRemove;
|
std::vector<std::string> overlayKeysToRemove;
|
||||||
for (auto& item : mOscOverlayStates)
|
for (auto& item : mOscOverlayStates)
|
||||||
{
|
{
|
||||||
@@ -591,15 +593,15 @@ void OpenGLComposite::renderEffect()
|
|||||||
{
|
{
|
||||||
layerStates = mShaderPrograms->CommittedLayerStates();
|
layerStates = mShaderPrograms->CommittedLayerStates();
|
||||||
applyOscOverlays(layerStates, false);
|
applyOscOverlays(layerStates, false);
|
||||||
if (mRuntimeHost)
|
if (mRuntimeSnapshotProvider)
|
||||||
mRuntimeHost->RefreshDynamicRenderStateFields(layerStates);
|
mRuntimeSnapshotProvider->RefreshDynamicRenderStateFields(layerStates);
|
||||||
}
|
}
|
||||||
else if (mRuntimeHost)
|
else if (mRuntimeSnapshotProvider)
|
||||||
{
|
{
|
||||||
const unsigned renderWidth = mVideoIO->InputFrameWidth();
|
const unsigned renderWidth = mVideoIO->InputFrameWidth();
|
||||||
const unsigned renderHeight = mVideoIO->InputFrameHeight();
|
const unsigned renderHeight = mVideoIO->InputFrameHeight();
|
||||||
const uint64_t renderStateVersion = mRuntimeHost->GetRenderStateVersion();
|
const uint64_t renderStateVersion = mRuntimeSnapshotProvider->GetRenderStateVersion();
|
||||||
const uint64_t parameterStateVersion = mRuntimeHost->GetParameterStateVersion();
|
const uint64_t parameterStateVersion = mRuntimeSnapshotProvider->GetParameterStateVersion();
|
||||||
const bool renderStateCacheValid =
|
const bool renderStateCacheValid =
|
||||||
!mCachedLayerRenderStates.empty() &&
|
!mCachedLayerRenderStates.empty() &&
|
||||||
mCachedRenderStateVersion == renderStateVersion &&
|
mCachedRenderStateVersion == renderStateVersion &&
|
||||||
@@ -610,17 +612,17 @@ void OpenGLComposite::renderEffect()
|
|||||||
{
|
{
|
||||||
applyOscOverlays(mCachedLayerRenderStates, true);
|
applyOscOverlays(mCachedLayerRenderStates, true);
|
||||||
if (mCachedParameterStateVersion != parameterStateVersion &&
|
if (mCachedParameterStateVersion != parameterStateVersion &&
|
||||||
mRuntimeHost->TryRefreshCachedLayerStates(mCachedLayerRenderStates))
|
mRuntimeSnapshotProvider->TryRefreshCachedLayerStates(mCachedLayerRenderStates))
|
||||||
{
|
{
|
||||||
mCachedParameterStateVersion = parameterStateVersion;
|
mCachedParameterStateVersion = parameterStateVersion;
|
||||||
applyOscOverlays(mCachedLayerRenderStates, true);
|
applyOscOverlays(mCachedLayerRenderStates, true);
|
||||||
}
|
}
|
||||||
layerStates = mCachedLayerRenderStates;
|
layerStates = mCachedLayerRenderStates;
|
||||||
mRuntimeHost->RefreshDynamicRenderStateFields(layerStates);
|
mRuntimeSnapshotProvider->RefreshDynamicRenderStateFields(layerStates);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (mRuntimeHost->TryGetLayerRenderStates(renderWidth, renderHeight, layerStates))
|
if (mRuntimeSnapshotProvider->TryGetLayerRenderStates(renderWidth, renderHeight, layerStates))
|
||||||
{
|
{
|
||||||
mCachedLayerRenderStates = layerStates;
|
mCachedLayerRenderStates = layerStates;
|
||||||
mCachedRenderStateVersion = renderStateVersion;
|
mCachedRenderStateVersion = renderStateVersion;
|
||||||
@@ -634,11 +636,11 @@ void OpenGLComposite::renderEffect()
|
|||||||
{
|
{
|
||||||
applyOscOverlays(mCachedLayerRenderStates, true);
|
applyOscOverlays(mCachedLayerRenderStates, true);
|
||||||
layerStates = mCachedLayerRenderStates;
|
layerStates = mCachedLayerRenderStates;
|
||||||
mRuntimeHost->RefreshDynamicRenderStateFields(layerStates);
|
mRuntimeSnapshotProvider->RefreshDynamicRenderStateFields(layerStates);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const unsigned historyCap = mRuntimeHost ? mRuntimeHost->GetMaxTemporalHistoryFrames() : 0;
|
const unsigned historyCap = mRuntimeStore ? mRuntimeStore->GetMaxTemporalHistoryFrames() : 0;
|
||||||
mRenderPass->Render(
|
mRenderPass->Render(
|
||||||
hasInputSource,
|
hasInputSource,
|
||||||
layerStates,
|
layerStates,
|
||||||
@@ -699,8 +701,8 @@ void OpenGLComposite::ProcessScreenshotRequest()
|
|||||||
|
|
||||||
std::filesystem::path OpenGLComposite::BuildScreenshotPath() const
|
std::filesystem::path OpenGLComposite::BuildScreenshotPath() const
|
||||||
{
|
{
|
||||||
const std::filesystem::path root = mRuntimeHost && !mRuntimeHost->GetRuntimeRoot().empty()
|
const std::filesystem::path root = mRuntimeStore && !mRuntimeStore->GetRuntimeRoot().empty()
|
||||||
? mRuntimeHost->GetRuntimeRoot()
|
? mRuntimeStore->GetRuntimeRoot()
|
||||||
: std::filesystem::current_path();
|
: std::filesystem::current_path();
|
||||||
|
|
||||||
const auto now = std::chrono::system_clock::now();
|
const auto now = std::chrono::system_clock::now();
|
||||||
@@ -726,7 +728,7 @@ bool OpenGLComposite::ProcessRuntimePollResults()
|
|||||||
const RuntimePollEvents events = mRuntimeServices->ConsumePollEvents();
|
const RuntimePollEvents events = mRuntimeServices->ConsumePollEvents();
|
||||||
if (events.failed)
|
if (events.failed)
|
||||||
{
|
{
|
||||||
mRuntimeHost->SetCompileStatus(false, events.error);
|
mRuntimeStore->SetCompileStatus(false, events.error);
|
||||||
broadcastRuntimeState();
|
broadcastRuntimeState();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -743,7 +745,7 @@ bool OpenGLComposite::ProcessRuntimePollResults()
|
|||||||
char compilerErrorMessage[1024] = {};
|
char compilerErrorMessage[1024] = {};
|
||||||
if (!mShaderPrograms->CommitPreparedLayerPrograms(readyBuild, mVideoIO->InputFrameWidth(), mVideoIO->InputFrameHeight(), sizeof(compilerErrorMessage), compilerErrorMessage))
|
if (!mShaderPrograms->CommitPreparedLayerPrograms(readyBuild, mVideoIO->InputFrameWidth(), mVideoIO->InputFrameHeight(), sizeof(compilerErrorMessage), compilerErrorMessage))
|
||||||
{
|
{
|
||||||
mRuntimeHost->SetCompileStatus(false, compilerErrorMessage);
|
mRuntimeStore->SetCompileStatus(false, compilerErrorMessage);
|
||||||
mUseCommittedLayerStates = true;
|
mUseCommittedLayerStates = true;
|
||||||
mPreserveFeedbackOnNextShaderBuild = false;
|
mPreserveFeedbackOnNextShaderBuild = false;
|
||||||
broadcastRuntimeState();
|
broadcastRuntimeState();
|
||||||
@@ -760,7 +762,7 @@ bool OpenGLComposite::ProcessRuntimePollResults()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
mRuntimeHost->SetCompileStatus(true, "Shader rebuild queued.");
|
mRuntimeStore->SetCompileStatus(true, "Shader rebuild queued.");
|
||||||
mPreserveFeedbackOnNextShaderBuild = false;
|
mPreserveFeedbackOnNextShaderBuild = false;
|
||||||
RequestShaderBuild();
|
RequestShaderBuild();
|
||||||
broadcastRuntimeState();
|
broadcastRuntimeState();
|
||||||
@@ -774,7 +776,7 @@ void OpenGLComposite::RequestShaderBuild()
|
|||||||
|
|
||||||
mUseCommittedLayerStates = true;
|
mUseCommittedLayerStates = true;
|
||||||
if (mRuntimeHost)
|
if (mRuntimeHost)
|
||||||
mRuntimeHost->ClearReloadRequest();
|
mRuntimeStore->ClearReloadRequest();
|
||||||
mShaderBuildQueue->RequestBuild(mVideoIO->InputFrameWidth(), mVideoIO->InputFrameHeight());
|
mShaderBuildQueue->RequestBuild(mVideoIO->InputFrameWidth(), mVideoIO->InputFrameHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
#include "GLExtensions.h"
|
#include "GLExtensions.h"
|
||||||
#include "OpenGLRenderer.h"
|
#include "OpenGLRenderer.h"
|
||||||
#include "RuntimeHost.h"
|
#include "RuntimeHost.h"
|
||||||
|
#include "RuntimeSnapshotProvider.h"
|
||||||
|
#include "RuntimeStore.h"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
@@ -95,6 +97,8 @@ private:
|
|||||||
std::unique_ptr<VideoIODevice> mVideoIO;
|
std::unique_ptr<VideoIODevice> mVideoIO;
|
||||||
std::unique_ptr<OpenGLRenderer> mRenderer;
|
std::unique_ptr<OpenGLRenderer> mRenderer;
|
||||||
std::unique_ptr<RuntimeHost> mRuntimeHost;
|
std::unique_ptr<RuntimeHost> mRuntimeHost;
|
||||||
|
std::unique_ptr<RuntimeStore> mRuntimeStore;
|
||||||
|
std::unique_ptr<RuntimeSnapshotProvider> mRuntimeSnapshotProvider;
|
||||||
std::unique_ptr<OpenGLVideoIOBridge> mVideoIOBridge;
|
std::unique_ptr<OpenGLVideoIOBridge> mVideoIOBridge;
|
||||||
std::unique_ptr<OpenGLRenderPass> mRenderPass;
|
std::unique_ptr<OpenGLRenderPass> mRenderPass;
|
||||||
std::unique_ptr<OpenGLRenderPipeline> mRenderPipeline;
|
std::unique_ptr<OpenGLRenderPipeline> mRenderPipeline;
|
||||||
|
|||||||
@@ -3,22 +3,22 @@
|
|||||||
|
|
||||||
std::string OpenGLComposite::GetRuntimeStateJson() const
|
std::string OpenGLComposite::GetRuntimeStateJson() const
|
||||||
{
|
{
|
||||||
return mRuntimeHost ? mRuntimeHost->BuildStateJson() : "{}";
|
return mRuntimeStore ? mRuntimeStore->BuildStateJson() : "{}";
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short OpenGLComposite::GetControlServerPort() const
|
unsigned short OpenGLComposite::GetControlServerPort() const
|
||||||
{
|
{
|
||||||
return mRuntimeHost ? mRuntimeHost->GetServerPort() : 0;
|
return mRuntimeStore ? mRuntimeStore->GetServerPort() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned short OpenGLComposite::GetOscPort() const
|
unsigned short OpenGLComposite::GetOscPort() const
|
||||||
{
|
{
|
||||||
return mRuntimeHost ? mRuntimeHost->GetOscPort() : 0;
|
return mRuntimeStore ? mRuntimeStore->GetOscPort() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OpenGLComposite::GetOscBindAddress() const
|
std::string OpenGLComposite::GetOscBindAddress() const
|
||||||
{
|
{
|
||||||
return mRuntimeHost ? mRuntimeHost->GetOscBindAddress() : "127.0.0.1";
|
return mRuntimeStore ? mRuntimeStore->GetOscBindAddress() : "127.0.0.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string OpenGLComposite::GetControlUrl() const
|
std::string OpenGLComposite::GetControlUrl() const
|
||||||
@@ -38,7 +38,7 @@ std::string OpenGLComposite::GetOscAddress() const
|
|||||||
|
|
||||||
bool OpenGLComposite::AddLayer(const std::string& shaderId, std::string& error)
|
bool OpenGLComposite::AddLayer(const std::string& shaderId, std::string& error)
|
||||||
{
|
{
|
||||||
if (!mRuntimeHost->AddLayer(shaderId, error))
|
if (!mRuntimeStore->AddLayer(shaderId, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ReloadShader(true);
|
ReloadShader(true);
|
||||||
@@ -48,7 +48,7 @@ bool OpenGLComposite::AddLayer(const std::string& shaderId, std::string& error)
|
|||||||
|
|
||||||
bool OpenGLComposite::RemoveLayer(const std::string& layerId, std::string& error)
|
bool OpenGLComposite::RemoveLayer(const std::string& layerId, std::string& error)
|
||||||
{
|
{
|
||||||
if (!mRuntimeHost->RemoveLayer(layerId, error))
|
if (!mRuntimeStore->RemoveLayer(layerId, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ReloadShader(true);
|
ReloadShader(true);
|
||||||
@@ -58,7 +58,7 @@ bool OpenGLComposite::RemoveLayer(const std::string& layerId, std::string& error
|
|||||||
|
|
||||||
bool OpenGLComposite::MoveLayer(const std::string& layerId, int direction, std::string& error)
|
bool OpenGLComposite::MoveLayer(const std::string& layerId, int direction, std::string& error)
|
||||||
{
|
{
|
||||||
if (!mRuntimeHost->MoveLayer(layerId, direction, error))
|
if (!mRuntimeStore->MoveLayer(layerId, direction, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ReloadShader(true);
|
ReloadShader(true);
|
||||||
@@ -68,7 +68,7 @@ bool OpenGLComposite::MoveLayer(const std::string& layerId, int direction, std::
|
|||||||
|
|
||||||
bool OpenGLComposite::MoveLayerToIndex(const std::string& layerId, std::size_t targetIndex, std::string& error)
|
bool OpenGLComposite::MoveLayerToIndex(const std::string& layerId, std::size_t targetIndex, std::string& error)
|
||||||
{
|
{
|
||||||
if (!mRuntimeHost->MoveLayerToIndex(layerId, targetIndex, error))
|
if (!mRuntimeStore->MoveLayerToIndex(layerId, targetIndex, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ReloadShader(true);
|
ReloadShader(true);
|
||||||
@@ -78,7 +78,7 @@ bool OpenGLComposite::MoveLayerToIndex(const std::string& layerId, std::size_t t
|
|||||||
|
|
||||||
bool OpenGLComposite::SetLayerBypass(const std::string& layerId, bool bypassed, std::string& error)
|
bool OpenGLComposite::SetLayerBypass(const std::string& layerId, bool bypassed, std::string& error)
|
||||||
{
|
{
|
||||||
if (!mRuntimeHost->SetLayerBypass(layerId, bypassed, error))
|
if (!mRuntimeStore->SetLayerBypass(layerId, bypassed, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ReloadShader();
|
ReloadShader();
|
||||||
@@ -88,7 +88,7 @@ bool OpenGLComposite::SetLayerBypass(const std::string& layerId, bool bypassed,
|
|||||||
|
|
||||||
bool OpenGLComposite::SetLayerShader(const std::string& layerId, const std::string& shaderId, std::string& error)
|
bool OpenGLComposite::SetLayerShader(const std::string& layerId, const std::string& shaderId, std::string& error)
|
||||||
{
|
{
|
||||||
if (!mRuntimeHost->SetLayerShader(layerId, shaderId, error))
|
if (!mRuntimeStore->SetLayerShader(layerId, shaderId, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ReloadShader();
|
ReloadShader();
|
||||||
@@ -102,7 +102,7 @@ bool OpenGLComposite::UpdateLayerParameterJson(const std::string& layerId, const
|
|||||||
if (!ParseJson(valueJson, parsedValue, error))
|
if (!ParseJson(valueJson, parsedValue, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!mRuntimeHost->UpdateLayerParameter(layerId, parameterId, parsedValue, error))
|
if (!mRuntimeStore->UpdateLayerParameter(layerId, parameterId, parsedValue, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
broadcastRuntimeState();
|
broadcastRuntimeState();
|
||||||
@@ -115,7 +115,7 @@ bool OpenGLComposite::UpdateLayerParameterByControlKeyJson(const std::string& la
|
|||||||
if (!ParseJson(valueJson, parsedValue, error))
|
if (!ParseJson(valueJson, parsedValue, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!mRuntimeHost->UpdateLayerParameterByControlKey(layerKey, parameterKey, parsedValue, error))
|
if (!mRuntimeStore->UpdateLayerParameterByControlKey(layerKey, parameterKey, parsedValue, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
broadcastRuntimeState();
|
broadcastRuntimeState();
|
||||||
@@ -124,7 +124,7 @@ bool OpenGLComposite::UpdateLayerParameterByControlKeyJson(const std::string& la
|
|||||||
|
|
||||||
bool OpenGLComposite::ResetLayerParameters(const std::string& layerId, std::string& error)
|
bool OpenGLComposite::ResetLayerParameters(const std::string& layerId, std::string& error)
|
||||||
{
|
{
|
||||||
if (!mRuntimeHost->ResetLayerParameters(layerId, error))
|
if (!mRuntimeStore->ResetLayerParameters(layerId, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
mOscOverlayStates.clear();
|
mOscOverlayStates.clear();
|
||||||
@@ -138,7 +138,7 @@ bool OpenGLComposite::ResetLayerParameters(const std::string& layerId, std::stri
|
|||||||
|
|
||||||
bool OpenGLComposite::SaveStackPreset(const std::string& presetName, std::string& error)
|
bool OpenGLComposite::SaveStackPreset(const std::string& presetName, std::string& error)
|
||||||
{
|
{
|
||||||
if (!mRuntimeHost->SaveStackPreset(presetName, error))
|
if (!mRuntimeStore->SaveStackPreset(presetName, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
broadcastRuntimeState();
|
broadcastRuntimeState();
|
||||||
@@ -147,7 +147,7 @@ bool OpenGLComposite::SaveStackPreset(const std::string& presetName, std::string
|
|||||||
|
|
||||||
bool OpenGLComposite::LoadStackPreset(const std::string& presetName, std::string& error)
|
bool OpenGLComposite::LoadStackPreset(const std::string& presetName, std::string& error)
|
||||||
{
|
{
|
||||||
if (!mRuntimeHost->LoadStackPreset(presetName, error))
|
if (!mRuntimeStore->LoadStackPreset(presetName, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ReloadShader();
|
ReloadShader();
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ std::size_t RequiredTemporaryRenderTargets(const std::vector<OpenGLRenderer::Lay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenGLShaderPrograms::OpenGLShaderPrograms(OpenGLRenderer& renderer, RuntimeHost& runtimeHost) :
|
OpenGLShaderPrograms::OpenGLShaderPrograms(OpenGLRenderer& renderer, RuntimeHost& runtimeHost, RuntimeSnapshotProvider& runtimeSnapshotProvider) :
|
||||||
mRenderer(renderer),
|
mRenderer(renderer),
|
||||||
mRuntimeHost(runtimeHost),
|
mRuntimeHost(runtimeHost),
|
||||||
|
mRuntimeSnapshotProvider(runtimeSnapshotProvider),
|
||||||
mGlobalParamsBuffer(renderer),
|
mGlobalParamsBuffer(renderer),
|
||||||
mCompiler(renderer, runtimeHost, mTextureBindings)
|
mCompiler(renderer, runtimeHost, mTextureBindings)
|
||||||
{
|
{
|
||||||
@@ -39,7 +40,7 @@ OpenGLShaderPrograms::OpenGLShaderPrograms(OpenGLRenderer& renderer, RuntimeHost
|
|||||||
|
|
||||||
bool OpenGLShaderPrograms::CompileLayerPrograms(unsigned inputFrameWidth, unsigned inputFrameHeight, int errorMessageSize, char* errorMessage)
|
bool OpenGLShaderPrograms::CompileLayerPrograms(unsigned inputFrameWidth, unsigned inputFrameHeight, int errorMessageSize, char* errorMessage)
|
||||||
{
|
{
|
||||||
const std::vector<RuntimeRenderState> layerStates = mRuntimeHost.GetLayerRenderStates(inputFrameWidth, inputFrameHeight);
|
const std::vector<RuntimeRenderState> layerStates = mRuntimeSnapshotProvider.GetLayerRenderStates(inputFrameWidth, inputFrameHeight);
|
||||||
std::string temporalError;
|
std::string temporalError;
|
||||||
const unsigned historyCap = mRuntimeHost.GetMaxTemporalHistoryFrames();
|
const unsigned historyCap = mRuntimeHost.GetMaxTemporalHistoryFrames();
|
||||||
if (!mRenderer.TemporalHistory().ValidateTextureUnitBudget(layerStates, historyCap, temporalError))
|
if (!mRenderer.TemporalHistory().ValidateTextureUnitBudget(layerStates, historyCap, temporalError))
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "GlobalParamsBuffer.h"
|
#include "GlobalParamsBuffer.h"
|
||||||
#include "OpenGLRenderer.h"
|
#include "OpenGLRenderer.h"
|
||||||
#include "RuntimeHost.h"
|
#include "RuntimeHost.h"
|
||||||
|
#include "RuntimeSnapshotProvider.h"
|
||||||
#include "ShaderBuildQueue.h"
|
#include "ShaderBuildQueue.h"
|
||||||
#include "ShaderTypes.h"
|
#include "ShaderTypes.h"
|
||||||
#include "ShaderProgramCompiler.h"
|
#include "ShaderProgramCompiler.h"
|
||||||
@@ -15,7 +16,7 @@ class OpenGLShaderPrograms
|
|||||||
public:
|
public:
|
||||||
using LayerProgram = OpenGLRenderer::LayerProgram;
|
using LayerProgram = OpenGLRenderer::LayerProgram;
|
||||||
|
|
||||||
OpenGLShaderPrograms(OpenGLRenderer& renderer, RuntimeHost& runtimeHost);
|
OpenGLShaderPrograms(OpenGLRenderer& renderer, RuntimeHost& runtimeHost, RuntimeSnapshotProvider& runtimeSnapshotProvider);
|
||||||
|
|
||||||
bool CompileLayerPrograms(unsigned inputFrameWidth, unsigned inputFrameHeight, int errorMessageSize, char* errorMessage);
|
bool CompileLayerPrograms(unsigned inputFrameWidth, unsigned inputFrameHeight, int errorMessageSize, char* errorMessage);
|
||||||
bool CommitPreparedLayerPrograms(const PreparedShaderBuild& preparedBuild, unsigned inputFrameWidth, unsigned inputFrameHeight, int errorMessageSize, char* errorMessage);
|
bool CommitPreparedLayerPrograms(const PreparedShaderBuild& preparedBuild, unsigned inputFrameWidth, unsigned inputFrameHeight, int errorMessageSize, char* errorMessage);
|
||||||
@@ -33,6 +34,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
OpenGLRenderer& mRenderer;
|
OpenGLRenderer& mRenderer;
|
||||||
RuntimeHost& mRuntimeHost;
|
RuntimeHost& mRuntimeHost;
|
||||||
|
RuntimeSnapshotProvider& mRuntimeSnapshotProvider;
|
||||||
ShaderTextureBindings mTextureBindings;
|
ShaderTextureBindings mTextureBindings;
|
||||||
GlobalParamsBuffer mGlobalParamsBuffer;
|
GlobalParamsBuffer mGlobalParamsBuffer;
|
||||||
ShaderProgramCompiler mCompiler;
|
ShaderProgramCompiler mCompiler;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#include "ShaderBuildQueue.h"
|
#include "ShaderBuildQueue.h"
|
||||||
|
|
||||||
#include "RuntimeHost.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@@ -10,8 +8,8 @@ namespace
|
|||||||
constexpr auto kShaderBuildDebounce = std::chrono::milliseconds(400);
|
constexpr auto kShaderBuildDebounce = std::chrono::milliseconds(400);
|
||||||
}
|
}
|
||||||
|
|
||||||
ShaderBuildQueue::ShaderBuildQueue(RuntimeHost& runtimeHost) :
|
ShaderBuildQueue::ShaderBuildQueue(RuntimeSnapshotProvider& runtimeSnapshotProvider) :
|
||||||
mRuntimeHost(runtimeHost),
|
mRuntimeSnapshotProvider(runtimeSnapshotProvider),
|
||||||
mWorkerThread([this]() { WorkerLoop(); })
|
mWorkerThread([this]() { WorkerLoop(); })
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -113,14 +111,14 @@ PreparedShaderBuild ShaderBuildQueue::Build(uint64_t generation, unsigned output
|
|||||||
{
|
{
|
||||||
PreparedShaderBuild build;
|
PreparedShaderBuild build;
|
||||||
build.generation = generation;
|
build.generation = generation;
|
||||||
build.layerStates = mRuntimeHost.GetLayerRenderStates(outputWidth, outputHeight);
|
build.layerStates = mRuntimeSnapshotProvider.GetLayerRenderStates(outputWidth, outputHeight);
|
||||||
build.layers.reserve(build.layerStates.size());
|
build.layers.reserve(build.layerStates.size());
|
||||||
|
|
||||||
for (const RuntimeRenderState& state : build.layerStates)
|
for (const RuntimeRenderState& state : build.layerStates)
|
||||||
{
|
{
|
||||||
PreparedLayerShader layer;
|
PreparedLayerShader layer;
|
||||||
layer.state = state;
|
layer.state = state;
|
||||||
if (!mRuntimeHost.BuildLayerPassFragmentShaderSources(state.layerId, layer.passes, build.message))
|
if (!mRuntimeSnapshotProvider.BuildLayerPassFragmentShaderSources(state.layerId, layer.passes, build.message))
|
||||||
{
|
{
|
||||||
build.succeeded = false;
|
build.succeeded = false;
|
||||||
return build;
|
return build;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "RuntimeSnapshotProvider.h"
|
||||||
#include "ShaderTypes.h"
|
#include "ShaderTypes.h"
|
||||||
|
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
@@ -9,8 +10,6 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class RuntimeHost;
|
|
||||||
|
|
||||||
struct PreparedLayerShader
|
struct PreparedLayerShader
|
||||||
{
|
{
|
||||||
RuntimeRenderState state;
|
RuntimeRenderState state;
|
||||||
@@ -29,7 +28,7 @@ struct PreparedShaderBuild
|
|||||||
class ShaderBuildQueue
|
class ShaderBuildQueue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ShaderBuildQueue(RuntimeHost& runtimeHost);
|
explicit ShaderBuildQueue(RuntimeSnapshotProvider& runtimeSnapshotProvider);
|
||||||
~ShaderBuildQueue();
|
~ShaderBuildQueue();
|
||||||
|
|
||||||
ShaderBuildQueue(const ShaderBuildQueue&) = delete;
|
ShaderBuildQueue(const ShaderBuildQueue&) = delete;
|
||||||
@@ -43,7 +42,7 @@ private:
|
|||||||
void WorkerLoop();
|
void WorkerLoop();
|
||||||
PreparedShaderBuild Build(uint64_t generation, unsigned outputWidth, unsigned outputHeight);
|
PreparedShaderBuild Build(uint64_t generation, unsigned outputWidth, unsigned outputHeight);
|
||||||
|
|
||||||
RuntimeHost& mRuntimeHost;
|
RuntimeSnapshotProvider& mRuntimeSnapshotProvider;
|
||||||
std::thread mWorkerThread;
|
std::thread mWorkerThread;
|
||||||
std::mutex mMutex;
|
std::mutex mMutex;
|
||||||
std::condition_variable mCondition;
|
std::condition_variable mCondition;
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
#include "RuntimeSnapshotProvider.h"
|
||||||
|
|
||||||
|
RuntimeSnapshotProvider::RuntimeSnapshotProvider(RuntimeHost& runtimeHost) :
|
||||||
|
mRuntimeHost(runtimeHost)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeSnapshotProvider::BuildLayerPassFragmentShaderSources(const std::string& layerId, std::vector<ShaderPassBuildSource>& passSources, std::string& error) const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.BuildLayerPassFragmentShaderSources(layerId, passSources, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<RuntimeRenderState> RuntimeSnapshotProvider::GetLayerRenderStates(unsigned outputWidth, unsigned outputHeight) const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetLayerRenderStates(outputWidth, outputHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeSnapshotProvider::TryGetLayerRenderStates(unsigned outputWidth, unsigned outputHeight, std::vector<RuntimeRenderState>& states) const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.TryGetLayerRenderStates(outputWidth, outputHeight, states);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeSnapshotProvider::TryRefreshCachedLayerStates(std::vector<RuntimeRenderState>& states) const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.TryRefreshCachedLayerStates(states);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RuntimeSnapshotProvider::RefreshDynamicRenderStateFields(std::vector<RuntimeRenderState>& states) const
|
||||||
|
{
|
||||||
|
mRuntimeHost.RefreshDynamicRenderStateFields(states);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t RuntimeSnapshotProvider::GetRenderStateVersion() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetRenderStateVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t RuntimeSnapshotProvider::GetParameterStateVersion() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetParameterStateVersion();
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "RuntimeHost.h"
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class RuntimeSnapshotProvider
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit RuntimeSnapshotProvider(RuntimeHost& runtimeHost);
|
||||||
|
|
||||||
|
bool BuildLayerPassFragmentShaderSources(const std::string& layerId, std::vector<ShaderPassBuildSource>& passSources, std::string& error) const;
|
||||||
|
std::vector<RuntimeRenderState> GetLayerRenderStates(unsigned outputWidth, unsigned outputHeight) const;
|
||||||
|
bool TryGetLayerRenderStates(unsigned outputWidth, unsigned outputHeight, std::vector<RuntimeRenderState>& states) const;
|
||||||
|
bool TryRefreshCachedLayerStates(std::vector<RuntimeRenderState>& states) const;
|
||||||
|
void RefreshDynamicRenderStateFields(std::vector<RuntimeRenderState>& states) const;
|
||||||
|
uint64_t GetRenderStateVersion() const;
|
||||||
|
uint64_t GetParameterStateVersion() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
RuntimeHost& mRuntimeHost;
|
||||||
|
};
|
||||||
161
apps/LoopThroughWithOpenGLCompositing/runtime/RuntimeStore.cpp
Normal file
161
apps/LoopThroughWithOpenGLCompositing/runtime/RuntimeStore.cpp
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
#include "RuntimeStore.h"
|
||||||
|
|
||||||
|
RuntimeStore::RuntimeStore(RuntimeHost& runtimeHost) :
|
||||||
|
mRuntimeHost(runtimeHost)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::Initialize(std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.Initialize(error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::AddLayer(const std::string& shaderId, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.AddLayer(shaderId, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::RemoveLayer(const std::string& layerId, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.RemoveLayer(layerId, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::MoveLayer(const std::string& layerId, int direction, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.MoveLayer(layerId, direction, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::MoveLayerToIndex(const std::string& layerId, std::size_t targetIndex, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.MoveLayerToIndex(layerId, targetIndex, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::SetLayerBypass(const std::string& layerId, bool bypassed, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.SetLayerBypass(layerId, bypassed, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::SetLayerShader(const std::string& layerId, const std::string& shaderId, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.SetLayerShader(layerId, shaderId, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::UpdateLayerParameter(const std::string& layerId, const std::string& parameterId, const JsonValue& newValue, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.UpdateLayerParameter(layerId, parameterId, newValue, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::UpdateLayerParameterByControlKey(const std::string& layerKey, const std::string& parameterKey, const JsonValue& newValue, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.UpdateLayerParameterByControlKey(layerKey, parameterKey, newValue, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::UpdateLayerParameterByControlKey(const std::string& layerKey, const std::string& parameterKey, const JsonValue& newValue, bool persistState, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.UpdateLayerParameterByControlKey(layerKey, parameterKey, newValue, persistState, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::ResetLayerParameters(const std::string& layerId, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.ResetLayerParameters(layerId, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::SaveStackPreset(const std::string& presetName, std::string& error) const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.SaveStackPreset(presetName, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::LoadStackPreset(const std::string& presetName, std::string& error)
|
||||||
|
{
|
||||||
|
return mRuntimeHost.LoadStackPreset(presetName, error);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string RuntimeStore::BuildStateJson() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.BuildStateJson();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::filesystem::path& RuntimeStore::GetRepoRoot() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetRepoRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::filesystem::path& RuntimeStore::GetUiRoot() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetUiRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::filesystem::path& RuntimeStore::GetDocsRoot() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetDocsRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::filesystem::path& RuntimeStore::GetRuntimeRoot() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetRuntimeRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned short RuntimeStore::GetServerPort() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetServerPort();
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned short RuntimeStore::GetOscPort() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetOscPort();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& RuntimeStore::GetOscBindAddress() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetOscBindAddress();
|
||||||
|
}
|
||||||
|
|
||||||
|
double RuntimeStore::GetOscSmoothing() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetOscSmoothing();
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned RuntimeStore::GetMaxTemporalHistoryFrames() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetMaxTemporalHistoryFrames();
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned RuntimeStore::GetPreviewFps() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetPreviewFps();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RuntimeStore::ExternalKeyingEnabled() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.ExternalKeyingEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& RuntimeStore::GetInputVideoFormat() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetInputVideoFormat();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& RuntimeStore::GetInputFrameRate() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetInputFrameRate();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& RuntimeStore::GetOutputVideoFormat() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetOutputVideoFormat();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& RuntimeStore::GetOutputFrameRate() const
|
||||||
|
{
|
||||||
|
return mRuntimeHost.GetOutputFrameRate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RuntimeStore::SetCompileStatus(bool succeeded, const std::string& message)
|
||||||
|
{
|
||||||
|
mRuntimeHost.SetCompileStatus(succeeded, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RuntimeStore::ClearReloadRequest()
|
||||||
|
{
|
||||||
|
mRuntimeHost.ClearReloadRequest();
|
||||||
|
}
|
||||||
51
apps/LoopThroughWithOpenGLCompositing/runtime/RuntimeStore.h
Normal file
51
apps/LoopThroughWithOpenGLCompositing/runtime/RuntimeStore.h
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "RuntimeHost.h"
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class RuntimeStore
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit RuntimeStore(RuntimeHost& runtimeHost);
|
||||||
|
|
||||||
|
bool Initialize(std::string& error);
|
||||||
|
|
||||||
|
bool AddLayer(const std::string& shaderId, std::string& error);
|
||||||
|
bool RemoveLayer(const std::string& layerId, std::string& error);
|
||||||
|
bool MoveLayer(const std::string& layerId, int direction, std::string& error);
|
||||||
|
bool MoveLayerToIndex(const std::string& layerId, std::size_t targetIndex, std::string& error);
|
||||||
|
bool SetLayerBypass(const std::string& layerId, bool bypassed, std::string& error);
|
||||||
|
bool SetLayerShader(const std::string& layerId, const std::string& shaderId, std::string& error);
|
||||||
|
bool UpdateLayerParameter(const std::string& layerId, const std::string& parameterId, const JsonValue& newValue, std::string& error);
|
||||||
|
bool UpdateLayerParameterByControlKey(const std::string& layerKey, const std::string& parameterKey, const JsonValue& newValue, std::string& error);
|
||||||
|
bool UpdateLayerParameterByControlKey(const std::string& layerKey, const std::string& parameterKey, const JsonValue& newValue, bool persistState, std::string& error);
|
||||||
|
bool ResetLayerParameters(const std::string& layerId, std::string& error);
|
||||||
|
bool SaveStackPreset(const std::string& presetName, std::string& error) const;
|
||||||
|
bool LoadStackPreset(const std::string& presetName, std::string& error);
|
||||||
|
|
||||||
|
std::string BuildStateJson() const;
|
||||||
|
|
||||||
|
const std::filesystem::path& GetRepoRoot() const;
|
||||||
|
const std::filesystem::path& GetUiRoot() const;
|
||||||
|
const std::filesystem::path& GetDocsRoot() const;
|
||||||
|
const std::filesystem::path& GetRuntimeRoot() const;
|
||||||
|
unsigned short GetServerPort() const;
|
||||||
|
unsigned short GetOscPort() const;
|
||||||
|
const std::string& GetOscBindAddress() const;
|
||||||
|
double GetOscSmoothing() const;
|
||||||
|
unsigned GetMaxTemporalHistoryFrames() const;
|
||||||
|
unsigned GetPreviewFps() const;
|
||||||
|
bool ExternalKeyingEnabled() const;
|
||||||
|
const std::string& GetInputVideoFormat() const;
|
||||||
|
const std::string& GetInputFrameRate() const;
|
||||||
|
const std::string& GetOutputVideoFormat() const;
|
||||||
|
const std::string& GetOutputFrameRate() const;
|
||||||
|
|
||||||
|
void SetCompileStatus(bool succeeded, const std::string& message);
|
||||||
|
void ClearReloadRequest();
|
||||||
|
|
||||||
|
private:
|
||||||
|
RuntimeHost& mRuntimeHost;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user