This commit is contained in:
Jared Bruni
2021-09-17 04:30:57 -07:00
parent b92765c78b
commit eba66a69ba
3 changed files with 13 additions and 3 deletions

View File

@@ -166,8 +166,6 @@ void ImageWindow::video_Set() {
}
void ImageWindow::video_Clr() {
if(ac::v_cap.isOpened()) {
ac::v_cap.release();
if(playback->VideoRelease())
lbl_video->setText("Video closed..");
}
}

View File

@@ -29,6 +29,17 @@ Playback::Playback(QObject *parent) : QThread(parent) {
filter_map_ex = filter_map;
}
bool Playback::VideoRelease() {
bool ret = false;
mutex.lock();
if(ac::v_cap.isOpened()) {
ac::v_cap.release();
ret = true;
}
mutex.unlock();
return ret;
}
void Playback::setCustomCycle(bool b) {
_custom_cycle = b;
_custom_cycle_index = 0;

View File

@@ -74,6 +74,7 @@ public:
void Play();
void Stop();
void Release();
bool VideoRelease();
void SetFlip(bool f1, bool f2);
void setVideo(cv::VideoCapture cap, cv::VideoWriter writer, bool record, bool record_png);
bool setVideoCamera(std::string name, int type, int device, int res, cv::VideoWriter writer, bool record);