82 lines
1.7 KiB
C++
82 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
constexpr uint32_t DefaultGridCols = 2;
|
|
constexpr uint32_t DefaultGridRows = 2;
|
|
constexpr uint32_t MaxFeedCount = 16;
|
|
constexpr const char* AppName = "MXL Multiviewer";
|
|
constexpr uint32_t AppVersionMajor = 0;
|
|
constexpr uint32_t AppVersionMinor = 1;
|
|
constexpr uint32_t AppVersionPatch = 0;
|
|
|
|
enum class FeedKind
|
|
{
|
|
NoSignal,
|
|
MxlPlaceholder,
|
|
SmpteBars,
|
|
SyntheticV210,
|
|
MxlSdk
|
|
};
|
|
|
|
enum class PresentModeConfig
|
|
{
|
|
Fifo,
|
|
Mailbox,
|
|
Immediate
|
|
};
|
|
|
|
enum class V210StagingMemoryMode
|
|
{
|
|
Default,
|
|
Cached,
|
|
DeviceLocal
|
|
};
|
|
|
|
struct FeedConfig
|
|
{
|
|
FeedKind kind = FeedKind::NoSignal;
|
|
std::string mxlDomain;
|
|
std::string mxlFlowId;
|
|
};
|
|
|
|
struct AppConfig
|
|
{
|
|
bool logFps = true;
|
|
bool logPerf = false;
|
|
bool verbose = false;
|
|
bool paceUploads = false;
|
|
bool v210UploadWorker = false;
|
|
bool adaptiveFeedTexture = false;
|
|
uint32_t fpsCap = 60;
|
|
uint32_t maxV210UploadsPerFrame = 0;
|
|
uint32_t gridCols = DefaultGridCols;
|
|
uint32_t gridRows = DefaultGridRows;
|
|
PresentModeConfig presentMode = PresentModeConfig::Mailbox;
|
|
V210StagingMemoryMode v210StagingMemoryMode =
|
|
V210StagingMemoryMode::Default;
|
|
std::vector<FeedConfig> feeds;
|
|
};
|
|
|
|
std::optional<FeedKind> parseFeedKind(std::string_view text);
|
|
std::string_view feedKindName(FeedKind kind);
|
|
std::string_view v210StagingMemoryModeName(
|
|
V210StagingMemoryMode mode);
|
|
|
|
void printUsage(const char* executableName);
|
|
|
|
struct ConfigParseResult
|
|
{
|
|
AppConfig config;
|
|
bool shouldExit = false;
|
|
int exitCode = 0;
|
|
};
|
|
|
|
ConfigParseResult parseAppConfig(
|
|
int argc,
|
|
char* argv[]);
|