diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 10:41:32 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 10:41:32 -0500 |
commit | c53429a6968563f72f8b334486d6dd1f0de75ecb (patch) | |
tree | 6c6b3c6d09f776dc7a54635584bfa79a3af71ed9 /src/videopreview.h | |
download | mplayerthumbs-c53429a6968563f72f8b334486d6dd1f0de75ecb.tar.gz mplayerthumbs-c53429a6968563f72f8b334486d6dd1f0de75ecb.zip |
Initial import of mplayerthumbs 0.5b sources
Diffstat (limited to 'src/videopreview.h')
-rw-r--r-- | src/videopreview.h | 62 |
1 files changed, 62 insertions, 0 deletions
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 <marco@kmobiletools.org> + + 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 <qstring.h> +#include <qcstring.h> + +#include <qpixmap.h> +#include <kio/thumbcreator.h> + +class QProcess; +class QCString; +class KTempDir; +class KRandomSequence; +class KPixmapSplitter; +#include <qobject.h> + +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 |