Silence g++/moc warnings
[harmattan/cameraplus] / lib / qtcamviewfinderrenderermeego.cpp
index 8c5eeed..b3d9866 100644 (file)
@@ -1,3 +1,23 @@
+/*!
+ * This file is part of CameraPlus.
+ *
+ * Copyright (C) 2012 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
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
 #include "qtcamviewfinderrenderermeego.h"
 #include <QDebug>
 #include <gst/video/video.h>
@@ -106,7 +126,8 @@ void QtCamViewfinderRendererMeeGo::resize(const QSizeF& size) {
 }
 
 void QtCamViewfinderRendererMeeGo::reset() {
-  // Nothing.
+  QMutexLocker locker(&m_frameMutex);
+  m_frame = -1;
 }
 
 GstElement *QtCamViewfinderRendererMeeGo::sinkElement() {
@@ -162,6 +183,8 @@ void QtCamViewfinderRendererMeeGo::frame_ready(GstElement *sink, int frame,
 void QtCamViewfinderRendererMeeGo::sink_notify(QtCamViewfinderRendererMeeGo *q,
                                               GObject *object, gboolean is_last_ref) {
 
+  Q_UNUSED(object);
+
   if (is_last_ref) {
     g_signal_handler_disconnect(q->m_sink, q->m_id);
     g_object_remove_toggle_ref(G_OBJECT(q->m_sink), (GToggleNotify)sink_notify, q);
@@ -225,6 +248,8 @@ void QtCamViewfinderRendererMeeGo::paintFrame(QPainter *painter, int frame) {
     return;
   }
 
+  // TODO: sometimes there is an assertion.
+
   MeegoGstVideoTexture *sink = MEEGO_GST_VIDEO_TEXTURE(m_sink);
   if (!meego_gst_video_texture_acquire_frame(sink, frame)) {
     qDebug() << "Failed to acquire frame";