[meego-commits] 15285: Changes to Trunk:Testing/qt-mobility
Fathi Boudra
no_reply at build.meego.com
Fri Mar 25 21:40:40 UTC 2011
Hi,
I have made the following changes to qt-mobility in project Trunk:Testing. Please review and accept ASAP.
Thank You,
Fathi Boudra
[This message was auto-generated]
---
Request #15285:
submit: devel:qt-mtf/qt-mobility(r147) -> Trunk:Testing/qt-mobility
Message:
* Fri Mar 25 2011 Joonas Tanskanen <joonas.tanskanen at sasken> - 1.2.0~beta0+git2726
- Fix meegocamera to support shutter/zoom buttons (BMC#14915)
- Fix incorrect still capture preview image resolution (BMC#14920)
State: new 2011-03-25T14:40:31 boudra
Comment: None
changes files:
--------------
--- qt-mobility.changes
+++ qt-mobility.changes
@@ -0,0 +1,4 @@
+* Fri Mar 25 2011 Joonas Tanskanen <joonas.tanskanen at sasken> - 1.2.0~beta0+git2726
+- Fix meegocamera to support shutter/zoom buttons (BMC#14915)
+- Fix incorrect still capture preview image resolution (BMC#14920)
+
old:
----
set_qml_camera_example_fullscreen.patch
new:
----
qml_camera_example_added_functionality.patch
spec files:
-----------
--- qt-mobility.spec
+++ qt-mobility.spec
@@ -34,7 +34,7 @@
Patch9: enable_xvoverlay_for_qml_camera.patch
%endif
Patch10: camera_api_added_functionality.patch
-Patch11: set_qml_camera_example_fullscreen.patch
+Patch11: qml_camera_example_added_functionality.patch
Requires: libqtconnectivity1 = %{version}
Requires: libqtcontacts1 = %{version}
Requires: libqtfeedback1 = %{version}
@@ -477,7 +477,7 @@
Requires: %{name} = %{version}-%{release}
Requires: meego-handset-icon-theme
Requires: gst-plugins-camera
-Requires: gstreamer >= 0.10.32-3.2
+Requires: gstreamer >= 0.10.32
%description -n meegocamera
This package contains the camera application for MeeGo handsets.
@@ -517,7 +517,7 @@
%endif
# camera_api_added_functionality.patch
%patch10 -p1
-# set_qml_camera_example_fullscreen.patch
+# qml_camera_example_added_functionality.patch
%patch11 -p1
# >> setup
# << setup
other changes:
--------------
++++++ camera_api_added_functionality.patch
--- camera_api_added_functionality.patch
+++ camera_api_added_functionality.patch
@@ -1,4 +1,6 @@
-Description: Adds possibility to set viewfinder and preview resolutions through
+Description: This patch adds new features to Camera API without cahnges to
+public header files. Changes are:
+Possibility to set viewfinder and preview resolutions through
Camera API. The change is implemented with dynamic properties to avoid changes to
public API headers.
Author: Joonas Tanskanen <joonas.tanskanen at sasken.com>
@@ -147,17 +149,14 @@
State m_pendingState;
--- a/plugins/multimedia/gstreamer/camerabin/camerabincontrol.cpp
+++ b/plugins/multimedia/gstreamer/camerabin/camerabincontrol.cpp
-@@ -61,8 +61,9 @@
+@@ -61,6 +61,7 @@
#include <stdlib.h>
#include <sys/mman.h>
#include <linux/videodev2.h>
+#include <QDynamicPropertyChangeEvent>
--//#define CAMEABIN_DEBUG 1
-+//#define CAMEABIN_DEBUG 1
+ //#define CAMEABIN_DEBUG 1
#define ENUM_NAME(c,e,v) (c::staticMetaObject.enumerator(c::staticMetaObject.indexOfEnumerator(e)).valueToKey((v)))
-
- CameraBinControl::CameraBinControl(CameraBinSession *session)
@@ -87,6 +88,14 @@ CameraBinControl::CameraBinControl(CameraBinSession *session)
SLOT(reloadLater()));
connect(m_session, SIGNAL(readyChanged(bool)),
@@ -368,14 +367,6 @@
if (m_videoInputDevice->deviceCount())
m_captureSession->setDevice(m_videoInputDevice->deviceName(m_videoInputDevice->selectedDevice()));
-@@ -194,7 +196,6 @@ QMediaControl *CameraBinService::requestControl(const char *name)
- if (qstrcmp(name,QImageEncoderControl_iid) == 0)
- return m_captureSession->imageEncodeControl();
-
--
- if (qstrcmp(name,QMediaContainerControl_iid) == 0)
- return m_captureSession->mediaContainerControl();
-
--- a/plugins/multimedia/gstreamer/camerabin/camerabinsession.cpp
+++ b/plugins/multimedia/gstreamer/camerabin/camerabinsession.cpp
@@ -63,7 +63,7 @@
@@ -383,7 +374,7 @@
#include <QtGui/qimage.h>
-//#define CAMERABIN_DEBUG 1
-+#define CAMERABIN_DEBUG 1
++//#define CAMERABIN_DEBUG 1
#define ENUM_NAME(c,e,v) (c::staticMetaObject.enumerator(c::staticMetaObject.indexOfEnumerator(e)).valueToKey((v)))
#ifdef Q_WS_MAEMO_5
@@ -391,7 +382,7 @@
#define VIDEO_SOURCE_CAPS_PROPERTY "inputcaps"
#define FILTER_CAPS_PROPERTY "filter-caps"
#define PREVIEW_CAPS_PROPERTY "preview-caps"
-+#define VIDEO_CAPTURE_FRAMERATE "video-capture-framerate"
++
#define IMAGE_DONE_SIGNAL "img-done"
#define CAPTURE_START "user-start"
@@ -399,7 +390,7 @@
#define VIDEO_SOURCE_CAPS_PROPERTY "video-source-caps"
#define FILTER_CAPS_PROPERTY "filter-caps"
#define PREVIEW_CAPS_PROPERTY "preview-caps"
-+#define VIDEO_CAPTURE_FRAMERATE "video-capture-framerate"
++
#define IMAGE_DONE_SIGNAL "image-done"
#define CAPTURE_START "capture-start"
@@ -437,7 +428,7 @@
if (!resolution.isEmpty()) {
qreal aspectRatio = qreal(resolution.width()) / resolution.height();
-@@ -339,19 +343,40 @@ void CameraBinSession::setupCaptureResolution()
+@@ -339,19 +343,56 @@ void CameraBinSession::setupCaptureResol
}
}
@@ -448,13 +439,29 @@
+
+ // Select preview caps
+ QString previewCapsString = PREVIEW_CAPS_4_3;
-+ QSize previewImageResolution = m_previewResolution;
-+ if(previewImageResolution.isEmpty() && !resolution.isEmpty() )
-+ previewImageResolution = QSize(resolution.width()*480/resolution.height(), 480);
-+
-+ if( !previewImageResolution.isEmpty() ) {
-+ previewCapsString = QString("video/x-raw-rgb, width = (int) %1, height = (int) %2")
-+ .arg(previewImageResolution.width()).arg(previewImageResolution.height());
++
++ // No point to define preview resolution if capture resolution is not defined
++ if( !resolution.isEmpty() )
++ {
++ QSize previewImageResolution = m_previewResolution;
++ if(previewImageResolution.isEmpty() ||
++ previewImageResolution.width() > resolution.width() ||
++ previewImageResolution.height() > resolution.height()) {
++ previewImageResolution = QSize(resolution.width()*480/resolution.height(), 480);
++ } else {
++ // Preview resolution must have the same aspect ratio than capture resolution
++ // Otherwise the preview image gets scaled and original aspect ratio is lost
++ qreal xRatio = (qreal)previewImageResolution.width() / (qreal)resolution.width();
++ qreal yRatio = (qreal)previewImageResolution.height() / (qreal)resolution.height();
++
++ if(xRatio > yRatio)
++ previewImageResolution.setWidth(resolution.width() * yRatio);
++ else if(xRatio < yRatio)
++ previewImageResolution.setHeight(resolution.height() * xRatio );
++ }
++
++ previewCapsString = QString("video/x-raw-rgb, width = (int) %1, height = (int) %2")
++ .arg(previewImageResolution.width()).arg(previewImageResolution.height());
+ }
+
+#if CAMERABIN_DEBUG
@@ -481,7 +488,7 @@
NULL);
}
-@@ -926,6 +951,45 @@ void CameraBinSession::processSavedImage(const QString &filename)
+@@ -926,6 +967,45 @@ void CameraBinSession::processSavedImage(const QString &filename)
Q_ARG(QString,filename));
}
@@ -606,12 +613,7 @@
QString videoCodecDescription(const QString &codecName) const;
--- a/src/multimedia/qcamera.cpp
+++ b/src/multimedia/qcamera.cpp
-@@ -257,10 +257,21 @@ void QCameraPrivate::initControls()
- supportedLocks = 0;
-
- if (service) {
-+
- control = qobject_cast<QCameraControl *>(service->requestControl(QCameraControl_iid));
+@@ -261,6 +262,16 @@ void QCameraPrivate::initControls()
locksControl = qobject_cast<QCameraLocksControl *>(service->requestControl(QCameraLocksControl_iid));
if (control) {
@@ -630,15 +632,7 @@
q->connect(control, SIGNAL(captureModeChanged(QCamera::CaptureMode)),
--- a/src/multimedia/qcameraimagecapture.cpp
+++ b/src/multimedia/qcameraimagecapture.cpp
-@@ -196,6 +196,7 @@ bool QCameraImageCapture::setMediaObject(QMediaObject *mediaObject)
-
- if (d->mediaObject) {
- if (d->control) {
-+
- disconnect(d->control, SIGNAL(imageExposed(int)),
- this, SIGNAL(imageExposed(int)));
- disconnect(d->control, SIGNAL(imageCaptured(int,QImage)),
-@@ -223,6 +224,13 @@ bool QCameraImageCapture::setMediaObject(QMediaObject *mediaObject)
+@@ -223,6 +224,13 @@ bool QCameraImageCapture::setMediaObject
d->encoderControl = qobject_cast<QImageEncoderControl *>(service->requestControl(QImageEncoderControl_iid));
if (d->control) {
++++++ qml_camera_example_added_functionality.patch (new)
--- qml_camera_example_added_functionality.patch
+++ qml_camera_example_added_functionality.patch
+Description: This patch adds new fatures to qml_camera example. The example is used
+as camera UI in MeeGo Handset 1.2 release. The changes are:
+Switch the app to fullscreen
+Set suitable resolution for preview images and viewfinder to avoid software scaling.
+Add support for shutter and zoom buttons.
+Author: Joonas Tanskanen <joonas.tanskanen at sasken.com>
+--- a/examples/declarative-camera/declarative-camera.qml
++++ b/examples/declarative-camera/declarative-camera.qml
+@@ -81,7 +81,7 @@ Rectangle {
+
+ Keys.onPressed : {
+ //return to capture mode if the shutter button is touched
+- if (event.key == Qt.Key_CameraFocus) {
++ if (event.key == Qt.Key_CameraFocus || event.key == Qt.Key_WebCam ) {
+ cameraUI.state = "PhotoCapture"
+ event.accepted = true;
+ }
+@@ -90,12 +90,15 @@ Rectangle {
+
+ Camera {
+ id: camera
++ objectName: "camera"
+ x : 0
+ y : 0
+- width : 640
+- height : 480
++ width : cameraUI.width
++ height : cameraUI.height
+ focus : visible //to receive focus and capture key events
+- //captureResolution : "640x480"
++
++ previewResolution : Qt.size(camera.width,camera.height)
++ viewfinderResolution : Qt.size(camera.width,camera.height)
+
+ flashMode: stillControls.flashMode
+ whiteBalanceMode: stillControls.whiteBalance
+@@ -106,6 +109,56 @@ Rectangle {
+ stillControls.previewAvailable = true
+ cameraUI.state = "PhotoPreview"
+ }
++
++
++ Keys.onPressed : {
++ if (event.key == Qt.Key_Camera || event.key == Qt.Key_WebCam ) {
++ // Capture button fully pressed
++ event.accepted = true;
++ // Take still image
++ camera.captureImage();
++ } else if (event.key == Qt.Key_ZoomIn || event.key == Qt.Key_F7 ) {
++ // Zoom in
++ event.accepted = true;
++ zoomOutAnimation.stop();
++ zoomInAnimation.duration = 4000 - camera.digitalZoom / Math.min(4.0, camera.maximumDigitalZoom) * 4000;
++ zoomInAnimation.start();
++ } else if (event.key == Qt.Key_ZoomOut || event.key == Qt.Key_F8 ) {
++ // Zoom out
++ event.accepted = true;
++ zoomInAnimation.stop();
++ zoomOutAnimation.duration = 4000 * camera.digitalZoom / Math.min(4.0, camera.maximumDigitalZoom);
++ zoomOutAnimation.start();
++ }
++ }
++
++ Keys.onReleased : {
++ if (event.key == Qt.Key_ZoomIn || event.key == Qt.Key_F7 ) {
++ // Zoom in
++ event.accepted = true;
++ zoomInAnimation.stop();
++ } else if (event.key == Qt.Key_ZoomOut || event.key == Qt.Key_F8 ) {
++ // Zoom out
++ event.accepted = true;
++ zoomOutAnimation.stop();
++ }
++ }
++
++ PropertyAnimation {
++ id: zoomInAnimation;
++ target: camera;
++ property: "digitalZoom";
++ to: Math.min(4.0, camera.maximumDigitalZoom);
++ duration: 4000;
++ }
++
++ PropertyAnimation {
++ id: zoomOutAnimation;
++ target: camera;
++ property: "digitalZoom";
++ to: 0.0;
++ duration: 4000;
++ }
+ }
+
+ CaptureControls {
+--- a/examples/declarative-camera/qmlcamera.cpp
++++ b/examples/declarative-camera/qmlcamera.cpp
+@@ -75,7 +75,8 @@ int main(int argc, char *argv[])
+ // Qt.quit() called in embedded .qml by default only emits
+ // quit() signal, so do this (optionally use Qt.exit()).
+ QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit()));
+-#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
++
++#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_WS_MEEGO)
+ view.showFullScreen();
+ #else
+ view.setGeometry(QRect(100, 100, 800, 480));
+--- a/features/basic_examples_setup.pri
++++ b/features/basic_examples_setup.pri
+@@ -44,6 +44,9 @@ QMAKE_LIBDIR = $$OUTPUT_DIR/lib
+
+ INCLUDEPATH+= $$QT_MOBILITY_SOURCE_TREE/src/global
+
++meego {
++ DEFINES+= Q_WS_MEEGO
++}
+ maemo6 {
+ DEFINES+= Q_WS_MAEMO_6
+ DEFINES+= QTM_EXAMPLES_SMALL_SCREEN
++++++ qt-mobility.yaml
--- qt-mobility.yaml
+++ qt-mobility.yaml
@@ -22,7 +22,7 @@
- ix86:Moorestown_Camera_Support.patch
- arm:enable_xvoverlay_for_qml_camera.patch
- camera_api_added_functionality.patch
- - set_qml_camera_example_fullscreen.patch
+ - qml_camera_example_added_functionality.patch
Description: |
Qt Mobility delivers a set of new APIs for mobile device functionality. These
APIs allow the developer to use these features with ease from one framework and
@@ -379,4 +379,4 @@
Requires:
- meego-handset-icon-theme
- gst-plugins-camera
- - gstreamer >= 0.10.32-3.2
+ - gstreamer >= 0.10.32
++++++ deleted files:
--- set_qml_camera_example_fullscreen.patch
More information about the MeeGo-commits
mailing list