mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2026-07-17 16:36:49 +00:00
VNC-151 Refactor video codec validation logic to improve readability and maintainability
This commit is contained in:
parent
1c80f6b9d0
commit
b2adaf8429
1 changed files with 5 additions and 3 deletions
|
|
@ -254,14 +254,16 @@ VNCServerST::VNCServerST(const char* name_, SDesktop* desktop_)
|
|||
if (watermarkData)
|
||||
sendWatermark = true;
|
||||
|
||||
if (Server::videoCodec[0] && SupportedVideoEncoders::to_string(SupportedVideoEncoders::Codecs::H264) != Server::videoCodec.getValueStr())
|
||||
throw std::invalid_argument(fmt::format("Unknown test videoCodec {}", Server::videoCodec.getValueStr()));
|
||||
const char *selected_codec = Server::videoCodec;
|
||||
|
||||
if (selected_codec[0] && !SupportedVideoEncoders::is_supported(selected_codec))
|
||||
throw std::invalid_argument(fmt::format("Unknown video codec: {}", selected_codec));
|
||||
|
||||
if (Server::selfBench)
|
||||
SelfBench();
|
||||
|
||||
if (Server::benchmark[0]) {
|
||||
auto *file_name = Server::benchmark.getValueStr();
|
||||
const auto *file_name = Server::benchmark.getValueStr();
|
||||
if (!std::filesystem::exists(file_name))
|
||||
throw std::invalid_argument("Benchmarking video file does not exist");
|
||||
benchmark(file_name, Server::benchmarkResults.getValueStr());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue