Added reset button to exposure settings
[harmattan/cameraplus] / lib / qtcamdevice_p.h
index 3334cb4..c8c09fb 100644 (file)
@@ -43,6 +43,7 @@ public:
     cameraBin(0),
     videoSource(0),
     wrapperVideoSource(0),
+    sink(0),
     image(0),
     video(0),
     active(0),
@@ -116,11 +117,7 @@ public:
   }
 
   bool setViewfinderSink() {
-    GstElement *sink = 0;
-    g_object_get(cameraBin, "viewfinder-sink", &sink, NULL);
-
     if (sink) {
-      gst_object_unref(sink);
       return true;
     }
 
@@ -181,13 +178,18 @@ public:
     }
   }
 
-  bool isWrapperReady() {
-    if (!wrapperVideoSource) {
+  bool isReadyForCapture() {
+    GstElement *src = videoSource;
+    if (wrapperVideoSource) {
+      src = wrapperVideoSource;
+    }
+
+    if (!src) {
       return false;
     }
 
     gboolean ready = FALSE;
-    g_object_get(wrapperVideoSource, "ready-for-capture", &ready, NULL);
+    g_object_get(src, "ready-for-capture", &ready, NULL);
 
     return ready == TRUE;
   }
@@ -220,6 +222,7 @@ public:
   GstElement *cameraBin;
   GstElement *videoSource;
   GstElement *wrapperVideoSource;
+  GstElement *sink;
 
   QtCamImageMode *image;
   QtCamVideoMode *video;