populate post capture model when page is current and clear it when we leave
[harmattan/cameraplus] / lib / qtcammode_p.h
index 0a37ebf..b724ffd 100644 (file)
@@ -3,7 +3,7 @@
 /*!
  * This file is part of CameraPlus.
  *
- * Copyright (C) 2012 Mohammed Sameer <msameer@foolab.org>
+ * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -185,7 +185,13 @@ public:
     else {
       QString preview = QString(PREVIEW_CAPS).arg(size.width()).arg(size.height());
 
-      GstCaps *caps = gst_caps_from_string(preview.toAscii());
+      GstCaps *caps = gst_caps_from_string(preview.toLatin1());
+
+      if (!dev->conf->isPreviewSupported()) {
+       qWarning() << "Cannot set preview caps. Preview not supported";
+       gst_caps_unref(caps);
+       return;
+      }
 
       g_object_set(dev->cameraBin, "preview-caps", caps, "post-previews", TRUE, NULL);