aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-09-08 16:04:07 -0400
committerKen Moore <ken@ixsystems.com>2017-09-08 16:04:07 -0400
commit6507d181b3a6c59dd374aa6890a4a43b9e516d5b (patch)
tree4778fa553204f175a72f6fe05c7c6c0866a4800c /src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h
parentPut a failsafe in for overwriting default apps: (diff)
parentSet default tooltip to be translateable in case issues arise (diff)
downloadlumina-6507d181b3a6c59dd374aa6890a4a43b9e516d5b.tar.gz
lumina-6507d181b3a6c59dd374aa6890a4a43b9e516d5b.tar.bz2
lumina-6507d181b3a6c59dd374aa6890a4a43b9e516d5b.zip
Merge branch 'master' of github.com:trueos/lumina
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h')
-rw-r--r--src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h b/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h
new file mode 100644
index 00000000..45b6ca58
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-fm-dev/widgets/vidnail.h
@@ -0,0 +1,60 @@
+#ifndef VIDNAIL_H
+#define VIDNAIL_H
+
+extern "C" {
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+}
+
+class VidNail;
+
+struct vFrame {
+ vFrame() : *width(0), *height(0) {}
+ vFrame(int *width, int *height : width(width), height(height) {}
+ int *width;
+ int *height;
+};
+
+public:
+
+ QString getCodec();
+ void goto(int timeInSeconds);
+ void readVideoFrame();
+ void getScaledVideoFrame(int scaledSize, vFrame& vFrame);
+
+ int getWidth();
+ int getHeight();
+ int getLength();
+
+ void makeThumbnail(const QString& videoFile, QImage &image);
+ void setThumbnailSize(int size);
+ void setPercentage(int percent);
+ void setTime(const QString& Time);
+
+ void writeVidNail(vFrame& frame, QImage& image);
+
+
+ private:
+
+ bool readVideoPacket();
+ bool getVideoPacket();
+ void scaleVideo(int scaledSize, int& scaledWidth, int& scaledHeight);
+ void createVFrame(AVFrame *vFrame, quint8 *frameBuffer, int width, int height);
+ void calculateDimensions(int size);
+ void generateThumbnail(const QString& videoFile, ImageWriter& imageWriter, QImage& image);
+ QString getMimeType(const QString& videoFile);
+ QString getExtension(const QString& videoFilename);
+
+
+ private:
+ int videoStream;
+ AVFormatContext *inputVideoFormatContext;
+ AVCodecContext *inputvideoCodecContext;
+ AVCodec *inputVideoCodec;
+ AVStream *inputVideoStream;
+ AVFrame *inputVideoFrame;
+ quint8 *inputFrameBuffer;
+ AVPacket *videoPacket;
+
+
+#endif // VIDNAIL_H
bgstack15