mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-17 04:10:01 +01:00
added test to for when initialization fails
This commit is contained in:
@@ -29,13 +29,17 @@ void Playback::setVideo(cv::VideoCapture cap, cv::VideoWriter wr, bool record) {
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
void Playback::setVideoCamera(int device, int res, cv::VideoWriter wr, bool record) {
|
||||
bool Playback::setVideoCamera(int device, int res, cv::VideoWriter wr, bool record) {
|
||||
mode = MODE_CAMERA;
|
||||
mutex.lock();
|
||||
if(capture.isOpened()) {
|
||||
|
||||
} else {
|
||||
capture.open(device);
|
||||
if(!capture.isOpened()) {
|
||||
mutex.unlock();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
recording = record;
|
||||
writer = wr;
|
||||
@@ -63,6 +67,7 @@ void Playback::setVideoCamera(int device, int res, cv::VideoWriter wr, bool reco
|
||||
capture.set(CV_CAP_PROP_FRAME_HEIGHT, res_h);
|
||||
}
|
||||
mutex.unlock();
|
||||
return true;
|
||||
}
|
||||
|
||||
void Playback::setVector(std::vector<std::pair<int, int>> v) {
|
||||
|
||||
Reference in New Issue
Block a user