1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 14:53:03 +04:00

Merge pull request #22939 from stopmosk:21826-python-bindings-for-videocapturewaitany

Add Python bindings for VideoCapture::waitAny #21826

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Sergei Shutov
2022-12-14 21:15:02 +02:00
committed by GitHub
parent 81aaca8c04
commit 8bd17163c7
6 changed files with 67 additions and 1 deletions
+24
View File
@@ -444,6 +444,30 @@ PyObject* pyopencv_from(const int& value)
// --- int64
template<>
bool pyopencv_to(PyObject* obj, int64& value, const ArgInfo& info)
{
if (!obj || obj == Py_None)
{
return true;
}
if (isBool(obj))
{
failmsg("Argument '%s' must be integer, not bool", info.name);
return false;
}
if (PyArray_IsIntegerScalar(obj))
{
value = PyLong_AsLongLong(obj);
}
else
{
failmsg("Argument '%s' is required to be an integer", info.name);
return false;
}
return !CV_HAS_CONVERSION_ERROR(value);
}
template<>
PyObject* pyopencv_from(const int64& value)
{