Skip to content

Commit

Permalink
Merge pull request #20848 from alalek:reverse_plugins_candidates_order
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Oct 9, 2021
2 parents ac57be9 + 39ee5c5 commit 023e86d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/core/src/parallel/plugin_parallel_wrapper.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ std::vector<FileSystemPath_t> getPluginCandidates(const std::string& baseName)
continue;
std::vector<std::string> candidates;
cv::glob(utils::fs::join(path, plugin_expr), candidates);
// Prefer candisates with higher versions
// TODO: implemented accurate versions-based comparator
std::sort(candidates.begin(), candidates.end(), std::greater<std::string>());
CV_LOG_DEBUG(NULL, " - " << path << ": " << candidates.size());
copy(candidates.begin(), candidates.end(), back_inserter(results));
}
Expand Down
3 changes: 3 additions & 0 deletions modules/highgui/src/plugin_wrapper.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ std::vector<FileSystemPath_t> getPluginCandidates(const std::string& baseName)
continue;
std::vector<std::string> candidates;
cv::glob(utils::fs::join(path, plugin_expr), candidates);
// Prefer candisates with higher versions
// TODO: implemented accurate versions-based comparator
std::sort(candidates.begin(), candidates.end(), std::greater<std::string>());
CV_LOG_DEBUG(NULL, " - " << path << ": " << candidates.size());
copy(candidates.begin(), candidates.end(), back_inserter(results));
}
Expand Down
3 changes: 3 additions & 0 deletions modules/videoio/src/backend_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,9 @@ std::vector<FileSystemPath_t> getPluginCandidates(const std::string& baseName)
continue;
std::vector<std::string> candidates;
cv::glob(utils::fs::join(path, plugin_expr), candidates);
// Prefer candisates with higher versions
// TODO: implemented accurate versions-based comparator
std::sort(candidates.begin(), candidates.end(), std::greater<std::string>());
CV_LOG_INFO(NULL, " - " << path << ": " << candidates.size());
copy(candidates.begin(), candidates.end(), back_inserter(results));
}
Expand Down

0 comments on commit 023e86d

Please sign in to comment.