Merge lp:~fboucault/camera-app/hdr_always_works into lp:camera-app/staging

Proposed by Florian Boucault
Status: Merged
Approved by: Ugo Riboni
Approved revision: 627
Merged at revision: 627
Proposed branch: lp:~fboucault/camera-app/hdr_always_works
Merge into: lp:camera-app/staging
Diff against target: 66 lines (+16/-11)
2 files modified
CameraApp/advancedcamerasettings.cpp (+15/-11)
CameraApp/advancedcamerasettings.h (+1/-0)
To merge this branch: bzr merge lp:~fboucault/camera-app/hdr_always_works
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ugo Riboni (community) Approve
Review via email: mp+281635@code.launchpad.net

Commit message

Make sure that regardless of when HDR is enabled it will eventually be enabled in the backend.

To post a comment you must log in.
Revision history for this message
Florian Boucault (fboucault) wrote :
Revision history for this message
Ugo Riboni (uriboni) wrote :

Works as expected, and code looks good.

review: Approve
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 'CameraApp/advancedcamerasettings.cpp'
2--- CameraApp/advancedcamerasettings.cpp 2015-12-02 08:27:19 +0000
3+++ CameraApp/advancedcamerasettings.cpp 2016-01-05 13:09:18 +0000
4@@ -44,7 +44,8 @@
5 m_cameraFlashControl(0),
6 m_cameraExposureControl(0),
7 m_imageEncoderControl(0),
8- m_videoEncoderControl(0)
9+ m_videoEncoderControl(0),
10+ m_hdrEnabled(false)
11 {
12 }
13
14@@ -236,6 +237,9 @@
15
16 m_cameraFlashControl = flashControlFromCamera(m_camera);
17 m_cameraExposureControl = exposureControlFromCamera(m_camera);
18+ QVariant exposureMode = m_hdrEnabled ? QVariant::fromValue(ExposureHdr)
19+ : QVariant::fromValue(QCameraExposure::ExposureAuto);
20+ m_cameraExposureControl->setValue(QCameraExposureControl::ExposureMode, exposureMode);
21
22 if (m_cameraExposureControl) {
23 QObject::connect(m_cameraExposureControl,
24@@ -451,20 +455,20 @@
25
26 bool AdvancedCameraSettings::hdrEnabled() const
27 {
28- if (m_cameraExposureControl) {
29- QVariant exposureMode = m_cameraExposureControl->actualValue(QCameraExposureControl::ExposureMode);
30- return exposureMode.value<QCameraExposure::ExposureMode>() == ExposureHdr;
31- } else {
32- return false;
33- }
34+ return m_hdrEnabled;
35 }
36
37 void AdvancedCameraSettings::setHdrEnabled(bool enabled)
38 {
39- if (m_cameraExposureControl) {
40- QVariant exposureMode = enabled ? QVariant::fromValue(ExposureHdr)
41- : QVariant::fromValue(QCameraExposure::ExposureAuto);
42- m_cameraExposureControl->setValue(QCameraExposureControl::ExposureMode, exposureMode);
43+ if (enabled != m_hdrEnabled) {
44+ m_hdrEnabled = enabled;
45+ if (m_cameraExposureControl) {
46+ QVariant exposureMode = enabled ? QVariant::fromValue(ExposureHdr)
47+ : QVariant::fromValue(QCameraExposure::ExposureAuto);
48+ m_cameraExposureControl->setValue(QCameraExposureControl::ExposureMode, exposureMode);
49+ } else {
50+ Q_EMIT hdrEnabledChanged();
51+ }
52 }
53 }
54
55
56=== modified file 'CameraApp/advancedcamerasettings.h'
57--- CameraApp/advancedcamerasettings.h 2015-11-17 15:25:03 +0000
58+++ CameraApp/advancedcamerasettings.h 2016-01-05 13:09:18 +0000
59@@ -108,6 +108,7 @@
60 QCameraExposureControl* m_cameraExposureControl;
61 QImageEncoderControl* m_imageEncoderControl;
62 QVideoEncoderSettingsControl* m_videoEncoderControl;
63+ bool m_hdrEnabled;
64 };
65
66 #endif // ADVANCEDCAMERASETTINGS_H

Subscribers

People subscribed via source and target branches