Don't reuse file names
[harmattan/cameraplus] / lib / qtcamviewfinderrenderermeego.h
index 0ccfbf6..d7ec2b3 100644 (file)
@@ -1,5 +1,25 @@
 // -*- c++ -*-
 
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
 #ifndef QT_CAM_VIEWFINDER_RENDERER_MEEGO_H
 #define QT_CAM_VIEWFINDER_RENDERER_MEEGO_H
 
@@ -8,6 +28,7 @@
 #include <QMutex>
 #include <QMatrix4x4>
 #include <GLES2/gl2.h>
+#include <EGL/egl.h>
 
 class QGLShaderProgram;
 
@@ -19,11 +40,16 @@ public:
 
   ~QtCamViewfinderRendererMeeGo();
 
-  virtual void paint(QPainter *painter);
+  virtual void paint(const QMatrix4x4& matrix, const QRectF& viewport);
   virtual void resize(const QSizeF& size);
   virtual void reset();
   virtual GstElement *sinkElement();
 
+  QRectF renderArea();
+  QSizeF videoResolution();
+
+  bool needsNativePainting();
+
 private slots:
   void setVideoSize(const QSizeF& size);
 
@@ -34,9 +60,8 @@ private:
 
   void calculateProjectionMatrix(const QRectF& rect);
   void createProgram();
-  void paintFrame(QPainter *painter, int frame);
+  void paintFrame(const QMatrix4x4& matrix, int frame);
   void calculateCoords();
-  QRectF renderArea();
 
   QtCamConfig *m_conf;
   GstElement *m_sink;
@@ -52,6 +77,7 @@ private:
   QSizeF m_size;
   QSizeF m_videoSize;
   QRectF m_renderArea;
+  EGLDisplay m_dpy;
 };
 
 #endif /* QT_CAM_VIEWFINDER_RENDERER_MEEGO_H */