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

Merge pull request #15100 from Volskig:cam_multiplexing_function_v

Implement Camera Multiplexing API

* IdideoCapture + two wrong function

function waitAny

Add errors catcher

Stub for Python added.

Sifting warnings

One test added

Two tests for camera and Perf tests added

* Perf sync and async tests for waitAny() added, waitAnyInterior() deleted, getDeviceHandle() deleted

* Variable OPENCV_TEST_CAMERA_LIST added

* Without fps set

* ASSERT_FAILED for environment variable

* Perf tests is DISABLED_

* --Trailing whitespace

* Return false from cap.cpp deleted

* Two functions deleted from interface, +range for, +environment variable in test_camera

* Space deleted

* printf deleted, perror added

* CV_WRAP deleted, cv2 cleared from stubs

* -- space

* default timeout added

* @param changed

* place of waitAny changed

* --whitespace

* ++function description

* function description changed

* revert unused changes

* videoio: rework API for VideoCapture::waitAny()
This commit is contained in:
Maxim Pashchenkov
2019-11-15 19:42:12 +03:00
committed by Alexander Alekhin
parent ac2dc29525
commit 1acadd363b
7 changed files with 339 additions and 2 deletions
@@ -581,6 +581,9 @@ enum { CAP_PROP_IMAGES_BASE = 18000,
class IVideoCapture;
//! @cond IGNORED
namespace internal { class VideoCapturePrivateAccessor; }
//! @endcond IGNORED
/** @brief Class for video capturing from video files, image sequences or cameras.
@@ -790,10 +793,34 @@ public:
/// query if exception mode is active
CV_WRAP bool getExceptionMode() { return throwOnFail; }
/** @brief Wait for ready frames from VideoCapture.
@param streams input video streams
@param readyIndex stream indexes with grabbed frames (ready to use .retrieve() to fetch actual frame)
@param timeoutNs number of nanoseconds (0 - infinite)
@return `true` if streamReady is not empty
@throws Exception %Exception on stream errors (check .isOpened() to filter out malformed streams) or VideoCapture type is not supported
The primary use of the function is in multi-camera environments.
The method fills the ready state vector, grabbs video frame, if camera is ready.
After this call use VideoCapture::retrieve() to decode and fetch frame data.
*/
static /*CV_WRAP*/
bool waitAny(
const std::vector<VideoCapture>& streams,
CV_OUT std::vector<int>& readyIndex,
int64 timeoutNs = 0);
protected:
Ptr<CvCapture> cap;
Ptr<IVideoCapture> icap;
bool throwOnFail;
friend class internal::VideoCapturePrivateAccessor;
};
class IVideoWriter;