diff --git a/GstToolkit.cpp b/GstToolkit.cpp index 5fbe3f4..27e7f99 100644 --- a/GstToolkit.cpp +++ b/GstToolkit.cpp @@ -137,7 +137,7 @@ string GstToolkit::gst_version() // see https://developer.ridgerun.com/wiki/index.php?title=GStreamer_modify_the_elements_rank -std::list GstToolkit::enable_gpu_decoding_plugins() +std::list GstToolkit::enable_gpu_decoding_plugins(bool enable) { static list pluginslist; static GstRegistry* plugins_register = nullptr; @@ -162,7 +162,7 @@ std::list GstToolkit::enable_gpu_decoding_plugins() GstPluginFeature* feature = gst_registry_lookup_feature(plugins_register, plugins[i]); if(feature != NULL) { pluginslist.push_front( string( plugins[i] ) ); - gst_plugin_feature_set_rank(feature, GST_RANK_PRIMARY + 1); + gst_plugin_feature_set_rank(feature, enable ? GST_RANK_PRIMARY + 1 : GST_RANK_MARGINAL); gst_object_unref(feature); } } diff --git a/GstToolkit.h b/GstToolkit.h index 7616b62..c7a3f1c 100644 --- a/GstToolkit.h +++ b/GstToolkit.h @@ -21,7 +21,7 @@ std::string filename_to_uri(std::string filename); std::string gst_version(); std::list all_plugins(); -std::list enable_gpu_decoding_plugins(); +std::list enable_gpu_decoding_plugins(bool enable = true); std::list all_plugin_features(std::string pluginname); bool enable_feature (std::string name, bool enable); diff --git a/RenderingManager.cpp b/RenderingManager.cpp index 2d5f69b..d052fe7 100644 --- a/RenderingManager.cpp +++ b/RenderingManager.cpp @@ -158,8 +158,8 @@ bool Rendering::init() gst_init (NULL, NULL); // 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) { - std::list gpuplugins = GstToolkit::enable_gpu_decoding_plugins(); if (gpuplugins.size() > 0) { Log::Info("Video decoding favoring the following GPU decoding plugin(s):"); for(auto it = gpuplugins.begin(); it != gpuplugins.end(); it++)