From a13e8b3efa0e35d7dac7c57504339ac75aeae71e Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Sun, 21 May 2017 16:01:14 +0200 Subject: [PATCH] qmlglsink: Add itemInitialized signal to QML item This is useful for autoplay for example. With autoplay, it is necessary to wait until the scene graph is fully set up. This signal is emitted once the QML item node is ready. So, inside a connected slot, the pipeline's state can be set to PLAYING to automatically start playback as soon as the QML script is loaded. https://bugzilla.gnome.org/show_bug.cgi?id=786246 --- ext/qt/qtitem.cc | 2 ++ ext/qt/qtitem.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/ext/qt/qtitem.cc b/ext/qt/qtitem.cc index 5806bbc..b20a6fb 100644 --- a/ext/qt/qtitem.cc +++ b/ext/qt/qtitem.cc @@ -289,6 +289,8 @@ QtGLVideoItem::onSceneGraphInitialized () GST_DEBUG ("%p created wrapped GL context %" GST_PTR_FORMAT, this, this->priv->other_context); + + emit itemInitialized(); } void diff --git a/ext/qt/qtitem.h b/ext/qt/qtitem.h index b322068..8cffc24 100644 --- a/ext/qt/qtitem.h +++ b/ext/qt/qtitem.h @@ -77,6 +77,9 @@ public: /* private for C interface ... */ QtGLVideoItemPrivate *priv; +Q_SIGNALS: + void itemInitialized(); + private Q_SLOTS: void handleWindowChanged(QQuickWindow * win); void onSceneGraphInitialized(); -- 2.7.4