@@ -1228,20 +1228,25 @@ void RuntimeHost::MarkRenderStateDirtyLocked()
|
||||
mRenderStateVersion.fetch_add(1, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
void RuntimeHost::SetVideoIOStatus(const VideoIOState& state)
|
||||
void RuntimeHost::SetDeckLinkOutputStatus(const std::string& modelName, bool supportsInternalKeying, bool supportsExternalKeying,
|
||||
bool keyerInterfaceAvailable, bool externalKeyingRequested, bool externalKeyingActive, const std::string& statusMessage)
|
||||
{
|
||||
SetVideoIOStatus("decklink", modelName, supportsInternalKeying, supportsExternalKeying, keyerInterfaceAvailable,
|
||||
externalKeyingRequested, externalKeyingActive, statusMessage);
|
||||
}
|
||||
|
||||
void RuntimeHost::SetVideoIOStatus(const std::string& backendName, const std::string& modelName, bool supportsInternalKeying, bool supportsExternalKeying,
|
||||
bool keyerInterfaceAvailable, bool externalKeyingRequested, bool externalKeyingActive, const std::string& statusMessage)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
mVideoIOStatus.backendId = state.backendId;
|
||||
mVideoIOStatus.deviceName = state.deviceName;
|
||||
mVideoIOStatus.capabilities = state.capabilities;
|
||||
mVideoIOStatus.hasInputDevice = state.hasInputDevice;
|
||||
mVideoIOStatus.hasInputSource = state.hasInputSource;
|
||||
mVideoIOStatus.inputDisplayModeName = state.inputDisplayModeName;
|
||||
mVideoIOStatus.outputDisplayModeName = state.outputDisplayModeName;
|
||||
mVideoIOStatus.externalKeyingRequested = state.externalKeyingRequested;
|
||||
mVideoIOStatus.externalKeyingActive = state.externalKeyingActive;
|
||||
mVideoIOStatus.statusMessage = state.statusMessage;
|
||||
mVideoIOStatus.formatStatusMessage = state.formatStatusMessage;
|
||||
mDeckLinkOutputStatus.backendName = backendName;
|
||||
mDeckLinkOutputStatus.modelName = modelName;
|
||||
mDeckLinkOutputStatus.supportsInternalKeying = supportsInternalKeying;
|
||||
mDeckLinkOutputStatus.supportsExternalKeying = supportsExternalKeying;
|
||||
mDeckLinkOutputStatus.keyerInterfaceAvailable = keyerInterfaceAvailable;
|
||||
mDeckLinkOutputStatus.externalKeyingRequested = externalKeyingRequested;
|
||||
mDeckLinkOutputStatus.externalKeyingActive = externalKeyingActive;
|
||||
mDeckLinkOutputStatus.statusMessage = statusMessage;
|
||||
}
|
||||
|
||||
void RuntimeHost::SetPerformanceStats(double frameBudgetMilliseconds, double renderMilliseconds)
|
||||
@@ -1476,67 +1481,61 @@ bool RuntimeHost::LoadConfig(std::string& error)
|
||||
const double configuredValue = maxTemporalHistoryFramesValue->asNumber(static_cast<double>(mConfig.maxTemporalHistoryFrames));
|
||||
mConfig.maxTemporalHistoryFrames = configuredValue <= 0.0 ? 0u : static_cast<unsigned>(configuredValue);
|
||||
}
|
||||
if (const JsonValue* videoBackendValue = configJson.find("videoBackend"))
|
||||
{
|
||||
VideoIOBackendId backendId = mConfig.videoIO.backendId;
|
||||
if (videoBackendValue->isString() && ParseVideoIOBackendId(videoBackendValue->asString(), backendId))
|
||||
mConfig.videoIO.backendId = backendId;
|
||||
}
|
||||
if (const JsonValue* enableExternalKeyingValue = configJson.find("enableExternalKeying"))
|
||||
mConfig.videoIO.externalKeyingEnabled = enableExternalKeyingValue->asBoolean(mConfig.videoIO.externalKeyingEnabled);
|
||||
mConfig.enableExternalKeying = enableExternalKeyingValue->asBoolean(mConfig.enableExternalKeying);
|
||||
if (const JsonValue* videoFormatValue = configJson.find("videoFormat"))
|
||||
{
|
||||
if (videoFormatValue->isString() && !videoFormatValue->asString().empty())
|
||||
{
|
||||
mConfig.videoIO.inputMode.videoFormat = videoFormatValue->asString();
|
||||
mConfig.videoIO.outputMode.videoFormat = videoFormatValue->asString();
|
||||
mConfig.inputVideoFormat = videoFormatValue->asString();
|
||||
mConfig.outputVideoFormat = videoFormatValue->asString();
|
||||
}
|
||||
}
|
||||
if (const JsonValue* frameRateValue = configJson.find("frameRate"))
|
||||
{
|
||||
if (frameRateValue->isString() && !frameRateValue->asString().empty())
|
||||
{
|
||||
mConfig.videoIO.inputMode.frameRate = frameRateValue->asString();
|
||||
mConfig.videoIO.outputMode.frameRate = frameRateValue->asString();
|
||||
mConfig.inputFrameRate = frameRateValue->asString();
|
||||
mConfig.outputFrameRate = frameRateValue->asString();
|
||||
}
|
||||
else if (frameRateValue->isNumber())
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << frameRateValue->asNumber();
|
||||
mConfig.videoIO.inputMode.frameRate = stream.str();
|
||||
mConfig.videoIO.outputMode.frameRate = stream.str();
|
||||
mConfig.inputFrameRate = stream.str();
|
||||
mConfig.outputFrameRate = stream.str();
|
||||
}
|
||||
}
|
||||
if (const JsonValue* inputVideoFormatValue = configJson.find("inputVideoFormat"))
|
||||
{
|
||||
if (inputVideoFormatValue->isString() && !inputVideoFormatValue->asString().empty())
|
||||
mConfig.videoIO.inputMode.videoFormat = inputVideoFormatValue->asString();
|
||||
mConfig.inputVideoFormat = inputVideoFormatValue->asString();
|
||||
}
|
||||
if (const JsonValue* inputFrameRateValue = configJson.find("inputFrameRate"))
|
||||
{
|
||||
if (inputFrameRateValue->isString() && !inputFrameRateValue->asString().empty())
|
||||
mConfig.videoIO.inputMode.frameRate = inputFrameRateValue->asString();
|
||||
mConfig.inputFrameRate = inputFrameRateValue->asString();
|
||||
else if (inputFrameRateValue->isNumber())
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << inputFrameRateValue->asNumber();
|
||||
mConfig.videoIO.inputMode.frameRate = stream.str();
|
||||
mConfig.inputFrameRate = stream.str();
|
||||
}
|
||||
}
|
||||
if (const JsonValue* outputVideoFormatValue = configJson.find("outputVideoFormat"))
|
||||
{
|
||||
if (outputVideoFormatValue->isString() && !outputVideoFormatValue->asString().empty())
|
||||
mConfig.videoIO.outputMode.videoFormat = outputVideoFormatValue->asString();
|
||||
mConfig.outputVideoFormat = outputVideoFormatValue->asString();
|
||||
}
|
||||
if (const JsonValue* outputFrameRateValue = configJson.find("outputFrameRate"))
|
||||
{
|
||||
if (outputFrameRateValue->isString() && !outputFrameRateValue->asString().empty())
|
||||
mConfig.videoIO.outputMode.frameRate = outputFrameRateValue->asString();
|
||||
mConfig.outputFrameRate = outputFrameRateValue->asString();
|
||||
else if (outputFrameRateValue->isNumber())
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << outputFrameRateValue->asNumber();
|
||||
mConfig.videoIO.outputMode.frameRate = stream.str();
|
||||
mConfig.outputFrameRate = stream.str();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1868,12 +1867,11 @@ JsonValue RuntimeHost::BuildStateValue() const
|
||||
app.set("oscPort", JsonValue(static_cast<double>(mConfig.oscPort)));
|
||||
app.set("autoReload", JsonValue(mAutoReloadEnabled));
|
||||
app.set("maxTemporalHistoryFrames", JsonValue(static_cast<double>(mConfig.maxTemporalHistoryFrames)));
|
||||
app.set("videoBackend", JsonValue(VideoIOBackendName(mConfig.videoIO.backendId)));
|
||||
app.set("enableExternalKeying", JsonValue(mConfig.videoIO.externalKeyingEnabled));
|
||||
app.set("inputVideoFormat", JsonValue(mConfig.videoIO.inputMode.videoFormat));
|
||||
app.set("inputFrameRate", JsonValue(mConfig.videoIO.inputMode.frameRate));
|
||||
app.set("outputVideoFormat", JsonValue(mConfig.videoIO.outputMode.videoFormat));
|
||||
app.set("outputFrameRate", JsonValue(mConfig.videoIO.outputMode.frameRate));
|
||||
app.set("enableExternalKeying", JsonValue(mConfig.enableExternalKeying));
|
||||
app.set("inputVideoFormat", JsonValue(mConfig.inputVideoFormat));
|
||||
app.set("inputFrameRate", JsonValue(mConfig.inputFrameRate));
|
||||
app.set("outputVideoFormat", JsonValue(mConfig.outputVideoFormat));
|
||||
app.set("outputFrameRate", JsonValue(mConfig.outputFrameRate));
|
||||
root.set("app", app);
|
||||
|
||||
JsonValue runtime = JsonValue::MakeObject();
|
||||
@@ -1889,22 +1887,25 @@ JsonValue RuntimeHost::BuildStateValue() const
|
||||
video.set("modeName", JsonValue(mSignalModeName));
|
||||
root.set("video", video);
|
||||
|
||||
JsonValue deckLink = JsonValue::MakeObject();
|
||||
deckLink.set("modelName", JsonValue(mDeckLinkOutputStatus.modelName));
|
||||
deckLink.set("supportsInternalKeying", JsonValue(mDeckLinkOutputStatus.supportsInternalKeying));
|
||||
deckLink.set("supportsExternalKeying", JsonValue(mDeckLinkOutputStatus.supportsExternalKeying));
|
||||
deckLink.set("keyerInterfaceAvailable", JsonValue(mDeckLinkOutputStatus.keyerInterfaceAvailable));
|
||||
deckLink.set("externalKeyingRequested", JsonValue(mDeckLinkOutputStatus.externalKeyingRequested));
|
||||
deckLink.set("externalKeyingActive", JsonValue(mDeckLinkOutputStatus.externalKeyingActive));
|
||||
deckLink.set("statusMessage", JsonValue(mDeckLinkOutputStatus.statusMessage));
|
||||
root.set("decklink", deckLink);
|
||||
|
||||
JsonValue videoIO = JsonValue::MakeObject();
|
||||
videoIO.set("backend", JsonValue(VideoIOBackendName(mVideoIOStatus.backendId)));
|
||||
videoIO.set("deviceName", JsonValue(mVideoIOStatus.deviceName));
|
||||
videoIO.set("hasInputDevice", JsonValue(mVideoIOStatus.hasInputDevice));
|
||||
videoIO.set("hasInputSource", JsonValue(mVideoIOStatus.hasInputSource));
|
||||
videoIO.set("inputModeName", JsonValue(mVideoIOStatus.inputDisplayModeName));
|
||||
videoIO.set("outputModeName", JsonValue(mVideoIOStatus.outputDisplayModeName));
|
||||
JsonValue capabilities = JsonValue::MakeObject();
|
||||
capabilities.set("supportsInternalKeying", JsonValue(mVideoIOStatus.capabilities.supportsInternalKeying));
|
||||
capabilities.set("supportsExternalKeying", JsonValue(mVideoIOStatus.capabilities.supportsExternalKeying));
|
||||
capabilities.set("keyerInterfaceAvailable", JsonValue(mVideoIOStatus.capabilities.keyerInterfaceAvailable));
|
||||
videoIO.set("capabilities", capabilities);
|
||||
videoIO.set("externalKeyingRequested", JsonValue(mVideoIOStatus.externalKeyingRequested));
|
||||
videoIO.set("externalKeyingActive", JsonValue(mVideoIOStatus.externalKeyingActive));
|
||||
videoIO.set("statusMessage", JsonValue(mVideoIOStatus.statusMessage));
|
||||
videoIO.set("formatStatusMessage", JsonValue(mVideoIOStatus.formatStatusMessage));
|
||||
videoIO.set("backend", JsonValue(mDeckLinkOutputStatus.backendName));
|
||||
videoIO.set("modelName", JsonValue(mDeckLinkOutputStatus.modelName));
|
||||
videoIO.set("supportsInternalKeying", JsonValue(mDeckLinkOutputStatus.supportsInternalKeying));
|
||||
videoIO.set("supportsExternalKeying", JsonValue(mDeckLinkOutputStatus.supportsExternalKeying));
|
||||
videoIO.set("keyerInterfaceAvailable", JsonValue(mDeckLinkOutputStatus.keyerInterfaceAvailable));
|
||||
videoIO.set("externalKeyingRequested", JsonValue(mDeckLinkOutputStatus.externalKeyingRequested));
|
||||
videoIO.set("externalKeyingActive", JsonValue(mDeckLinkOutputStatus.externalKeyingActive));
|
||||
videoIO.set("statusMessage", JsonValue(mDeckLinkOutputStatus.statusMessage));
|
||||
root.set("videoIO", videoIO);
|
||||
|
||||
JsonValue performance = JsonValue::MakeObject();
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "RuntimeJson.h"
|
||||
#include "ShaderTypes.h"
|
||||
#include "VideoIOTypes.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
@@ -39,7 +38,10 @@ public:
|
||||
void SetCompileStatus(bool succeeded, const std::string& message);
|
||||
void SetSignalStatus(bool hasSignal, unsigned width, unsigned height, const std::string& modeName);
|
||||
bool TrySetSignalStatus(bool hasSignal, unsigned width, unsigned height, const std::string& modeName);
|
||||
void SetVideoIOStatus(const VideoIOState& state);
|
||||
void SetDeckLinkOutputStatus(const std::string& modelName, bool supportsInternalKeying, bool supportsExternalKeying,
|
||||
bool keyerInterfaceAvailable, bool externalKeyingRequested, bool externalKeyingActive, const std::string& statusMessage);
|
||||
void SetVideoIOStatus(const std::string& backendName, const std::string& modelName, bool supportsInternalKeying, bool supportsExternalKeying,
|
||||
bool keyerInterfaceAvailable, bool externalKeyingRequested, bool externalKeyingActive, const std::string& statusMessage);
|
||||
void SetPerformanceStats(double frameBudgetMilliseconds, double renderMilliseconds);
|
||||
bool TrySetPerformanceStats(double frameBudgetMilliseconds, double renderMilliseconds);
|
||||
void SetFramePacingStats(double completionIntervalMilliseconds, double smoothedCompletionIntervalMilliseconds,
|
||||
@@ -63,8 +65,11 @@ public:
|
||||
unsigned short GetServerPort() const { return mServerPort; }
|
||||
unsigned short GetOscPort() const { return mConfig.oscPort; }
|
||||
unsigned GetMaxTemporalHistoryFrames() const { return mConfig.maxTemporalHistoryFrames; }
|
||||
bool ExternalKeyingEnabled() const { return mConfig.videoIO.externalKeyingEnabled; }
|
||||
VideoIOConfiguration GetVideoIOConfiguration() const { return mConfig.videoIO; }
|
||||
bool ExternalKeyingEnabled() const { return mConfig.enableExternalKeying; }
|
||||
const std::string& GetInputVideoFormat() const { return mConfig.inputVideoFormat; }
|
||||
const std::string& GetInputFrameRate() const { return mConfig.inputFrameRate; }
|
||||
const std::string& GetOutputVideoFormat() const { return mConfig.outputVideoFormat; }
|
||||
const std::string& GetOutputFrameRate() const { return mConfig.outputFrameRate; }
|
||||
void SetServerPort(unsigned short port);
|
||||
bool AutoReloadEnabled() const { return mAutoReloadEnabled; }
|
||||
|
||||
@@ -76,22 +81,23 @@ private:
|
||||
unsigned short oscPort = 9000;
|
||||
bool autoReload = true;
|
||||
unsigned maxTemporalHistoryFrames = 4;
|
||||
VideoIOConfiguration videoIO;
|
||||
bool enableExternalKeying = false;
|
||||
std::string inputVideoFormat = "1080p";
|
||||
std::string inputFrameRate = "59.94";
|
||||
std::string outputVideoFormat = "1080p";
|
||||
std::string outputFrameRate = "59.94";
|
||||
};
|
||||
|
||||
struct VideoIOStatusSnapshot
|
||||
struct DeckLinkOutputStatus
|
||||
{
|
||||
VideoIOBackendId backendId = VideoIOBackendId::DeckLink;
|
||||
std::string deviceName;
|
||||
VideoIOCapabilities capabilities;
|
||||
bool hasInputDevice = false;
|
||||
bool hasInputSource = false;
|
||||
std::string inputDisplayModeName = "1080p59.94";
|
||||
std::string outputDisplayModeName = "1080p59.94";
|
||||
std::string backendName = "decklink";
|
||||
std::string modelName;
|
||||
bool supportsInternalKeying = false;
|
||||
bool supportsExternalKeying = false;
|
||||
bool keyerInterfaceAvailable = false;
|
||||
bool externalKeyingRequested = false;
|
||||
bool externalKeyingActive = false;
|
||||
std::string statusMessage;
|
||||
std::string formatStatusMessage;
|
||||
};
|
||||
|
||||
struct LayerPersistentState
|
||||
@@ -170,7 +176,7 @@ private:
|
||||
uint64_t mLateFrameCount;
|
||||
uint64_t mDroppedFrameCount;
|
||||
uint64_t mFlushedFrameCount;
|
||||
VideoIOStatusSnapshot mVideoIOStatus;
|
||||
DeckLinkOutputStatus mDeckLinkOutputStatus;
|
||||
unsigned short mServerPort;
|
||||
bool mAutoReloadEnabled;
|
||||
std::chrono::steady_clock::time_point mStartTime;
|
||||
|
||||
Reference in New Issue
Block a user