summaryrefslogtreecommitdiff
path: root/playback/player/qt/imagesample.h
diff options
context:
space:
mode:
authorAlexandre Moreno <alexmorenocano@gmail.com>2015-11-02 01:48:08 +0800
committerSebastian Dröge <sebastian@centricular.com>2015-11-02 09:28:51 +0200
commite4ae2c3c7bfe14e58e2b73f0c20743dd7ba4bbc2 (patch)
tree163afefa698058e7ff15c916801a2a757c1a9348 /playback/player/qt/imagesample.h
parent8853575547c58e379e1fff17858147fc19039c5f (diff)
playback/player: qt: add new qml item to render media info sample
when video is not available it will try to display the sample image returned by media info object.
Diffstat (limited to 'playback/player/qt/imagesample.h')
-rw-r--r--playback/player/qt/imagesample.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/playback/player/qt/imagesample.h b/playback/player/qt/imagesample.h
new file mode 100644
index 0000000..917bb24
--- /dev/null
+++ b/playback/player/qt/imagesample.h
@@ -0,0 +1,46 @@
+/* GStreamer
+ *
+ * Copyright (C) 2015 Alexandre Moreno <alexmorenocano@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef IMAGESAMPLE_H
+#define IMAGESAMPLE_H
+
+#include <QObject>
+#include <QQuickPaintedItem>
+#include <QImage>
+#include <QPainter>
+#include "player.h"
+
+class ImageSample : public QQuickPaintedItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QImage sample READ sample WRITE setSample)
+public:
+ ImageSample();
+ ~ImageSample();
+ void paint(QPainter *painter);
+
+ const QImage &sample() const;
+ void setSample(const QImage &sample);
+
+private:
+ QImage sample_;
+};
+
+#endif // IMAGESAMPLE_H