[Merge] lp:~fboucault/camera-app/no_cpu_usage_in_photo_roll into lp:camera-app/staging
Ugo Riboni
ugo.riboni at canonical.com
Tue Dec 8 10:22:38 UTC 2015
Review: Needs Information
Code LGTM except minor comments. Works well functionally with the related qtubuntu-camera MR.
Diff comments:
>
> === modified file 'ViewFinderView.qml'
> --- ViewFinderView.qml 2015-11-17 13:23:26 +0000
> +++ ViewFinderView.qml 2015-12-07 15:05:55 +0000
> @@ -33,6 +33,31 @@
> signal photoTaken(string filePath)
> signal videoShot(string filePath)
>
> +
> + onInViewChanged: decideCameraState()
> + Connections {
> + target: viewFinderOverlay
> + onStatusChanged: decideCameraState()
> + }
> +
> + function decideCameraState() {
Picky: maybe updateCameraState would be a better name for this
> + if (viewFinderOverlay.status == Loader.Ready) {
> + if (viewFinderView.inView) {
> + camera.cameraState = Camera.LoadedState;
> + viewFinderOverlay.updateResolutionOptions();
> + camera.cameraState = Camera.ActiveState;
> + } else {
> + camera.cameraState = Camera.LoadedState;
> + viewFinderOverlay.updateResolutionOptions();
Why do we need to update the resolution options every time we restart the preview ?
Isn't it enough to do it when we switch cameras and when the camera stack loads for the first time (before the preview is running) ?
Or is the Android stack giving this information only when the preview is running ?
> + }
> + } else {
> + if (camera.videoRecorder.recorderState == CameraRecorder.RecordingState) {
> + camera.videoRecorder.stop();
> + }
> + camera.cameraState = Camera.UnloadedState;
> + }
> + }
> +
> Camera {
> id: camera
> captureMode: Camera.CaptureStillImage
--
https://code.launchpad.net/~fboucault/camera-app/no_cpu_usage_in_photo_roll/+merge/279791
Your team Ubuntu Phablet Team is subscribed to branch lp:camera-app/staging.
More information about the Ubuntu-reviews
mailing list