NDI discovery
This commit is contained in:
@@ -149,6 +149,46 @@ void TestConfigJsonRoundTrip()
|
||||
Expect(parsed.runtimeShaderId == "solid-color", "runtime shader id round trips");
|
||||
}
|
||||
|
||||
void TestOutputAlphaNormalizesLegacyKeying()
|
||||
{
|
||||
using namespace RenderCadenceCompositor;
|
||||
|
||||
const std::string deckLinkJson =
|
||||
"{"
|
||||
"\"output\":{"
|
||||
"\"backend\":\"decklink\","
|
||||
"\"keying\":{\"external\":true,\"alphaRequired\":false}"
|
||||
"}"
|
||||
"}";
|
||||
|
||||
AppConfig parsed;
|
||||
std::string error;
|
||||
Expect(ParseAppConfigJson(deckLinkJson, parsed, error), "legacy DeckLink keying config parses");
|
||||
Expect(parsed.output.externalKeyingEnabled, "DeckLink external keying remains enabled");
|
||||
Expect(parsed.output.outputAlphaRequired, "DeckLink external keying implies output alpha");
|
||||
|
||||
const std::filesystem::path path = std::filesystem::temp_directory_path() / "render-cadence-compositor-config-alpha-test.json";
|
||||
std::ofstream output(path, std::ios::binary);
|
||||
output
|
||||
<< "{\n"
|
||||
<< " \"output\": {\n"
|
||||
<< " \"backend\": \"ndi\",\n"
|
||||
<< " \"keying\": {\n"
|
||||
<< " \"external\": true,\n"
|
||||
<< " \"alphaRequired\": false\n"
|
||||
<< " }\n"
|
||||
<< " }\n"
|
||||
<< "}\n";
|
||||
output.close();
|
||||
|
||||
AppConfigProvider provider;
|
||||
Expect(provider.Load(path, error), "legacy NDI keying config loads");
|
||||
Expect(provider.Config().output.outputAlphaRequired, "legacy external keying implies NDI output alpha");
|
||||
Expect(!provider.Config().output.externalKeyingEnabled, "NDI ignores external keying backing field");
|
||||
|
||||
std::filesystem::remove(path);
|
||||
}
|
||||
|
||||
void TestHelpers()
|
||||
{
|
||||
using namespace RenderCadenceCompositor;
|
||||
@@ -178,6 +218,7 @@ int main()
|
||||
TestCommandLineOverrides();
|
||||
TestPreviewDefaultsAreOptIn();
|
||||
TestConfigJsonRoundTrip();
|
||||
TestOutputAlphaNormalizesLegacyKeying();
|
||||
TestHelpers();
|
||||
|
||||
if (gFailures != 0)
|
||||
|
||||
Reference in New Issue
Block a user