Improved logs and Settings for hardware gstreamer plugins

This commit is contained in:
Bruno Herbelin
2023-02-17 18:53:54 +01:00
parent e105022185
commit d25c17342b
3 changed files with 19 additions and 11 deletions

View File

@@ -354,16 +354,19 @@ bool Rendering::init()
// increase selection rank for GPU decoding plugins
std::list<std::string> 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

View File

@@ -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;
}
};

View File

@@ -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) ||