summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2013-10-18 18:54:17 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2013-10-18 18:54:17 +0200
commit48ea384835dd8dd75bfab196da56df274a161b0b (patch)
treefd2e155d999e8332391ebea70698920e86b3bb52
parenta70cefc572fb190d4d71d3dfbb7d75afa79f119a (diff)
qtvideosink: Abstract methods from QtVideoSinkDelegate into a new BaseDelegate class
These methods will be needed for the QtQuick2 video sink delegate.
-rw-r--r--elements/gstqtvideosink/CMakeLists.txt1
-rw-r--r--elements/gstqtvideosink/delegates/basedelegate.cpp187
-rw-r--r--elements/gstqtvideosink/delegates/basedelegate.h138
-rw-r--r--elements/gstqtvideosink/delegates/qtvideosinkdelegate.cpp182
-rw-r--r--elements/gstqtvideosink/delegates/qtvideosinkdelegate.h110
-rw-r--r--elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp2
-rw-r--r--elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.h2
-rw-r--r--elements/gstqtvideosink/gstqtglvideosink.cpp2
-rw-r--r--elements/gstqtvideosink/gstqtvideosink.cpp2
-rw-r--r--elements/gstqtvideosink/gstqwidgetvideosink.cpp2
10 files changed, 338 insertions, 290 deletions
diff --git a/elements/gstqtvideosink/CMakeLists.txt b/elements/gstqtvideosink/CMakeLists.txt
index 6808a25..901cb94 100644
--- a/elements/gstqtvideosink/CMakeLists.txt
+++ b/elements/gstqtvideosink/CMakeLists.txt
@@ -9,6 +9,7 @@ set(GstQtVideoSink_SRCS
painters/genericsurfacepainter.cpp
+ delegates/basedelegate.cpp
delegates/qtvideosinkdelegate.cpp
delegates/qwidgetvideosinkdelegate.cpp
diff --git a/elements/gstqtvideosink/delegates/basedelegate.cpp b/elements/gstqtvideosink/delegates/basedelegate.cpp
new file mode 100644
index 0000000..e3239a0
--- /dev/null
+++ b/elements/gstqtvideosink/delegates/basedelegate.cpp
@@ -0,0 +1,187 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). <qt-info@nokia.com>
+ Copyright (C) 2011-2013 Collabora Ltd. <info@collabora.com>
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1
+ as published by the Free Software Foundation.
+
+ This program 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 program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "basedelegate.h"
+
+#include <QCoreApplication>
+
+BaseDelegate::BaseDelegate(GstElement * sink, QObject * parent)
+ : QObject(parent)
+ , m_colorsDirty(true)
+ , m_brightness(0)
+ , m_contrast(0)
+ , m_hue(0)
+ , m_saturation(0)
+ , m_pixelAspectRatio(1, 1)
+ , m_forceAspectRatioDirty(true)
+ , m_forceAspectRatio(false)
+ , m_formatDirty(true)
+ , m_isActive(false)
+ , m_buffer(NULL)
+ , m_sink(sink)
+{
+}
+
+BaseDelegate::~BaseDelegate()
+{
+ Q_ASSERT(!isActive());
+}
+
+//-------------------------------------
+
+bool BaseDelegate::isActive() const
+{
+ QReadLocker l(&m_isActiveLock);
+ return m_isActive;
+}
+
+void BaseDelegate::setActive(bool active)
+{
+ GST_INFO_OBJECT(m_sink, active ? "Activating" : "Deactivating");
+
+ QWriteLocker l(&m_isActiveLock);
+ m_isActive = active;
+ if (!active) {
+ QCoreApplication::postEvent(this, new DeactivateEvent());
+ }
+}
+
+//-------------------------------------
+
+int BaseDelegate::brightness() const
+{
+ QReadLocker l(&m_colorsLock);
+ return m_brightness;
+}
+
+void BaseDelegate::setBrightness(int brightness)
+{
+ QWriteLocker l(&m_colorsLock);
+ m_brightness = qBound(-100, brightness, 100);
+ m_colorsDirty = true;
+}
+
+int BaseDelegate::contrast() const
+{
+ QReadLocker l(&m_colorsLock);
+ return m_contrast;
+}
+
+void BaseDelegate::setContrast(int contrast)
+{
+ QWriteLocker l(&m_colorsLock);
+ m_contrast = qBound(-100, contrast, 100);
+ m_colorsDirty = true;
+}
+
+int BaseDelegate::hue() const
+{
+ QReadLocker l(&m_colorsLock);
+ return m_hue;
+}
+
+void BaseDelegate::setHue(int hue)
+{
+ QWriteLocker l(&m_colorsLock);
+ m_hue = qBound(-100, hue, 100);
+ m_colorsDirty = true;
+}
+
+int BaseDelegate::saturation() const
+{
+ QReadLocker l(&m_colorsLock);
+ return m_saturation;
+}
+
+void BaseDelegate::setSaturation(int saturation)
+{
+ QWriteLocker l(&m_colorsLock);
+ m_saturation = qBound(-100, saturation, 100);
+ m_colorsDirty = true;
+}
+
+//-------------------------------------
+
+Fraction BaseDelegate::pixelAspectRatio() const
+{
+ QReadLocker l(&m_pixelAspectRatioLock);
+ return m_pixelAspectRatio;
+}
+
+void BaseDelegate::setPixelAspectRatio(const Fraction & f)
+{
+ QWriteLocker l(&m_pixelAspectRatioLock);
+ m_pixelAspectRatio = f;
+}
+
+//-------------------------------------
+
+bool BaseDelegate::forceAspectRatio() const
+{
+ QReadLocker l(&m_forceAspectRatioLock);
+ return m_forceAspectRatio;
+}
+
+void BaseDelegate::setForceAspectRatio(bool force)
+{
+ QWriteLocker l(&m_forceAspectRatioLock);
+ if (m_forceAspectRatio != force) {
+ m_forceAspectRatio = force;
+ m_forceAspectRatioDirty = true;
+ }
+}
+
+//-------------------------------------
+
+bool BaseDelegate::event(QEvent *event)
+{
+ switch((int) event->type()) {
+ case BufferEventType:
+ {
+ BufferEvent *bufEvent = dynamic_cast<BufferEvent*>(event);
+ Q_ASSERT(bufEvent);
+
+ GST_TRACE_OBJECT(m_sink, "Received buffer %"GST_PTR_FORMAT, bufEvent->buffer);
+
+ if (isActive()) {
+ gst_buffer_replace (&m_buffer, bufEvent->buffer);
+ if (bufEvent->formatDirty) {
+ m_formatDirty = true;
+ }
+ update();
+ }
+
+ return true;
+ }
+ case DeactivateEventType:
+ {
+ GST_LOG_OBJECT(m_sink, "Received deactivate event");
+
+ g_clear_object(&m_buffer);
+ update();
+
+ return true;
+ }
+ default:
+ return QObject::event(event);
+ }
+}
+
+void BaseDelegate::update()
+{
+ g_signal_emit_by_name(m_sink, "update");
+}
diff --git a/elements/gstqtvideosink/delegates/basedelegate.h b/elements/gstqtvideosink/delegates/basedelegate.h
new file mode 100644
index 0000000..490240c
--- /dev/null
+++ b/elements/gstqtvideosink/delegates/basedelegate.h
@@ -0,0 +1,138 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). <qt-info@nokia.com>
+ Copyright (C) 2011-2013 Collabora Ltd. <info@collabora.com>
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1
+ as published by the Free Software Foundation.
+
+ This program 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 program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef BASEDELEGATE_H
+#define BASEDELEGATE_H
+
+#include <gst/gst.h>
+
+#include "../utils/bufferformat.h"
+#include "../utils/utils.h"
+
+#include <QObject>
+#include <QEvent>
+#include <QReadWriteLock>
+
+class BaseDelegate : public QObject
+{
+ Q_OBJECT
+public:
+ enum EventType {
+ BufferEventType = QEvent::User,
+ DeactivateEventType
+ };
+
+ //-------------------------------------
+
+ class BufferEvent : public QEvent
+ {
+ public:
+ inline BufferEvent(GstBuffer *buf, bool formatDirty)
+ : QEvent(static_cast<QEvent::Type>(BufferEventType)),
+ buffer(gst_buffer_ref(buf)),
+ formatDirty(formatDirty)
+ {}
+
+ virtual ~BufferEvent() {
+ gst_buffer_unref(buffer);
+ }
+
+ GstBuffer *buffer;
+ bool formatDirty;
+ };
+
+ class DeactivateEvent : public QEvent
+ {
+ public:
+ inline DeactivateEvent()
+ : QEvent(static_cast<QEvent::Type>(DeactivateEventType))
+ {
+ }
+ };
+
+ //-------------------------------------
+
+ explicit BaseDelegate(GstElement *sink, QObject *parent = 0);
+ virtual ~BaseDelegate();
+
+ bool isActive() const;
+ void setActive(bool playing);
+
+ // GstColorBalance interface
+
+ int brightness() const;
+ void setBrightness(int brightness);
+
+ int contrast() const;
+ void setContrast(int contrast);
+
+ int hue() const;
+ void setHue(int hue);
+
+ int saturation() const;
+ void setSaturation(int saturation);
+
+ // pixel-aspect-ratio property
+ Fraction pixelAspectRatio() const;
+ void setPixelAspectRatio(const Fraction & f);
+
+ // force-aspect-ratio property
+ bool forceAspectRatio() const;
+ void setForceAspectRatio(bool force);
+
+protected:
+ // internal event handling
+ virtual bool event(QEvent *event);
+
+ // tells the surface to repaint itself
+ virtual void update();
+
+protected:
+ // colorbalance interface properties
+ mutable QReadWriteLock m_colorsLock;
+ bool m_colorsDirty;
+ int m_brightness;
+ int m_contrast;
+ int m_hue;
+ int m_saturation;
+
+ // pixel-aspect-ratio property
+ mutable QReadWriteLock m_pixelAspectRatioLock;
+ Fraction m_pixelAspectRatio;
+
+ // force-aspect-ratio property
+ mutable QReadWriteLock m_forceAspectRatioLock;
+ bool m_forceAspectRatioDirty;
+ bool m_forceAspectRatio;
+
+ // format caching
+ bool m_formatDirty;
+ BufferFormat m_bufferFormat;
+ PaintAreas m_areas;
+
+ // whether the sink is active (PAUSED or PLAYING)
+ mutable QReadWriteLock m_isActiveLock;
+ bool m_isActive;
+
+ // the buffer to be drawn next
+ GstBuffer *m_buffer;
+
+ // the video sink element
+ GstElement * const m_sink;
+};
+
+#endif // BASEDELEGATE_H
diff --git a/elements/gstqtvideosink/delegates/qtvideosinkdelegate.cpp b/elements/gstqtvideosink/delegates/qtvideosinkdelegate.cpp
index a200334..b7769d4 100644
--- a/elements/gstqtvideosink/delegates/qtvideosinkdelegate.cpp
+++ b/elements/gstqtvideosink/delegates/qtvideosinkdelegate.cpp
@@ -18,10 +18,7 @@
#include "qtvideosinkdelegate.h"
#include "../painters/genericsurfacepainter.h"
#include "../painters/openglsurfacepainter.h"
-#include "gstqtvideosink.h"
-#include "gstqtglvideosink.h"
-#include <QCoreApplication>
#include <QStack>
#include <QPainter>
@@ -33,140 +30,21 @@
(float) rect.x(), (float) rect.y(), (float) rect.width(), (float) rect.height()
-QtVideoSinkDelegate::QtVideoSinkDelegate(GstQtVideoSinkBase *sink, QObject *parent)
- : QObject(parent)
+QtVideoSinkDelegate::QtVideoSinkDelegate(GstElement *sink, QObject *parent)
+ : BaseDelegate(sink, parent)
, m_painter(0)
, m_supportedPainters(Generic)
#ifndef GST_QT_VIDEO_SINK_NO_OPENGL
, m_glContext(0)
#endif
- , m_colorsDirty(true)
- , m_brightness(0)
- , m_contrast(0)
- , m_hue(0)
- , m_saturation(0)
- , m_pixelAspectRatio(1, 1)
- , m_forceAspectRatioDirty(true)
- , m_forceAspectRatio(false)
- , m_formatDirty(true)
- , m_isActive(false)
- , m_buffer(NULL)
- , m_sink(sink)
{
}
QtVideoSinkDelegate::~QtVideoSinkDelegate()
{
- Q_ASSERT(!isActive());
destroyPainter();
}
-//-------------------------------------
-
-bool QtVideoSinkDelegate::isActive() const
-{
- QReadLocker l(&m_isActiveLock);
- return m_isActive;
-}
-
-void QtVideoSinkDelegate::setActive(bool active)
-{
- GST_INFO_OBJECT(m_sink, active ? "Activating" : "Deactivating");
-
- QWriteLocker l(&m_isActiveLock);
- m_isActive = active;
- if (!active) {
- QCoreApplication::postEvent(this, new DeactivateEvent());
- }
-}
-
-//-------------------------------------
-
-int QtVideoSinkDelegate::brightness() const
-{
- QReadLocker l(&m_colorsLock);
- return m_brightness;
-}
-
-void QtVideoSinkDelegate::setBrightness(int brightness)
-{
- QWriteLocker l(&m_colorsLock);
- m_brightness = qBound(-100, brightness, 100);
- m_colorsDirty = true;
-}
-
-int QtVideoSinkDelegate::contrast() const
-{
- QReadLocker l(&m_colorsLock);
- return m_contrast;
-}
-
-void QtVideoSinkDelegate::setContrast(int contrast)
-{
- QWriteLocker l(&m_colorsLock);
- m_contrast = qBound(-100, contrast, 100);
- m_colorsDirty = true;
-}
-
-int QtVideoSinkDelegate::hue() const
-{
- QReadLocker l(&m_colorsLock);
- return m_hue;
-}
-
-void QtVideoSinkDelegate::setHue(int hue)
-{
- QWriteLocker l(&m_colorsLock);
- m_hue = qBound(-100, hue, 100);
- m_colorsDirty = true;
-}
-
-int QtVideoSinkDelegate::saturation() const
-{
- QReadLocker l(&m_colorsLock);
- return m_saturation;
-}
-
-void QtVideoSinkDelegate::setSaturation(int saturation)
-{
- QWriteLocker l(&m_colorsLock);
- m_saturation = qBound(-100, saturation, 100);
- m_colorsDirty = true;
-}
-
-//-------------------------------------
-
-Fraction QtVideoSinkDelegate::pixelAspectRatio() const
-{
- QReadLocker l(&m_pixelAspectRatioLock);
- return m_pixelAspectRatio;
-}
-
-void QtVideoSinkDelegate::setPixelAspectRatio(const Fraction & f)
-{
- QWriteLocker l(&m_pixelAspectRatioLock);
- m_pixelAspectRatio = f;
-}
-
-//-------------------------------------
-
-bool QtVideoSinkDelegate::forceAspectRatio() const
-{
- QReadLocker l(&m_forceAspectRatioLock);
- return m_forceAspectRatio;
-}
-
-void QtVideoSinkDelegate::setForceAspectRatio(bool force)
-{
- QWriteLocker l(&m_forceAspectRatioLock);
- if (m_forceAspectRatio != force) {
- m_forceAspectRatio = force;
- m_forceAspectRatioDirty = true;
- }
-}
-
-//-------------------------------------
-
void QtVideoSinkDelegate::paint(QPainter *painter, const QRectF & targetArea)
{
GST_TRACE_OBJECT(m_sink, "paint called");
@@ -364,64 +242,12 @@ void QtVideoSinkDelegate::destroyPainter()
bool QtVideoSinkDelegate::event(QEvent *event)
{
- switch((int) event->type()) {
- case BufferEventType:
- {
- BufferEvent *bufEvent = dynamic_cast<BufferEvent*>(event);
- Q_ASSERT(bufEvent);
-
- GST_TRACE_OBJECT(m_sink, "Received buffer %"GST_PTR_FORMAT, bufEvent->buffer);
-
- if (m_buffer) {
- //free the previous buffer
- gst_buffer_unref(m_buffer);
- m_buffer = NULL;
- }
-
- if (isActive()) {
- //schedule this frame for rendering
- m_buffer = gst_buffer_ref(bufEvent->buffer);
- if (bufEvent->formatDirty) {
- m_formatDirty = true;
- }
- update();
- }
-
- return true;
- }
- case DeactivateEventType:
- {
- GST_LOG_OBJECT(m_sink, "Received deactivate event");
-
- if (m_buffer) {
- gst_buffer_unref(m_buffer);
- m_buffer = NULL;
- }
-
+ if (event->type() == DeactivateEventType) {
if (m_painter) {
m_painter->cleanup();
destroyPainter();
}
-
- update();
-
- return true;
- }
- default:
- return QObject::event(event);
}
-}
-void QtVideoSinkDelegate::update()
-{
-#ifndef GST_QT_VIDEO_SINK_NO_OPENGL
- if (G_TYPE_CHECK_INSTANCE_TYPE(m_sink, GST_TYPE_QT_GL_VIDEO_SINK)) {
- GstQtGLVideoSink::emit_update(m_sink);
- } else
-#endif
- if (G_TYPE_CHECK_INSTANCE_TYPE(m_sink, GST_TYPE_QT_VIDEO_SINK)) {
- GstQtVideoSink::emit_update(m_sink);
- } else {
- Q_ASSERT(false);
- }
+ return BaseDelegate::event(event);
}
diff --git a/elements/gstqtvideosink/delegates/qtvideosinkdelegate.h b/elements/gstqtvideosink/delegates/qtvideosinkdelegate.h
index b2f2726..32f266b 100644
--- a/elements/gstqtvideosink/delegates/qtvideosinkdelegate.h
+++ b/elements/gstqtvideosink/delegates/qtvideosinkdelegate.h
@@ -18,19 +18,12 @@
#ifndef QT_VIDEO_SINK_DELEGATE_H
#define QT_VIDEO_SINK_DELEGATE_H
-#include "gstqtvideosinkbase.h"
-#include "../utils/bufferformat.h"
+#include "basedelegate.h"
#include "../painters/abstractsurfacepainter.h"
-#include <QObject>
-#include <QEvent>
-#include <QSet>
-#include <QReadWriteLock>
-
class QGLContext;
-
-class QtVideoSinkDelegate : public QObject
+class QtVideoSinkDelegate : public BaseDelegate
{
Q_OBJECT
public:
@@ -41,73 +34,11 @@ public:
};
Q_DECLARE_FLAGS(PainterTypes, PainterType);
- enum EventType {
- BufferEventType = QEvent::User,
- DeactivateEventType
- };
-
- //-------------------------------------
-
- class BufferEvent : public QEvent
- {
- public:
- inline BufferEvent(GstBuffer *buf, bool formatDirty)
- : QEvent(static_cast<QEvent::Type>(BufferEventType)),
- buffer(gst_buffer_ref(buf)),
- formatDirty(formatDirty)
- {}
-
- virtual ~BufferEvent() {
- gst_buffer_unref(buffer);
- }
-
- GstBuffer *buffer;
- bool formatDirty;
- };
-
- class DeactivateEvent : public QEvent
- {
- public:
- inline DeactivateEvent()
- : QEvent(static_cast<QEvent::Type>(DeactivateEventType))
- {
- }
- };
-
- //-------------------------------------
-
- explicit QtVideoSinkDelegate(GstQtVideoSinkBase *sink, QObject *parent = 0);
+ explicit QtVideoSinkDelegate(GstElement *sink, QObject *parent = 0);
virtual ~QtVideoSinkDelegate();
- // API for GstQtVideoSinkBase
-
- bool isActive() const;
- void setActive(bool playing);
-
PainterTypes supportedPainterTypes() const { return m_supportedPainters; }
- // GstColorBalance interface
-
- int brightness() const;
- void setBrightness(int brightness);
-
- int contrast() const;
- void setContrast(int contrast);
-
- int hue() const;
- void setHue(int hue);
-
- int saturation() const;
- void setSaturation(int saturation);
-
- // pixel-aspect-ratio property
- Fraction pixelAspectRatio() const;
- void setPixelAspectRatio(const Fraction & f);
-
- // force-aspect-ratio property
- bool forceAspectRatio() const;
- void setForceAspectRatio(bool force);
-
#ifndef GST_QT_VIDEO_SINK_NO_OPENGL
// glcontext property
QGLContext *glContext() const;
@@ -121,9 +52,6 @@ protected:
// internal event handling
virtual bool event(QEvent *event);
- // tells the surface to repaint itself
- virtual void update();
-
private:
void changePainter(const BufferFormat & format);
void destroyPainter();
@@ -134,38 +62,6 @@ private:
#ifndef GST_QT_VIDEO_SINK_NO_OPENGL
QGLContext *m_glContext;
#endif
-
- // colorbalance interface properties
- mutable QReadWriteLock m_colorsLock;
- bool m_colorsDirty;
- int m_brightness;
- int m_contrast;
- int m_hue;
- int m_saturation;
-
- // pixel-aspect-ratio property
- mutable QReadWriteLock m_pixelAspectRatioLock;
- Fraction m_pixelAspectRatio;
-
- // force-aspect-ratio property
- mutable QReadWriteLock m_forceAspectRatioLock;
- bool m_forceAspectRatioDirty;
- bool m_forceAspectRatio;
-
- // format caching
- bool m_formatDirty;
- BufferFormat m_bufferFormat;
- PaintAreas m_areas;
-
- // whether the sink is active (PAUSED or PLAYING)
- mutable QReadWriteLock m_isActiveLock;
- bool m_isActive;
-
- // the buffer to be drawn next
- GstBuffer *m_buffer;
-
-protected:
- GstQtVideoSinkBase * const m_sink;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QtVideoSinkDelegate::PainterTypes)
diff --git a/elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp b/elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp
index 336bf76..8f23dc2 100644
--- a/elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp
+++ b/elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.cpp
@@ -18,7 +18,7 @@
#include "qwidgetvideosinkdelegate.h"
#include <QPainter>
-QWidgetVideoSinkDelegate::QWidgetVideoSinkDelegate(GstQtVideoSinkBase* sink, QObject* parent)
+QWidgetVideoSinkDelegate::QWidgetVideoSinkDelegate(GstElement * sink, QObject * parent)
: QtVideoSinkDelegate(sink, parent)
{
diff --git a/elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.h b/elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.h
index 7e54395..007b7aa 100644
--- a/elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.h
+++ b/elements/gstqtvideosink/delegates/qwidgetvideosinkdelegate.h
@@ -27,7 +27,7 @@ class QWidgetVideoSinkDelegate : public QtVideoSinkDelegate
{
Q_OBJECT
public:
- explicit QWidgetVideoSinkDelegate(GstQtVideoSinkBase* sink, QObject* parent = 0);
+ explicit QWidgetVideoSinkDelegate(GstElement * sink, QObject * parent = 0);
virtual ~QWidgetVideoSinkDelegate();
// "widget" property
diff --git a/elements/gstqtvideosink/gstqtglvideosink.cpp b/elements/gstqtvideosink/gstqtglvideosink.cpp
index 5cbf204..27307f6 100644
--- a/elements/gstqtvideosink/gstqtglvideosink.cpp
+++ b/elements/gstqtvideosink/gstqtglvideosink.cpp
@@ -113,7 +113,7 @@ void GstQtGLVideoSink::init(GTypeInstance *instance, gpointer g_class)
Q_UNUSED(g_class);
GstQtVideoSinkBase *sinkBase = GST_QT_VIDEO_SINK_BASE(instance);
- sinkBase->delegate = new QtVideoSinkDelegate(sinkBase);
+ sinkBase->delegate = new QtVideoSinkDelegate(GST_ELEMENT(sinkBase));
}
//------------------------------
diff --git a/elements/gstqtvideosink/gstqtvideosink.cpp b/elements/gstqtvideosink/gstqtvideosink.cpp
index 9ce8cae..f7e2581 100644
--- a/elements/gstqtvideosink/gstqtvideosink.cpp
+++ b/elements/gstqtvideosink/gstqtvideosink.cpp
@@ -97,7 +97,7 @@ void GstQtVideoSink::init(GTypeInstance *instance, gpointer g_class)
Q_UNUSED(g_class);
GstQtVideoSinkBase *sinkBase = GST_QT_VIDEO_SINK_BASE(instance);
- sinkBase->delegate = new QtVideoSinkDelegate(sinkBase);
+ sinkBase->delegate = new QtVideoSinkDelegate(GST_ELEMENT(sinkBase));
}
//------------------------------
diff --git a/elements/gstqtvideosink/gstqwidgetvideosink.cpp b/elements/gstqtvideosink/gstqwidgetvideosink.cpp
index e922cbe..6c98096 100644
--- a/elements/gstqtvideosink/gstqwidgetvideosink.cpp
+++ b/elements/gstqtvideosink/gstqwidgetvideosink.cpp
@@ -62,7 +62,7 @@ void GstQWidgetVideoSink::init(GTypeInstance *instance, gpointer g_class)
Q_UNUSED(g_class);
GstQtVideoSinkBase *sinkBase = GST_QT_VIDEO_SINK_BASE(instance);
- sinkBase->delegate = new QWidgetVideoSinkDelegate(sinkBase);
+ sinkBase->delegate = new QWidgetVideoSinkDelegate(GST_ELEMENT(sinkBase));
}
void GstQWidgetVideoSink::set_property(GObject *object, guint prop_id,