From e0e683aedf6df431c6ecb59199b4bd08fb8625d4 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 9 Dec 2019 14:06:36 +0300 Subject: [PATCH] videoio(plugins): relax version check for FFmpeg wrapper on Windows --- modules/videoio/src/backend_plugin.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/modules/videoio/src/backend_plugin.cpp b/modules/videoio/src/backend_plugin.cpp index 71f79c16db..617c3cda29 100644 --- a/modules/videoio/src/backend_plugin.cpp +++ b/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;