/*!
* 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
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);