fixed setting of a video

This commit is contained in:
Jared Bruni
2021-09-05 10:31:19 -07:00
parent b3f1e568f6
commit 5bae2eb692
3 changed files with 15 additions and 4 deletions

View File

@@ -137,12 +137,11 @@ void ImageWindow::video_Set() {
std::string vname = file_name.toStdString();
ac::v_cap.open(vname);
if(ac::v_cap.isOpened() == false) {
if(playback->openVideo(vname) == true) {
lbl_video->setText("File Opened and Active");
} else {
QMessageBox::information(this, "Error could not open file", "File not supported");
return;
}
lbl_video->setText("File Opened and Active");
}
void ImageWindow::video_Clr() {

View File

@@ -117,6 +117,17 @@ bool Playback::setVideoCamera(std::string name, int type, int device, int res, c
return true;
}
bool Playback::openVideo(std::string vname) {
mutex.lock();
ac::v_cap.open(vname);
if(ac::v_cap.isOpened() == false) {
mutex.unlock();
return false;
}
mutex.unlock();
return true;
}
void Playback::setVector(std::vector<FilterValue> v) {
mutex.lock();
// here:

View File

@@ -76,6 +76,7 @@ public:
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);
bool openVideo(std::string video);
bool isStopped() const;
void run();
void Clear();