mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2026-07-17 16:36:49 +00:00
VNC-151 Refactor codec parsing to skip unsupported codecs with a log message
This commit is contained in:
parent
16a1f327b6
commit
b71785fa5a
1 changed files with 8 additions and 6 deletions
|
|
@ -47,7 +47,6 @@
|
|||
#include "XserverDesktop.h"
|
||||
#include "vncBlockHandler.h"
|
||||
#include "vncExtInit.h"
|
||||
#include <fmt/format.h>
|
||||
#include "vncHooks.h"
|
||||
#include "vncSelection.h"
|
||||
#include "xorg-version.h"
|
||||
|
|
@ -311,11 +310,14 @@ void vncExtensionInit(void)
|
|||
const char *codec_cli_arg = Server::videoCodec;
|
||||
if (codec_cli_arg[0]) {
|
||||
parsed_codecs = SupportedVideoEncoders::parse(codec_cli_arg);
|
||||
for (auto codec: parsed_codecs) {
|
||||
vlog.debug("CODEC: %s" , std::string(codec).c_str()) ;
|
||||
if (!SupportedVideoEncoders::is_supported(codec))
|
||||
throw std::invalid_argument(fmt::format("Unknown video codec: {}", codec));
|
||||
}
|
||||
std::erase_if(parsed_codecs, [](const auto &codec) {
|
||||
const auto supported = SupportedVideoEncoders::is_supported(codec);
|
||||
if (!supported) {
|
||||
std::string str{codec};
|
||||
vlog.info("Unknown codec %s skipped", str.c_str());
|
||||
}
|
||||
return supported;
|
||||
});
|
||||
}
|
||||
const auto &probe = video_encoders::EncoderProbe::get(FFmpeg::get(), parsed_codecs, Server::driNode.getData());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue