Merge lp:~fboucault/camera-app/more_hack_for_sensor_orientation into lp:camera-app

Proposed by Florian Boucault
Status: Merged
Approved by: Florian Boucault
Approved revision: 590
Merged at revision: 591
Proposed branch: lp:~fboucault/camera-app/more_hack_for_sensor_orientation
Merge into: lp:camera-app
Diff against target: 24 lines (+12/-2)
1 file modified
ViewFinderView.qml (+12/-2)
To merge this branch: bzr merge lp:~fboucault/camera-app/more_hack_for_sensor_orientation
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+276536@code.launchpad.net

Commit message

Only use Screen.primaryOrientation returned at startup which is more indicative of the native orientation of the device.
Fixes case where viewfinder rotated when changing window size.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ViewFinderView.qml'
2--- ViewFinderView.qml 2015-10-22 12:21:14 +0000
3+++ ViewFinderView.qml 2015-11-03 14:14:33 +0000
4@@ -222,8 +222,18 @@
5 feed is rotated too.
6 FIXME: This should come from a system configuration option so that we
7 don't have to have a different codebase for each different device we want
8- to run on */
9- orientation: Screen.primaryOrientation === Qt.PortraitOrientation ? -90 : 0
10+ to run on. Android has that information and QML has an API to reflect it:
11+ the camera.orientation property. Unfortunately it is not hooked up yet.
12+
13+ Ref.: http://doc.qt.io/qt-5/qml-qtmultimedia-camera.html#orientation-prop
14+ http://doc.qt.io/qt-5/qcamerainfocontrol.html#cameraOrientation
15+ http://developer.android.com/reference/android/hardware/Camera.CameraInfo.html#orientation
16+ */
17+ Component.onCompleted: {
18+ // Set orientation only at startup because later on Screen.primaryOrientation
19+ // may change.
20+ orientation = Screen.primaryOrientation === Qt.PortraitOrientation ? -90 : 0;
21+ }
22
23 /* Convenience item tracking the real position and size of the real video feed.
24 Having this helps since these values depend on a lot of rules:

Subscribers

People subscribed via source and target branches