Merge pull request #16103 from alalek:videoio_ffmpeg_wrapper_version_check

pull/16130/head
Alexander Alekhin 5 years ago
commit 544ceedcac
  1. 19
      modules/videoio/src/backend_plugin.cpp

@ -208,10 +208,23 @@ public:
CV_LOG_INFO(NULL, "Video I/O: plugin is incompatible: " << lib->getName());
return;
}
if (plugin_api_->api_header.opencv_version_major != CV_VERSION_MAJOR ||
plugin_api_->api_header.opencv_version_minor != CV_VERSION_MINOR)
if (plugin_api_->api_header.opencv_version_major != CV_VERSION_MAJOR)
{
CV_LOG_ERROR(NULL, "Video I/O: wrong OpenCV version used by plugin '" << plugin_api_->api_header.api_description << "': " <<
CV_LOG_ERROR(NULL, "Video I/O: wrong OpenCV major version used by plugin '" << plugin_api_->api_header.api_description << "': " <<
cv::format("%d.%d, OpenCV version is '" CV_VERSION "'", plugin_api_->api_header.opencv_version_major, plugin_api_->api_header.opencv_version_minor))
plugin_api_ = NULL;
return;
}
#ifdef HAVE_FFMPEG_WRAPPER
if (plugin_api_->captureAPI == CAP_FFMPEG)
{
// no checks for OpenCV minor version
}
else
#endif
if (plugin_api_->api_header.opencv_version_minor != CV_VERSION_MINOR)
{
CV_LOG_ERROR(NULL, "Video I/O: wrong OpenCV minor version used by plugin '" << plugin_api_->api_header.api_description << "': " <<
cv::format("%d.%d, OpenCV version is '" CV_VERSION "'", plugin_api_->api_header.opencv_version_major, plugin_api_->api_header.opencv_version_minor))
plugin_api_ = NULL;
return;

Loading…
Cancel
Save