diff --git a/src/RenderingManager.cpp b/src/RenderingManager.cpp index f4c0389..19a3997 100644 --- a/src/RenderingManager.cpp +++ b/src/RenderingManager.cpp @@ -354,16 +354,19 @@ bool Rendering::init() // increase selection rank for GPU decoding plugins std::list gpuplugins = GstToolkit::enable_gpu_decoding_plugins(Settings::application.render.gpu_decoding); - if (Settings::application.render.gpu_decoding) { - if (gpuplugins.size() > 0) { - Log::Info("Found the following GPU decoding plugin(s):"); - int i = 1; - for(auto it = gpuplugins.rbegin(); it != gpuplugins.rend(); it++, ++i) - Log::Info("%d. %s", i, (*it).c_str()); - } - else { - Log::Info("No GPU decoding plugin found."); - } + if (gpuplugins.size() > 0) { + Settings::application.render.gpu_decoding_available = true; + Log::Info("Found the following hardware decoding gstreamer plugin(s):"); + int i = 1; + for(auto it = gpuplugins.begin(); it != gpuplugins.end(); it++, ++i) + Log::Info("%d. %s", i, (*it).c_str()); + if (Settings::application.render.gpu_decoding) + Log::Info("Hardware decoding enabled."); + else + Log::Info("Hardware decoding disabled."); + } + else { + Log::Info("No hardware decoding plugin found."); } #ifdef SYNC_GSTREAMER_OPENGL_CONTEXT #if GST_GL_HAVE_PLATFORM_WGL diff --git a/src/Settings.h b/src/Settings.h index 83706ad..f627c96 100644 --- a/src/Settings.h +++ b/src/Settings.h @@ -163,6 +163,7 @@ struct RenderConfig int custom_width, custom_height; float fading; bool gpu_decoding; + bool gpu_decoding_available; RenderConfig() { disabled = false; @@ -175,6 +176,7 @@ struct RenderConfig custom_height = 600; fading = 0.0; gpu_decoding = true; + gpu_decoding_available = false; } }; diff --git a/src/UserInterfaceManager.cpp b/src/UserInterfaceManager.cpp index 3386619..639e82a 100644 --- a/src/UserInterfaceManager.cpp +++ b/src/UserInterfaceManager.cpp @@ -8329,7 +8329,10 @@ void Navigator::RenderMainPannelSettings() ImGuiToolkit::Indication("If enabled, tries to find a platform adapted hardware-accelerated " "driver to decode (read) or encode (record) videos.", ICON_FA_MICROCHIP); ImGui::SameLine(0); - change |= ImGuiToolkit::ButtonSwitch( "Hardware video en/decoding", &gpu); + if (Settings::application.render.gpu_decoding_available) + change |= ImGuiToolkit::ButtonSwitch( "Hardware en/decoding", &gpu); + else + ImGui::TextDisabled("Hardware en/decoding unavailable"); if (change) { need_restart = ( vsync != (Settings::application.render.vsync > 0) ||