worked around bug for MacOS X, now instead of closing camera, just leaves it open then next time it resizes to new resolution.

This commit is contained in:
lostjared
2017-03-05 13:29:14 -08:00
parent 555bb342c6
commit 977d4fe63d
6 changed files with 402 additions and 22 deletions

View File

@@ -2,9 +2,10 @@
#define __PLAYBACK_WINDOW_H__
#include "qtheaders.h"
#include<atomic>
enum VideoMode { MODE_CAMERA = 0, MODE_VIDEO };
class Playback : public QThread {
Q_OBJECT
private:
@@ -21,6 +22,7 @@ private:
QImage img;
std::vector<std::pair<int, int>> current;
bool isPaused, isStep;
VideoMode mode;
public:
Playback(QObject *parent = 0);
~Playback();
@@ -28,6 +30,7 @@ public:
void Stop();
void Release();
void setVideo(cv::VideoCapture cap, cv::VideoWriter writer, bool record);
void setVideoCamera(int device, int res, cv::VideoWriter writer, bool record);
bool isStopped() const;
void run();
void msleep(int ms);