mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-07 15:30:03 +01:00
fixed bug when switching between webcams
This commit is contained in:
@@ -51,13 +51,13 @@ bool Playback::setVideoCamera(int device, int res, cv::VideoWriter wr, bool reco
|
|||||||
mode = MODE_CAMERA;
|
mode = MODE_CAMERA;
|
||||||
device_num = device;
|
device_num = device;
|
||||||
mutex.lock();
|
mutex.lock();
|
||||||
#if defined(__linux__) || defined(__APPLE__)
|
//#if defined(__linux__) || defined(__APPLE__)
|
||||||
capture.open(device);
|
capture.open(device);
|
||||||
if(!capture.isOpened()) {
|
if(!capture.isOpened()) {
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
/*#else
|
||||||
if(!capture.isOpened()) {
|
if(!capture.isOpened()) {
|
||||||
capture.open(device);
|
capture.open(device);
|
||||||
if(!capture.isOpened()) {
|
if(!capture.isOpened()) {
|
||||||
@@ -65,8 +65,7 @@ bool Playback::setVideoCamera(int device, int res, cv::VideoWriter wr, bool reco
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif*/
|
||||||
|
|
||||||
recording = record;
|
recording = record;
|
||||||
writer = wr;
|
writer = wr;
|
||||||
int res_w = 0, res_h = 0, ores_w = 640, ores_h = 480;
|
int res_w = 0, res_h = 0, ores_w = 640, ores_h = 480;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#ifndef _QT_HEADERS__
|
#ifndef _QT_HEADERS__
|
||||||
#define _QT_HEADERS__
|
#define _QT_HEADERS__
|
||||||
#define ac_version "v1.52.0"
|
#define ac_version "v1.53.0"
|
||||||
#include<QApplication>
|
#include<QApplication>
|
||||||
#include<QMainWindow>
|
#include<QMainWindow>
|
||||||
#include<QDialog>
|
#include<QDialog>
|
||||||
|
|||||||
Reference in New Issue
Block a user