Video backend
This commit is contained in:
@@ -1228,25 +1228,20 @@ void RuntimeHost::MarkRenderStateDirtyLocked()
|
||||
mRenderStateVersion.fetch_add(1, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
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)
|
||||
void RuntimeHost::SetVideoIOStatus(const VideoIOState& state)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mMutex);
|
||||
mDeckLinkOutputStatus.backendName = backendName;
|
||||
mDeckLinkOutputStatus.modelName = modelName;
|
||||
mDeckLinkOutputStatus.supportsInternalKeying = supportsInternalKeying;
|
||||
mDeckLinkOutputStatus.supportsExternalKeying = supportsExternalKeying;
|
||||
mDeckLinkOutputStatus.keyerInterfaceAvailable = keyerInterfaceAvailable;
|
||||
mDeckLinkOutputStatus.externalKeyingRequested = externalKeyingRequested;
|
||||
mDeckLinkOutputStatus.externalKeyingActive = externalKeyingActive;
|
||||
mDeckLinkOutputStatus.statusMessage = statusMessage;
|
||||
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;
|
||||
}
|
||||
|
||||
void RuntimeHost::SetPerformanceStats(double frameBudgetMilliseconds, double renderMilliseconds)
|
||||
@@ -1481,61 +1476,67 @@ 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.enableExternalKeying = enableExternalKeyingValue->asBoolean(mConfig.enableExternalKeying);
|
||||
mConfig.videoIO.externalKeyingEnabled = enableExternalKeyingValue->asBoolean(mConfig.videoIO.externalKeyingEnabled);
|
||||
if (const JsonValue* videoFormatValue = configJson.find("videoFormat"))
|
||||
{
|
||||
if (videoFormatValue->isString() && !videoFormatValue->asString().empty())
|
||||
{
|
||||
mConfig.inputVideoFormat = videoFormatValue->asString();
|
||||
mConfig.outputVideoFormat = videoFormatValue->asString();
|
||||
mConfig.videoIO.inputMode.videoFormat = videoFormatValue->asString();
|
||||
mConfig.videoIO.outputMode.videoFormat = videoFormatValue->asString();
|
||||
}
|
||||
}
|
||||
if (const JsonValue* frameRateValue = configJson.find("frameRate"))
|
||||
{
|
||||
if (frameRateValue->isString() && !frameRateValue->asString().empty())
|
||||
{
|
||||
mConfig.inputFrameRate = frameRateValue->asString();
|
||||
mConfig.outputFrameRate = frameRateValue->asString();
|
||||
mConfig.videoIO.inputMode.frameRate = frameRateValue->asString();
|
||||
mConfig.videoIO.outputMode.frameRate = frameRateValue->asString();
|
||||
}
|
||||
else if (frameRateValue->isNumber())
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << frameRateValue->asNumber();
|
||||
mConfig.inputFrameRate = stream.str();
|
||||
mConfig.outputFrameRate = stream.str();
|
||||
mConfig.videoIO.inputMode.frameRate = stream.str();
|
||||
mConfig.videoIO.outputMode.frameRate = stream.str();
|
||||
}
|
||||
}
|
||||
if (const JsonValue* inputVideoFormatValue = configJson.find("inputVideoFormat"))
|
||||
{
|
||||
if (inputVideoFormatValue->isString() && !inputVideoFormatValue->asString().empty())
|
||||
mConfig.inputVideoFormat = inputVideoFormatValue->asString();
|
||||
mConfig.videoIO.inputMode.videoFormat = inputVideoFormatValue->asString();
|
||||
}
|
||||
if (const JsonValue* inputFrameRateValue = configJson.find("inputFrameRate"))
|
||||
{
|
||||
if (inputFrameRateValue->isString() && !inputFrameRateValue->asString().empty())
|
||||
mConfig.inputFrameRate = inputFrameRateValue->asString();
|
||||
mConfig.videoIO.inputMode.frameRate = inputFrameRateValue->asString();
|
||||
else if (inputFrameRateValue->isNumber())
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << inputFrameRateValue->asNumber();
|
||||
mConfig.inputFrameRate = stream.str();
|
||||
mConfig.videoIO.inputMode.frameRate = stream.str();
|
||||
}
|
||||
}
|
||||
if (const JsonValue* outputVideoFormatValue = configJson.find("outputVideoFormat"))
|
||||
{
|
||||
if (outputVideoFormatValue->isString() && !outputVideoFormatValue->asString().empty())
|
||||
mConfig.outputVideoFormat = outputVideoFormatValue->asString();
|
||||
mConfig.videoIO.outputMode.videoFormat = outputVideoFormatValue->asString();
|
||||
}
|
||||
if (const JsonValue* outputFrameRateValue = configJson.find("outputFrameRate"))
|
||||
{
|
||||
if (outputFrameRateValue->isString() && !outputFrameRateValue->asString().empty())
|
||||
mConfig.outputFrameRate = outputFrameRateValue->asString();
|
||||
mConfig.videoIO.outputMode.frameRate = outputFrameRateValue->asString();
|
||||
else if (outputFrameRateValue->isNumber())
|
||||
{
|
||||
std::ostringstream stream;
|
||||
stream << outputFrameRateValue->asNumber();
|
||||
mConfig.outputFrameRate = stream.str();
|
||||
mConfig.videoIO.outputMode.frameRate = stream.str();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1867,11 +1868,12 @@ 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("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));
|
||||
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));
|
||||
root.set("app", app);
|
||||
|
||||
JsonValue runtime = JsonValue::MakeObject();
|
||||
@@ -1887,25 +1889,22 @@ 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(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));
|
||||
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));
|
||||
root.set("videoIO", videoIO);
|
||||
|
||||
JsonValue performance = JsonValue::MakeObject();
|
||||
|
||||
Reference in New Issue
Block a user