mirror of
https://github.com/opencv/opencv.git
synced 2025-07-31 18:07:08 +08:00
Log a debug message if a capture backend is generally available but isn't capabable of a capture mode.
This commit is contained in:
parent
6160104fd7
commit
a2be9e9fc1
@ -188,14 +188,25 @@ bool VideoCapture::open(const String& filename, int apiPreference, const std::ve
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
CV_CAPTURE_LOG_DEBUG(NULL,
|
CV_CAPTURE_LOG_DEBUG(NULL,
|
||||||
cv::format("VIDEOIO(%s): backend is not available "
|
cv::format("VIDEOIO(%s): backend is not available "
|
||||||
"(plugin is missing, or can't be loaded due "
|
"(plugin is missing, or can't be loaded due "
|
||||||
"dependencies or it is not compatible)",
|
"dependencies or it is not compatible)",
|
||||||
info.name));
|
info.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(apiPreference != CAP_ANY)
|
||||||
|
{
|
||||||
|
bool found = cv::videoio_registry::isBackendBuiltIn(static_cast<VideoCaptureAPIs>(apiPreference));
|
||||||
|
if (found)
|
||||||
|
{
|
||||||
|
CV_LOG_WARNING(NULL, cv::format("VIDEOIO(%s): backend is generally available "
|
||||||
|
"but can't be used to capture by name",
|
||||||
|
cv::videoio_registry::getBackendName(static_cast<VideoCaptureAPIs>(apiPreference)).c_str()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (throwOnFail)
|
if (throwOnFail)
|
||||||
{
|
{
|
||||||
CV_Error_(Error::StsError, ("could not open '%s'", filename.c_str()));
|
CV_Error_(Error::StsError, ("could not open '%s'", filename.c_str()));
|
||||||
@ -302,14 +313,25 @@ bool VideoCapture::open(int cameraNum, int apiPreference, const std::vector<int>
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
CV_CAPTURE_LOG_DEBUG(NULL,
|
CV_CAPTURE_LOG_DEBUG(NULL,
|
||||||
cv::format("VIDEOIO(%s): backend is not available "
|
cv::format("VIDEOIO(%s): backend is not available "
|
||||||
"(plugin is missing, or can't be loaded due "
|
"(plugin is missing, or can't be loaded due "
|
||||||
"dependencies or it is not compatible)",
|
"dependencies or it is not compatible)",
|
||||||
info.name));
|
info.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(apiPreference != CAP_ANY)
|
||||||
|
{
|
||||||
|
bool found = cv::videoio_registry::isBackendBuiltIn(static_cast<VideoCaptureAPIs>(apiPreference));
|
||||||
|
if (found)
|
||||||
|
{
|
||||||
|
CV_LOG_WARNING(NULL, cv::format("VIDEOIO(%s): backend is generally available "
|
||||||
|
"but can't be used to capture by index",
|
||||||
|
cv::videoio_registry::getBackendName(static_cast<VideoCaptureAPIs>(apiPreference)).c_str()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (throwOnFail)
|
if (throwOnFail)
|
||||||
{
|
{
|
||||||
CV_Error_(Error::StsError, ("could not open camera %d", cameraNum));
|
CV_Error_(Error::StsError, ("could not open camera %d", cameraNum));
|
||||||
|
Loading…
Reference in New Issue
Block a user