Remove QtCamDevicePrivate::resetCapabilities(). We don't use it
[harmattan/cameraplus] / lib / qtcamdevice.cpp
index c9cce2b..a8430dc 100644 (file)
 #include "qtcamimagemode.h"
 #include "qtcamvideomode.h"
 #include "qtcamnotifications.h"
+#include "gst/gstcopy.h"
+#include "qtcampropertysetter.h"
 
 QtCamDevice::QtCamDevice(QtCamConfig *config, const QString& name,
                         const QVariant& id, QObject *parent) :
   QObject(parent), d_ptr(new QtCamDevicePrivate) {
 
+  static gboolean register_copy = TRUE;
+  if (register_copy) {
+    qt_cam_copy_register();
+    register_copy = FALSE;
+  }
+
   d_ptr->q_ptr = this;
   d_ptr->name = name;
   d_ptr->id = id;
@@ -45,6 +53,8 @@ QtCamDevice::QtCamDevice(QtCamConfig *config, const QString& name,
     return;
   }
 
+  d_ptr->propertySetter = new QtCamPropertySetter(d_ptr);
+
   d_ptr->createAndAddElement(d_ptr->conf->audioSource(), "audio-source", "QtCameraAudioSrc");
   d_ptr->createAndAddVideoSource();
 
@@ -57,11 +67,8 @@ QtCamDevice::QtCamDevice(QtCamConfig *config, const QString& name,
   g_object_set(d_ptr->cameraBin, "flags", flags, NULL);
 
   d_ptr->setAudioCaptureCaps();
+  d_ptr->addViewfinderFilters();
 
-  // TODO: audio bitrate
-  // TODO: video bitrate
-  // TODO: filters
-  // TODO: custom properties for jifmux, mp4mux, audio encoder, video encoder, sink & video source
   d_ptr->listener = new QtCamGStreamerMessageListener(gst_element_get_bus(d_ptr->cameraBin),
                                                      d_ptr, this);
 
@@ -92,6 +99,8 @@ QtCamDevice::~QtCamDevice() {
   delete d_ptr->image; d_ptr->image = 0;
   delete d_ptr->video; d_ptr->video = 0;
 
+  delete d_ptr->propertySetter;
+
   if (d_ptr->cameraBin) {
     gst_object_unref(d_ptr->cameraBin);
   }