+/*!
+ * 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>
}
void QtCamViewfinderRendererMeeGo::reset() {
- // Nothing.
+ QMutexLocker locker(&m_frameMutex);
+ m_frame = -1;
}
GstElement *QtCamViewfinderRendererMeeGo::sinkElement() {
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);
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";