[Merge] lp:~fboucault/camera-app/no_cpu_usage_in_photo_roll into lp:camera-app/staging

Florian Boucault florian.boucault at canonical.com
Tue Dec 8 15:10:50 UTC 2015



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() {

quite happy with decide :)

> +        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();

camera.cameraState = Camera.LoadedState; does not restart the preview but loads the camera stack. Only at this point are we sure to have the resolutions listed.

> +            }
> +        } 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