mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Framework for dynamic videoio backends, FFmpeg and GStreamer plugins
This commit is contained in:
@@ -865,6 +865,10 @@ Passed subdirectories are used in LIFO order.
|
||||
*/
|
||||
CV_EXPORTS void addDataSearchSubDirectory(const cv::String& subdir);
|
||||
|
||||
/** @brief Return location of OpenCV libraries or current executable
|
||||
*/
|
||||
CV_EXPORTS std::string getBinLocation();
|
||||
|
||||
//! @}
|
||||
|
||||
} // namespace utils
|
||||
|
||||
@@ -26,6 +26,9 @@ CV_EXPORTS cv::String canonical(const cv::String& path);
|
||||
/** Join path components */
|
||||
CV_EXPORTS cv::String join(const cv::String& base, const cv::String& path);
|
||||
|
||||
/** Get parent directory */
|
||||
CV_EXPORTS cv::String getParent(const cv::String &path);
|
||||
|
||||
/**
|
||||
* Generate a list of all files that match the globbing pattern.
|
||||
*
|
||||
|
||||
@@ -144,6 +144,11 @@ static cv::String getModuleLocation(const void* addr)
|
||||
return cv::String();
|
||||
}
|
||||
|
||||
std::string getBinLocation()
|
||||
{
|
||||
return getModuleLocation((void*)getModuleLocation); // use code addr, doesn't work with static linkage!
|
||||
}
|
||||
|
||||
cv::String findDataFile(const cv::String& relative_path,
|
||||
const char* configuration_parameter,
|
||||
const std::vector<String>* search_paths,
|
||||
@@ -287,7 +292,7 @@ cv::String findDataFile(const cv::String& relative_path,
|
||||
}
|
||||
}
|
||||
|
||||
cv::String module_path = getModuleLocation((void*)getModuleLocation); // use code addr, doesn't work with static linkage!
|
||||
cv::String module_path = getBinLocation();
|
||||
CV_LOG_DEBUG(NULL, "Detected module path: '" << module_path << '\'');
|
||||
|
||||
if (!has_tested_build_directory &&
|
||||
|
||||
@@ -83,6 +83,14 @@ cv::String join(const cv::String& base, const cv::String& path)
|
||||
return result;
|
||||
}
|
||||
|
||||
CV_EXPORTS cv::String getParent(const cv::String &path)
|
||||
{
|
||||
std::string::size_type loc = path.find_last_of("/\\");
|
||||
if (loc == std::string::npos)
|
||||
return std::string();
|
||||
return std::string(path, 0, loc);
|
||||
}
|
||||
|
||||
#if OPENCV_HAVE_FILESYSTEM_SUPPORT
|
||||
|
||||
cv::String canonical(const cv::String& path)
|
||||
|
||||
Reference in New Issue
Block a user