From c53429a6968563f72f8b334486d6dd1f0de75ecb Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 24 Jul 2013 10:41:32 -0500 Subject: Initial import of mplayerthumbs 0.5b sources --- src/videopreview.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/videopreview.h (limited to 'src/videopreview.h') diff --git a/src/videopreview.h b/src/videopreview.h new file mode 100644 index 0000000..cb4f255 --- /dev/null +++ b/src/videopreview.h @@ -0,0 +1,62 @@ +/*************************************************************************** + Copyright (C) 2006 + by Marco Gulino + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + ***************************************************************************/ + +#ifndef _videopreview_H_ +#define _videopreview_H_ + +#include +#include + +#include +#include + +class QProcess; +class QCString; +class KTempDir; +class KRandomSequence; +class KPixmapSplitter; +#include + +class VideoPreview : public QObject, public ThumbCreator +{ +Q_OBJECT + public: + VideoPreview(); + virtual ~VideoPreview(); + virtual bool create(const QString &path, int width, int height, QImage &img); + virtual Flags flags() const; + protected: + QPixmap getFrame(const QString &path, int flags); + static uint imageVariance(QImage image ); + private: + KPixmapSplitter *m_splitter; + char *m_data; + int m_dataSize; + QPixmap m_pixmap; + QProcess *mplayerprocess; + QStringList customargs; + KTempDir *tmpdir; + KRandomSequence *rand; + QString playerBin; + enum frameflags { framerandom=0x1, framestart=0x2, frameend=0x4 }; + struct { int towidth; int toheight; int fps; int seconds; } fileinfo; +}; + +#endif -- cgit v1.2.1