enable fence sync objects because they are needed by video player.
[harmattan/cameraplus] / declarative / camera.cpp
index 07f3801..f4e4a63 100644 (file)
@@ -1,7 +1,7 @@
 /*!
  * This file is part of CameraPlus.
  *
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * 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
@@ -48,6 +48,7 @@
 
 #include "videomute.h"
 #include "videotorch.h"
+#include "cameraconfig.h"
 
 Camera::Camera(QDeclarativeItem *parent) :
   QDeclarativeItem(parent),
@@ -71,7 +72,10 @@ Camera::Camera(QDeclarativeItem *parent) :
   m_autoFocus(0),
   m_roi(0),
   m_videoMute(0),
-  m_videoTorch(0) {
+  m_videoTorch(0),
+  m_config(new CameraConfig(this)) {
+
+  m_config->componentComplete();
 
   QObject::connect(m_vf, SIGNAL(renderAreaChanged()), this, SIGNAL(renderAreaChanged()));
   QObject::connect(m_vf, SIGNAL(videoResolutionChanged()), this, SIGNAL(videoResolutionChanged()));
@@ -194,7 +198,9 @@ QVariant Camera::deviceId() const {
 void Camera::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry) {
   QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
 
-  m_vf->setGeometry(newGeometry);
+  // TODO: seems setting geometry breaks rendering somehow
+  //  m_vf->setGeometry(newGeometry);
+  m_vf->resize(newGeometry.size());
 }
 
 QtCamDevice *Camera::device() const {
@@ -437,3 +443,7 @@ bool Camera::isRenderingEnabled() const {
 void Camera::setRenderingEnabled(bool enabled) {
   m_vf->setRenderingEnabled(enabled);
 }
+
+CameraConfig *Camera::cameraConfig() const {
+  return m_config;
+}