#pragma once #include #include #include #include namespace sc { struct SendCommand { std::string_view target = "monitor"; // monitor, window std::string_view peer_address; // optional; empty means auto-discover int bitrate_kbps = 4000; // VBV max bitrate int crf = 22; // constant rate factor (quality) }; struct ReceiveCommand { std::string_view peer_address; // optional, informational int local_rtp_port = 5004; int signaling_port = 5005; bool fullscreen = false; bool software_decode = false; // --swdecode disables the hardware probe }; struct DiscoverCommand { int timeout_seconds = 3; }; struct WaybarCommand { bool toggle = false; // toggle streaming instead of printing status }; using Command = std::variant; // Parse command line arguments. Prints usage and returns std::nullopt on error. // `argv` is `char const* const*` so both `main`'s `char**` and const arrays // convert implicitly. std::optional parse_cli(int argc, const char* const argv[]); } // namespace sc