If wrapperVideoSource is null then connect to videoSource ready-for-capture instead
authorMohammed Sameer <msameer@foolab.org>
Sun, 28 Jul 2013 15:35:34 +0000 (18:35 +0300)
committerMohammed Sameer <msameer@foolab.org>
Sun, 28 Jul 2013 15:35:34 +0000 (18:35 +0300)
lib/qtcamdevice.cpp

index 294edc2..a8e180c 100644 (file)
@@ -102,8 +102,14 @@ QtCamDevice::QtCamDevice(QtCamConfig *config, const QString& name,
   g_signal_connect(d_ptr->cameraBin, "notify::idle",
                   G_CALLBACK(QtCamDevicePrivate::on_idle_changed), d_ptr);
 
-  g_signal_connect(d_ptr->wrapperVideoSource, "notify::ready-for-capture",
-                  G_CALLBACK(QtCamDevicePrivate::on_ready_for_capture_changed), d_ptr);
+  if (d_ptr->wrapperVideoSource) {
+    g_signal_connect(d_ptr->wrapperVideoSource, "notify::ready-for-capture",
+                    G_CALLBACK(QtCamDevicePrivate::on_ready_for_capture_changed), d_ptr);
+  }
+  else {
+    g_signal_connect(d_ptr->videoSource, "notify::ready-for-capture",
+                    G_CALLBACK(QtCamDevicePrivate::on_ready_for_capture_changed), d_ptr);
+  }
 
   d_ptr->image = new QtCamImageMode(d_ptr, this);
   d_ptr->video = new QtCamVideoMode(d_ptr, this);