aboutsummaryrefslogtreecommitdiffstats
path: root/gui/fpgaviewwidget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gui/fpgaviewwidget.cc')
-rw-r--r--gui/fpgaviewwidget.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc
index 8730c9d9..f1494452 100644
--- a/gui/fpgaviewwidget.cc
+++ b/gui/fpgaviewwidget.cc
@@ -329,14 +329,17 @@ void FPGAViewWidget::paintGL()
if (movieCounter == currentFrameSkip) {
QMutexLocker lock(&rendererArgsLock_);
movieCounter = 0;
- currentMovieFrame++;
-
QImage image = grabFramebuffer();
- QString number = QString("movie_%1.png").arg(currentMovieFrame, 5, 10, QChar('0'));
+ if (!movieSkipSame || movieLastImage != image) {
+ currentMovieFrame++;
+
+ QString number = QString("movie_%1.png").arg(currentMovieFrame, 5, 10, QChar('0'));
- QFileInfo fileName = QFileInfo(QDir(movieDir), number);
- QImageWriter imageWriter(fileName.absoluteFilePath(), "png");
- imageWriter.write(image);
+ QFileInfo fileName = QFileInfo(QDir(movieDir), number);
+ QImageWriter imageWriter(fileName.absoluteFilePath(), "png");
+ imageWriter.write(image);
+ movieLastImage = image;
+ }
} else {
movieCounter++;
}
@@ -599,9 +602,11 @@ void FPGAViewWidget::renderLines(void)
}
}
-void FPGAViewWidget::movieStart(QString dir, long frameSkip)
+void FPGAViewWidget::movieStart(QString dir, long frameSkip, bool skipSame)
{
QMutexLocker locker(&rendererArgsLock_);
+ movieLastImage = QImage();
+ movieSkipSame = skipSame;
movieDir = dir;
currentMovieFrame = 0;
movieCounter = 0;