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
=== modified file 'CameraApp/advancedcamerasettings.cpp'
--- CameraApp/advancedcamerasettings.cpp 2015-12-02 08:27:19 +0000
+++ CameraApp/advancedcamerasettings.cpp 2016-01-05 13:09:18 +0000
@@ -44,7 +44,8 @@
44 m_cameraFlashControl(0),44 m_cameraFlashControl(0),
45 m_cameraExposureControl(0),45 m_cameraExposureControl(0),
46 m_imageEncoderControl(0),46 m_imageEncoderControl(0),
47 m_videoEncoderControl(0)47 m_videoEncoderControl(0),
48 m_hdrEnabled(false)
48{49{
49}50}
5051
@@ -236,6 +237,9 @@
236237
237 m_cameraFlashControl = flashControlFromCamera(m_camera);238 m_cameraFlashControl = flashControlFromCamera(m_camera);
238 m_cameraExposureControl = exposureControlFromCamera(m_camera);239 m_cameraExposureControl = exposureControlFromCamera(m_camera);
240 QVariant exposureMode = m_hdrEnabled ? QVariant::fromValue(ExposureHdr)
241 : QVariant::fromValue(QCameraExposure::ExposureAuto);
242 m_cameraExposureControl->setValue(QCameraExposureControl::ExposureMode, exposureMode);
239243
240 if (m_cameraExposureControl) {244 if (m_cameraExposureControl) {
241 QObject::connect(m_cameraExposureControl,245 QObject::connect(m_cameraExposureControl,
@@ -451,20 +455,20 @@
451455
452bool AdvancedCameraSettings::hdrEnabled() const456bool AdvancedCameraSettings::hdrEnabled() const
453{457{
454 if (m_cameraExposureControl) {458 return m_hdrEnabled;
455 QVariant exposureMode = m_cameraExposureControl->actualValue(QCameraExposureControl::ExposureMode);
456 return exposureMode.value<QCameraExposure::ExposureMode>() == ExposureHdr;
457 } else {
458 return false;
459 }
460}459}
461460
462void AdvancedCameraSettings::setHdrEnabled(bool enabled)461void AdvancedCameraSettings::setHdrEnabled(bool enabled)
463{462{
464 if (m_cameraExposureControl) {463 if (enabled != m_hdrEnabled) {
465 QVariant exposureMode = enabled ? QVariant::fromValue(ExposureHdr)464 m_hdrEnabled = enabled;
466 : QVariant::fromValue(QCameraExposure::ExposureAuto);465 if (m_cameraExposureControl) {
467 m_cameraExposureControl->setValue(QCameraExposureControl::ExposureMode, exposureMode);466 QVariant exposureMode = enabled ? QVariant::fromValue(ExposureHdr)
467 : QVariant::fromValue(QCameraExposure::ExposureAuto);
468 m_cameraExposureControl->setValue(QCameraExposureControl::ExposureMode, exposureMode);
469 } else {
470 Q_EMIT hdrEnabledChanged();
471 }
468 }472 }
469}473}
470474
471475
=== modified file 'CameraApp/advancedcamerasettings.h'
--- CameraApp/advancedcamerasettings.h 2015-11-17 15:25:03 +0000
+++ CameraApp/advancedcamerasettings.h 2016-01-05 13:09:18 +0000
@@ -108,6 +108,7 @@
108 QCameraExposureControl* m_cameraExposureControl;108 QCameraExposureControl* m_cameraExposureControl;
109 QImageEncoderControl* m_imageEncoderControl;109 QImageEncoderControl* m_imageEncoderControl;
110 QVideoEncoderSettingsControl* m_videoEncoderControl;110 QVideoEncoderSettingsControl* m_videoEncoderControl;
111 bool m_hdrEnabled;
111};112};
112113
113#endif // ADVANCEDCAMERASETTINGS_H114#endif // ADVANCEDCAMERASETTINGS_H

Subscribers

People subscribed via source and target branches