From 69bdaf5d1cdf2cb6a5da8371658e1c3995a71cfb Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 16 Dec 2010 19:46:34 +0100 Subject: Cache for frame grabbing Implemetented a cache for hovering over movies, saving the pictures from ffmpeg. For that SmGlobals got a new member *frameCache, handling all the dirty file access. I first tried to implement it as a helper, but that produced too much duplicate code. --- helper.cpp | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'helper.cpp') diff --git a/helper.cpp b/helper.cpp index 126b83d..6cb5cd2 100644 --- a/helper.cpp +++ b/helper.cpp @@ -167,27 +167,6 @@ namespace Helper { return retval; } - const QPixmap grabFrame(const QString &file, QString when){ - QSettings s; - QString ffMpegPath = s.value("paths/ffmpeg").toString(); - if(when.isEmpty()){ - when = s.value("ui/grabframe", "00:00:00").toString(); - } - QString tmptmp = QString("%1/smhover-XXXXXX.png").arg(QDir::tempPath()); - QTemporaryFile tmpPic(tmptmp); - if(tmpPic.open()){ - QStringList ffMpegArgs = QStringList() << "-vframes" << "1" << "-ss" << when << "-i" << file << "-y" << tmpPic.fileName(); - QProcess ffmpeg; - ffmpeg.start(ffMpegPath, ffMpegArgs); - if(!ffmpeg.waitForStarted()){ - return QPixmap(); - } - ffmpeg.waitForFinished(); - return QPixmap(tmpPic.fileName()); - } - return QPixmap(); - } - bool SortFileInfoList::operator ()(const QFileInfo &lhs, const QFileInfo &rhs) const { return lhs.fileName().toLower() < rhs.fileName().toLower(); } -- cgit v1.2.3-70-g09d2