mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
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.
This commit is contained in:
parent
be7ebefd27
commit
a0d526a2a8
2 changed files with 14 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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<QtGLVideoItemInterface> getInterface() { return proxy; };
|
||||
/* private for C interface ... */
|
||||
QtGLVideoItemPrivate *priv;
|
||||
|
||||
Q_SIGNALS:
|
||||
void itemInitialized();
|
||||
void itemInitializedChanged();
|
||||
|
||||
private Q_SLOTS:
|
||||
void handleWindowChanged(QQuickWindow * win);
|
||||
|
|
Loading…
Reference in a new issue