From c0cb4cd68fc81b1c3278691b5a0516491ccfe7c7 Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Fri, 1 Nov 2024 23:47:46 +0100 Subject: [PATCH] Disable the encoders that are not compiled in the dashboard --- dashboard/gui_config.h.in | 5 +++++ dashboard/settings.cpp | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/dashboard/gui_config.h.in b/dashboard/gui_config.h.in index 3067094e..f5e9ec42 100644 --- a/dashboard/gui_config.h.in +++ b/dashboard/gui_config.h.in @@ -20,3 +20,8 @@ #pragma once #cmakedefine01 WIVRN_CHECK_CAPSYSNICE + +#cmakedefine01 WIVRN_USE_NVENC +#cmakedefine01 WIVRN_USE_VAAPI +#cmakedefine01 WIVRN_USE_VULKAN_ENCODE +#cmakedefine01 WIVRN_USE_X264 diff --git a/dashboard/settings.cpp b/dashboard/settings.cpp index 402bcd81..18316040 100644 --- a/dashboard/settings.cpp +++ b/dashboard/settings.cpp @@ -19,6 +19,7 @@ #include "settings.h" #include "escape_string.h" +#include "gui_config.h" #include "rectangle_partitionner.h" #include "steam_app.h" #include "ui_settings.h" @@ -153,6 +154,20 @@ settings::settings(wivrn_server * server_interface) : fill_steam_games_list(); load_settings(); + auto encoders = qobject_cast(ui->encoder->model()); +#if !WIVRN_USE_NVENC + encoders->item(1)->setEnabled(false); +#endif +#if !WIVRN_USE_VAAPI + encoders->item(2)->setEnabled(false); +#endif +#if !WIVRN_USE_X264 + encoders->item(3)->setEnabled(false); +#endif +#if !WIVRN_USE_VULKAN_ENCODE + encoders->item(4)->setEnabled(false); +#endif + ui->partitionner->set_paint([&](QPainter & painter, QRect rect, const QVariant & data, int index, bool selected) { QPalette palette = QApplication::palette();