From: Jochen Henneberg Date: Wed, 6 Sep 2017 07:59:56 +0000 (+0000) Subject: qmlglsink: Expose itemInitialized as property X-Git-Tag: 1.19.3~509^2~1695^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0d526a2a85f350576884c70cf40477fd0c2afd7;p=platform%2Fupstream%2Fgstreamer.git qmlglsink: Expose itemInitialized as property Instead of just signalling when ready exposing the state as a property allows us to bind at any time if player is loaded async. --- diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc index b20a6fb..65b883e 100644 --- a/ext/qt/qtitem.cc +++ b/ext/qt/qtitem.cc @@ -178,6 +178,12 @@ QtGLVideoItem::getForceAspectRatio() return this->priv->force_aspect_ratio; } +bool +QtGLVideoItem::itemInitialized() +{ + return m_openGlContextInitialized; +} + QSGNode * QtGLVideoItem::updatePaintNode(QSGNode * oldNode, UpdatePaintNodeData * updatePaintNodeData) @@ -290,7 +296,7 @@ QtGLVideoItem::onSceneGraphInitialized () GST_DEBUG ("%p created wrapped GL context %" GST_PTR_FORMAT, this, this->priv->other_context); - emit itemInitialized(); + emit itemInitializedChanged(); } void diff --git a/ext/qt/qtitem.h b/ext/qt/qtitem.h index 8cffc24..065d043 100644 --- a/ext/qt/qtitem.h +++ b/ext/qt/qtitem.h @@ -64,6 +64,11 @@ class InitializeSceneGraph; class QtGLVideoItem : public QQuickItem, protected QOpenGLFunctions { Q_OBJECT + + Q_PROPERTY(bool itemInitialized + READ itemInitialized + NOTIFY itemInitializedChanged) + public: QtGLVideoItem(); ~QtGLVideoItem(); @@ -72,13 +77,14 @@ public: void getDAR(gint *, gint *); void setForceAspectRatio(bool); bool getForceAspectRatio(); + bool itemInitialized(); QSharedPointer getInterface() { return proxy; }; /* private for C interface ... */ QtGLVideoItemPrivate *priv; Q_SIGNALS: - void itemInitialized(); + void itemInitializedChanged(); private Q_SLOTS: void handleWindowChanged(QQuickWindow * win);