summaryrefslogtreecommitdiffstats
path: root/helper.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-12-16 19:46:34 +0100
committerArno <am@disconnect.de>2010-12-16 19:46:34 +0100
commit69bdaf5d1cdf2cb6a5da8371658e1c3995a71cfb (patch)
treee307f53d30b4ad59f6ab592c97adcf58008a8c6c /helper.cpp
parentc7bffca4cfc626c62c0eae6bc6b06d92cb2a8340 (diff)
downloadSheMov-69bdaf5d1cdf2cb6a5da8371658e1c3995a71cfb.tar.gz
SheMov-69bdaf5d1cdf2cb6a5da8371658e1c3995a71cfb.tar.bz2
SheMov-69bdaf5d1cdf2cb6a5da8371658e1c3995a71cfb.zip
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.
Diffstat (limited to 'helper.cpp')
-rw-r--r--helper.cpp21
1 files changed, 0 insertions, 21 deletions
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();
}