mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2026-02-06 11:27:19 +00:00
VNC-151 Fix build
This commit is contained in:
parent
631135c8f7
commit
84427414fe
46
common/rfb/encoders/EncoderConfiguration.cpp
Normal file
46
common/rfb/encoders/EncoderConfiguration.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#include "EncoderConfiguration.h"
|
||||
|
||||
namespace rfb {
|
||||
static inline std::array<EncoderConfiguration, static_cast<size_t>(KasmVideoEncoders::Encoder::unavailable) + 1> EncoderConfigurations =
|
||||
{
|
||||
// AV1
|
||||
// av1_vaapi
|
||||
EncoderConfiguration{0, 0, {}},
|
||||
// av1_ffmpeg_vaapi
|
||||
EncoderConfiguration{0, 0, {}},
|
||||
// av1_nvenc
|
||||
EncoderConfiguration{0, 0, {}},
|
||||
// av1_software
|
||||
EncoderConfiguration{0, 0, {}},
|
||||
|
||||
// H.265
|
||||
// h265_vaapi
|
||||
EncoderConfiguration{0, 51, {18, 23, 28, 39, 51}},
|
||||
// h265_ffmpeg_vaapi
|
||||
EncoderConfiguration{0, 51, {18, 23, 28, 39, 51}},
|
||||
// h265_nvenc
|
||||
EncoderConfiguration{0, 51, {18, 23, 28, 39, 51}},
|
||||
// h265_software
|
||||
EncoderConfiguration{0, 51, {18, 23, 28, 39, 51}},
|
||||
|
||||
// H.264
|
||||
// h264_vaapi
|
||||
EncoderConfiguration{0, 51, {18, 23, 28, 33, 51}},
|
||||
// h264_ffmpeg_vaapi
|
||||
EncoderConfiguration{0, 51, {18, 23, 28, 39, 51}},
|
||||
// h264_nvenc
|
||||
EncoderConfiguration{0, 51, {18, 23, 28, 39, 51}},
|
||||
// h264_software
|
||||
EncoderConfiguration{0, 51, {18, 23, 28, 39, 51}},
|
||||
|
||||
EncoderConfiguration{}
|
||||
};
|
||||
|
||||
// Compile-time check: EncoderConfigurations must match Encoder enum count (excluding unavailable)
|
||||
static_assert(EncoderConfigurations.size() == static_cast<size_t>(KasmVideoEncoders::Encoder::unavailable) + 1,
|
||||
"EncoderSettingsArray size must match KasmVideoEncoders::Encoder enum count.");
|
||||
|
||||
const EncoderConfiguration &EncoderConfiguration::get_configuration(KasmVideoEncoders::Encoder encoder) {
|
||||
return EncoderConfigurations[static_cast<uint8_t>(encoder)];
|
||||
}
|
||||
} // namespace rfb
|
||||
44
common/rfb/encoders/EncoderConfiguration.h
Normal file
44
common/rfb/encoders/EncoderConfiguration.h
Normal file
@ -0,0 +1,44 @@
|
||||
/* Copyright (C) 2025 Kasm. All Rights Reserved.
|
||||
*
|
||||
* This is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
* USA.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
|
||||
#include "KasmVideoEncoders.h"
|
||||
#include "rdr/types.h"
|
||||
|
||||
namespace rfb {
|
||||
struct EncoderConfiguration {
|
||||
struct CodecOption {
|
||||
std::string name;
|
||||
std::variant<rdr::S32, std::string> value;
|
||||
};
|
||||
|
||||
static constexpr uint8_t MAX_PRESETS = 5;
|
||||
rdr::S32 min_quality{};
|
||||
rdr::S32 max_quality{};
|
||||
|
||||
// std::vector<CodecOption> codecOptions{};
|
||||
std::array<rdr::S32, MAX_PRESETS> presets{};
|
||||
|
||||
static const EncoderConfiguration &get_configuration(KasmVideoEncoders::Encoder encoder);
|
||||
};
|
||||
} // namespace rfb
|
||||
Loading…
Reference in New Issue
Block a user