Implemented video resolution setting
[harmattan/cameraplus] / qml / main.qml
index 4688994..c0a3067 100644 (file)
@@ -179,8 +179,26 @@ PageStackWindow {
                 }
         }
 
+        VideoSettings {
+                id: videoSettings
+                camera: cam
+
+                function setVideoResolution() {
+                        if (!videoSettings.setResolution(settings.videoAspectRatio, settings.videoResolution)) {
+                                showError(qsTr("Failed to set required resolution"));
+                        }
+                }
+
+                onReadyChanged: {
+                        if (ready) {
+                                videoSettings.setVideoResolution();
+                        }
+                }
+        }
+
         Connections {
                 target: settings
+
                 onImageAspectRatioChanged: {
                         imageSettings.setImageResolution();
                 }
@@ -188,6 +206,10 @@ PageStackWindow {
                 onImageResolutionChanged: {
                         imageSettings.setImageResolution();
                 }
+
+                onVideoResolutionChanged: {
+                        videoSettings.setVideoResolution();
+                }
         }
 
         Camera {
@@ -210,6 +232,9 @@ PageStackWindow {
 
                 // TODO: hardcoding device id
                 Component.onCompleted: { cam.deviceId = 0; mode = settings.mode; }
+                Component.onDestruction: {
+                console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+                }
 
                 // TODO: Hack
                 z: -1