18 #include "videosurface_p.h" 20 #include "../elementfactory.h" 21 #include "../../QGlib/connect.h" 23 #include <QtCore/QDebug> 24 #include <QtQuick/QQuickItem> 29 VideoSurface::VideoSurface(QObject *parent)
30 : QObject(parent), d(new VideoSurfacePrivate)
34 VideoSurface::~VideoSurface()
36 if (!d->videoSink.isNull()) {
37 d->videoSink->setState(QGst::StateNull);
45 if (d->videoSink.isNull()) {
46 d->videoSink = QGst::ElementFactory::make(
"qtquick2videosink");
48 if (d->videoSink.isNull()) {
49 qCritical(
"Failed to create qtquick2videosink. Make sure it is installed correctly");
54 const_cast<VideoSurface*>(
this),
55 &VideoSurface::onUpdate);
62 void VideoSurface::onUpdate()
64 Q_FOREACH(QQuickItem *item, d->items) {
ElementPtr videoSink() const
Wrappers for GStreamer classes.
bool connect(void *instance, const char *detailedSignal, T *receiver, R(T::*slot)(Args...), ConnectFlags flags=0)