NDI discovery
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 2m10s
CI / Windows Release Package (push) Has been skipped

This commit is contained in:
Aiden
2026-05-30 20:03:01 +10:00
parent 8ffc011ca0
commit 2b995ac058
21 changed files with 493 additions and 56 deletions

View File

@@ -7,8 +7,10 @@
#include "RuntimeLayerController.h"
#include "../logging/Logger.h"
#include "../control/RuntimeStateJson.h"
#include "../json/JsonWriter.h"
#include "../preview/PreviewWindowThread.h"
#include "../telemetry/TelemetryHealthMonitor.h"
#include "../video/ndi/NdiSourceDiscovery.h"
#include "VideoIOEdges.h"
#include "VideoOutputThread.h"
@@ -20,6 +22,7 @@
#include <string>
#include <thread>
#include <type_traits>
#include <vector>
namespace RenderCadenceCompositor
{
@@ -250,6 +253,9 @@ private:
callbacks.getConfigJson = [this]() {
return BuildConfigJson();
};
callbacks.getNdiSourcesJson = [this]() {
return BuildNdiSourcesJson();
};
callbacks.addLayer = [this](const std::string& body) {
return mRuntimeLayers.HandleAddLayer(body);
};
@@ -341,6 +347,31 @@ private:
return SerializeJson(root);
}
std::string BuildNdiSourcesJson() const
{
std::vector<NdiSourceInfo> sources;
std::string error;
const bool discovered = DiscoverNdiSources(sources, error);
JsonWriter writer;
writer.BeginObject();
writer.KeyBool("ok", discovered);
if (!error.empty())
writer.KeyString("error", error);
writer.Key("sources");
writer.BeginArray();
for (const NdiSourceInfo& source : sources)
{
writer.BeginObject();
writer.KeyString("name", source.name);
writer.KeyString("urlAddress", source.urlAddress);
writer.EndObject();
}
writer.EndArray();
writer.EndObject();
return writer.StringValue();
}
ControlActionResult HandleConfigSave(const std::string& body)
{
AppConfig nextConfig;