1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

VideoCapture: add exception error mode similar to fstream + test

This commit is contained in:
Pavel Rojtberg
2018-06-12 15:21:33 +02:00
parent 64168fc20a
commit 15bb0b86ce
3 changed files with 59 additions and 7 deletions
@@ -782,9 +782,18 @@ public:
*/
CV_WRAP String getBackendName() const;
/** Switches exceptions mode
*
* methods raise exceptions if not successful instead of returning an error code
*/
CV_WRAP void setExceptionMode(bool enable) { throwOnFail = enable; }
/// query if exception mode is active
CV_WRAP bool getExceptionMode() { return throwOnFail; }
protected:
Ptr<CvCapture> cap;
Ptr<IVideoCapture> icap;
bool throwOnFail;
};
class IVideoWriter;