I have made the following changes intended for : nemo:devel:apps / meego-handset-camera
Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below. https://build.merproject.org//request/show/100 Thank You, Juho Hämäläinen [This message was auto-generated] --- Request # 100: Messages from BOSS: State: review at 2013-03-26T14:58:41 by cibot Reviews: accepted by cibot : Prechecks succeeded. new for nemo:devel:apps : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:jhamalai:branches:nemo:devel:apps / meego-handset-camera -> nemo:devel:apps / meego-handset-camera changes files: -------------- --- meego-handset-camera.changes +++ meego-handset-camera.changes @@ -0,0 +1,3 @@ +* Tue Mar 26 2013 Juho Hämäläinen <[email protected]> - 1.0.7 +- Disable resource handling and let qt-mobility handle resources. + new: ---- use-qcamera-resource-handling.patch spec files: ----------- --- meego-handset-camera.spec +++ meego-handset-camera.spec @@ -18,6 +18,7 @@ Source1: camera-screenshot.png Source100: meego-handset-camera.yaml Patch0: 0001-Removed-Home-and-Quit-buttons-fixes-NEMO-111.patch +Patch1: use-qcamera-resource-handling.patch Requires: gst-plugins-camera Requires: gstreamer >= 0.10.32 Requires: libdeclarative-multimedia @@ -27,7 +28,6 @@ BuildRequires: pkgconfig(QtDeclarative) BuildRequires: pkgconfig(QtNetwork) BuildRequires: pkgconfig(QtMultimediaKit) -BuildRequires: pkgconfig(libresourceqt1) BuildRequires: qt-devel-tools BuildRequires: desktop-file-utils @@ -42,6 +42,8 @@ # 0001-Removed-Home-and-Quit-buttons-fixes-NEMO-111.patch %patch0 -p1 +# use-qcamera-resource-handling.patch +%patch1 -p1 # >> setup # << setup other changes: -------------- ++++++ meego-handset-camera.yaml --- meego-handset-camera.yaml +++ meego-handset-camera.yaml @@ -10,6 +10,7 @@ - camera-screenshot.png Patches: - 0001-Removed-Home-and-Quit-buttons-fixes-NEMO-111.patch + - use-qcamera-resource-handling.patch SourcePrefix: "%{name}-%{version}" Description: | meego-handset-camera provides very basic camera features such as still capture, @@ -26,7 +27,6 @@ - QtDeclarative - QtNetwork - QtMultimediaKit - - libresourceqt1 PkgBR: - qt-devel-tools Configure: none ++++++ use-qcamera-resource-handling.patch (new) --- use-qcamera-resource-handling.patch +++ use-qcamera-resource-handling.patch @@ -0,0 +1,286 @@ +From bb1b54bd30dbc52b2ddb89e8ebccffbbed19183d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Juho=20H=C3=A4m=C3=A4l=C3=A4inen?= <[email protected]> +Date: Thu, 14 Mar 2013 16:11:13 +0200 +Subject: [PATCH] Use QCamera resource handling. + +CUSTOM_RESOURCES define can be enabled to use +local resource policy handling instead of +qt-mobility one. +--- + declarative-camera.pro | 13 ++++++++++--- + meegocamera.cpp | 10 ++++++++++ + meegocamera.h | 6 ++++++ + qdeclarativecamera.cpp | 21 +++++++++++++++++++++ + qdeclarativecamera_p.h | 6 ++++++ + 5 files changed, 53 insertions(+), 3 deletions(-) + +diff --git a/declarative-camera.pro b/declarative-camera.pro +index 0356e3b..1937237 100644 +--- a/declarative-camera.pro ++++ b/declarative-camera.pro +@@ -1,8 +1,15 @@ + TEMPLATE=app + +-CONFIG += mobility link_pkgconfig +- +-PKGCONFIG += libresourceqt1 ++CONFIG += mobility ++ ++# If CUSTOM_RESOURCES is set implement resource policy handling ++# in meego-handset-camera. Otherwise let qt-mobility handle ++# resources. ++count(CUSTOM_RESOURCES, 1) { ++ CONFIG += link_pkgconfig ++ PKGCONFIG += libresourceqt1 ++ DEFINES += CUSTOM_RESOURCES ++} + + + DEFINES+=Q_WS_MEEGO +diff --git a/meegocamera.cpp b/meegocamera.cpp +index 6527235..4e847ac 100644 +--- a/meegocamera.cpp ++++ b/meegocamera.cpp +@@ -64,6 +64,7 @@ MeegoCamera::MeegoCamera(bool visible): QObject(), + + //qDebug() << Q_FUNC_INFO << "gpio device opened"; + ++#ifdef CUSTOM_RESOURCES + m_cameraForegroundResources = new ResourcePolicy::ResourceSet("camera", this); + m_cameraForegroundResources->setAlwaysReply(); + +@@ -88,6 +89,9 @@ MeegoCamera::MeegoCamera(bool visible): QObject(), + m_cameraBackgroundResources->addResource(ResourcePolicy::SnapButtonType); + + //qDebug() << Q_FUNC_INFO << "volume key resource connected"; ++#else ++ m_resourcesGranted = true; ++#endif + + m_coverState = !getSwitchState(m_gpioFile, 9); + +@@ -101,8 +105,10 @@ MeegoCamera::~MeegoCamera() + { + //qDebug() << Q_FUNC_INFO; + ++#ifdef CUSTOM_RESOURCES + m_cameraForegroundResources->release(); + m_cameraBackgroundResources->release(); ++#endif + + //qDebug() << Q_FUNC_INFO << "volume ker resource released"; + +@@ -289,6 +295,7 @@ bool MeegoCamera::isVideoCaptureSupported() const + void MeegoCamera::updateResources() + { + ++#ifdef CUSTOM_RESOURCES + if(m_uiVisible && m_view && m_view->isActiveWindow()) { + m_cameraBackgroundResources->release(); + m_cameraForegroundResources->acquire(); +@@ -296,6 +303,7 @@ void MeegoCamera::updateResources() + m_cameraForegroundResources->release(); + m_cameraBackgroundResources->acquire(); + } ++#endif + + } + +@@ -380,6 +388,7 @@ void MeegoCamera::deleteImage() + QFile::remove( m_view->rootObject()->property("imagePath").toString()); + } + ++#ifdef CUSTOM_RESOURCES + void MeegoCamera::resourcesGranted(const QList<ResourcePolicy::ResourceType>& /*grantedOptionalResources*/) + { + m_resourcesGranted = true; +@@ -394,4 +403,5 @@ void MeegoCamera::lostResources() + { + m_resourcesGranted = false; + } ++#endif + +diff --git a/meegocamera.h b/meegocamera.h +index 0aa0a09..2281124 100644 +--- a/meegocamera.h ++++ b/meegocamera.h +@@ -10,7 +10,9 @@ + #include <linux/input.h> + #include <stdint.h> + #include <QtDeclarative/QDeclarativeView> ++#ifdef CUSTOM_RESOURCES + #include <policy/resource-set.h> ++#endif + + + #define SERVER_NAME "/tmp/meegocamera" +@@ -43,10 +45,12 @@ private slots: + void disconnected(); + void deleteImage(); + ++#ifdef CUSTOM_RESOURCES + // Resource Policy Framework callbacks + void resourcesGranted(const QList<ResourcePolicy::ResourceType>& grantedOptionalResources); + void resourcesDenied(); + void lostResources(); ++#endif + + private: + void HandleGpioKeyEvent(struct input_event &ev); +@@ -73,8 +77,10 @@ private: + + QDeclarativeView *m_view; + ++#ifdef CUSTOM_RESOURCES + ResourcePolicy::ResourceSet* m_cameraForegroundResources; + ResourcePolicy::ResourceSet* m_cameraBackgroundResources; ++#endif + bool m_resourcesGranted; + }; + +diff --git a/qdeclarativecamera.cpp b/qdeclarativecamera.cpp +index 5310362..7181656 100644 +--- a/qdeclarativecamera.cpp ++++ b/qdeclarativecamera.cpp +@@ -305,6 +305,7 @@ QDeclarativeCamera::QDeclarativeCamera(QDeclarativeItem *parent) : + m_exposure = m_camera->exposure(); + m_focus = m_camera->focus(); + ++#ifdef CUSTOM_RESOURCES + m_cameraResources = new ResourcePolicy::ResourceSet("camera", this); + m_cameraResources->setAlwaysReply(); + +@@ -314,6 +315,7 @@ QDeclarativeCamera::QDeclarativeCamera(QDeclarativeItem *parent) : + connect(m_cameraResources, SIGNAL(resourcesDenied()), this, SLOT(_q_resourcesDenied())); + connect(m_cameraResources, SIGNAL(lostResources()), this, SLOT(_q_lostResources())); + ++#endif + + connect(m_viewfinderItem, SIGNAL(nativeSizeChanged(QSizeF)), + this, SLOT(_q_nativeSizeChanged(QSizeF))); +@@ -360,7 +362,9 @@ QDeclarativeCamera::QDeclarativeCamera(QDeclarativeItem *parent) : + + QDeclarativeCamera::~QDeclarativeCamera() + { ++#ifdef CUSTOM_RESOURCES + m_cameraResources->release(); ++#endif + + if (m_isValid) { + m_camera->unload(); +@@ -463,6 +467,10 @@ void QDeclarativeCamera::setCameraState(QDeclarativeCamera::State state) + + QDeclarativeCamera::ResourcesStatus oldResStatus = m_resourcesStatus; + ++#ifndef CUSTOM_RESOURCES ++ m_resourcesStatus = QDeclarativeCamera::ResourcesGranted; ++#endif ++ + switch (state) { + case QDeclarativeCamera::ActiveState: + case QDeclarativeCamera::LoadedState: +@@ -475,14 +483,19 @@ void QDeclarativeCamera::setCameraState(QDeclarativeCamera::State state) + } + } else if(m_resourcesStatus == QDeclarativeCamera::ResourcesNotNeeded) { + m_resourcesStatus = QDeclarativeCamera::ResourcesAcquiring; ++#ifdef CUSTOM_RESOURCES + m_cameraResources->acquire(); ++#endif ++ + } + // else: In case of ResourcesAcquiring and ResourcesDenied nothing needs to be + // done here. Camera is set to correct state in resourcesGranted() method. + break; + case QDeclarativeCamera::UnloadedState: + m_camera->unload(); ++#ifdef CUSTOM_RESOURCES + m_cameraResources->release(); ++#endif + m_resourcesStatus = QDeclarativeCamera::ResourcesNotNeeded; + break; + } +@@ -1053,6 +1066,7 @@ void QDeclarativeCamera::setManualWhiteBalance(int colorTemp) const + } + } + ++#ifdef CUSTOM_RESOURCES + void QDeclarativeCamera::_q_resourcesGranted(const QList<ResourcePolicy::ResourceType>& grantedOptionalResources) + { + QDeclarativeCamera::ResourcesStatus oldStatus = m_resourcesStatus; +@@ -1089,7 +1103,9 @@ void QDeclarativeCamera::_q_resourcesGranted(const QList<ResourcePolicy::Resourc + if(oldStatus != m_resourcesStatus) + emit resourcesStatusChanged(m_resourcesStatus); + } ++#endif + ++#ifdef CUSTOM_RESOURCES + void QDeclarativeCamera::_q_resourcesDenied() + { + m_videoRecordingResourcesAvailable = false; +@@ -1101,14 +1117,18 @@ void QDeclarativeCamera::_q_resourcesDenied() + + m_camera->unload(); + } ++#endif + ++#ifdef CUSTOM_RESOURCES + void QDeclarativeCamera::_q_lostResources() + { + _q_resourcesDenied(); + } ++#endif + + void QDeclarativeCamera::updateResources() + { ++#ifdef CUSTOM_RESOURCES + QDeclarativeCamera::ResourcesStatus oldStatus = m_resourcesStatus; + + // Scale button reources for zooming +@@ -1170,6 +1190,7 @@ void QDeclarativeCamera::updateResources() + + // This will trigger new resources granted message if/when resources are available + m_cameraResources->update(); ++#endif + } + + /*! +diff --git a/qdeclarativecamera_p.h b/qdeclarativecamera_p.h +index 8129053..0177906 100644 +--- a/qdeclarativecamera_p.h ++++ b/qdeclarativecamera_p.h +@@ -51,7 +51,9 @@ + #include <qcameraimageprocessing.h> + #include <qcameraimagecapture.h> + #include <qmediarecorder.h> ++#ifdef CUSTOM_RESOURCES + #include <policy/resource-set.h> ++#endif + + + +@@ -364,10 +366,12 @@ private Q_SLOTS: + void _q_updateImageSettings(); + void _q_applyPendingState(); + ++#ifdef CUSTOM_RESOURCES + // Resource Policy Framework callbacks + void _q_resourcesGranted(const QList<ResourcePolicy::ResourceType>& grantedOptionalResources); + void _q_resourcesDenied(); + void _q_lostResources(); ++#endif + + private: + +@@ -400,7 +404,9 @@ private: + bool m_isStateSet; + bool m_isValid; + ++#ifdef CUSTOM_RESOURCES + ResourcePolicy::ResourceSet* m_cameraResources; ++#endif + ResourcesStatus m_resourcesStatus; + bool m_videoRecordingResourcesAvailable; + }; +-- +1.7.10.4 +
