mirror of
https://github.com/lostjared/Acid.Cam.v2.Qt.git
synced 2025-12-16 20:00:01 +01:00
goto frame is working
This commit is contained in:
@@ -280,6 +280,7 @@ void Playback::run() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Playback::~Playback() {
|
||||
mutex.lock();
|
||||
stop = true;
|
||||
@@ -298,6 +299,22 @@ void Playback::setFrameIndex(const long &index) {
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
bool Playback::getFrame(QImage &img, const int &index) {
|
||||
QImage image;
|
||||
setFrameIndex(index);
|
||||
mutex.lock();
|
||||
cv::Mat frame;
|
||||
if(mode == MODE_VIDEO && capture.read(frame)) {
|
||||
cv::cvtColor(frame, rgb_frame, CV_BGR2RGB);
|
||||
img = QImage((const unsigned char*)(rgb_frame.data), rgb_frame.cols, rgb_frame.rows, QImage::Format_RGB888);
|
||||
mutex.unlock();
|
||||
setFrameIndex(index);
|
||||
return true;
|
||||
}
|
||||
mutex.unlock();
|
||||
return false;
|
||||
}
|
||||
|
||||
void Playback::enableRepeat(bool re) {
|
||||
mutex.lock();
|
||||
repeat_video = re;
|
||||
|
||||
Reference in New Issue
Block a user