set device property if we don't use a wrapper too
authorMohammed Sameer <msameer@foolab.org>
Tue, 8 Jan 2013 00:52:00 +0000 (02:52 +0200)
committerMohammed Sameer <msameer@foolab.org>
Tue, 8 Jan 2013 00:52:00 +0000 (02:52 +0200)
lib/qtcamdevice.cpp
lib/qtcamdevice_p.h

index 4230066..82bb19f 100644 (file)
@@ -65,6 +65,8 @@ QtCamDevice::QtCamDevice(QtCamConfig *config, const QString& name,
     d_ptr->createAndAddVideoSource();
   }
 
+  d_ptr->setDevicePoperty();
+
   int flags =
     0x00000001 /* no-audio-conversion - Do not use audio conversion elements */
     | 0x00000002 /* no-video-conversion - Do not use video conversion elements */
index ecc8aad..aae2b33 100644 (file)
@@ -88,7 +88,20 @@ public:
     else {
       qWarning() << "Failed to create both video and wrapper sources";
     }
+  }
+
+  void createAndAddVideoSource() {
+    videoSource = gst_element_factory_make(conf->videoSource().toUtf8().constData(),
+                                          "QtCameraVideoSrc");
+    if (!videoSource) {
+      qCritical() << "Failed to create video source";
+    }
+    else {
+      g_object_set(cameraBin, "camera-source", videoSource, NULL);
+    }
+  }
 
+  void setDevicePoperty() {
     if (videoSource) {
       if (conf->deviceScannerType() == SCANNER_TYPE_ENUM) {
        int dev = id.toInt();
@@ -102,17 +115,6 @@ public:
     }
   }
 
-  void createAndAddVideoSource() {
-    videoSource = gst_element_factory_make(conf->videoSource().toUtf8().constData(),
-                                          "QtCameraVideoSrc");
-    if (!videoSource) {
-      qCritical() << "Failed to create video source";
-    }
-    else {
-      g_object_set(cameraBin, "camera-source", videoSource, NULL);
-    }
-  }
-
   bool setViewfinderSink() {
     GstElement *sink = 0;
     g_object_get(cameraBin, "viewfinder-sink", &sink, NULL);