diff options
author | William Wedler <william.wedler@videoray.com> | 2024-04-22 10:40:13 -0400 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2024-04-29 16:36:16 +0000 |
commit | 782f0c885b3d3e573698b4f56bc744e143274f46 (patch) | |
tree | a0f93545c319e821077aedc6a46f85caad922817 | |
parent | 57446d12525b2c7c17d8e3b471f886c3cf46b811 (diff) |
fix: qmlglsink: video content resizes to new item size
Mark geometry dirty when the item rectangle changes in the
QtGLVideoItem::updatePaintNode method. This allows changes in the bounding
rectangle to be applied to the scene graph geometry node.
Fixes #3493
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6759>
-rw-r--r-- | subprojects/gst-plugins-good/ext/qt/qtitem.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/subprojects/gst-plugins-good/ext/qt/qtitem.cc b/subprojects/gst-plugins-good/ext/qt/qtitem.cc index 0a85ab8704..653a0835f2 100644 --- a/subprojects/gst-plugins-good/ext/qt/qtitem.cc +++ b/subprojects/gst-plugins-good/ext/qt/qtitem.cc @@ -74,6 +74,7 @@ struct _QtGLVideoItemPrivate GstCaps *caps; GstVideoInfo new_v_info; GstVideoInfo v_info; + GstVideoRectangle v_rect; gboolean initted; GstGLDisplay *display; @@ -375,6 +376,11 @@ QtGLVideoItem::updatePaintNode(QSGNode * oldNode, QRectF rect(result.x, result.y, result.w, result.h); QRectF sourceRect(0, 0, 1, 1); QSGGeometry::updateTexturedRectGeometry(geometry, rect, sourceRect); + if(priv->v_rect.x != result.x || priv->v_rect.y != result.y || + priv->v_rect.w != result.w || priv->v_rect.h != result.h) { + texNode->markDirty(QSGNode::DirtyGeometry); + priv->v_rect = result; + } g_mutex_unlock (&this->priv->lock); |