mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
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/6711>
This commit is contained in:
parent
c02af39026
commit
9ad6a9b942
1 changed files with 6 additions and 0 deletions
|
@ -74,6 +74,7 @@ struct _QtGLVideoItemPrivate
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstVideoInfo new_v_info;
|
GstVideoInfo new_v_info;
|
||||||
GstVideoInfo v_info;
|
GstVideoInfo v_info;
|
||||||
|
GstVideoRectangle v_rect;
|
||||||
|
|
||||||
gboolean initted;
|
gboolean initted;
|
||||||
GstGLDisplay *display;
|
GstGLDisplay *display;
|
||||||
|
@ -375,6 +376,11 @@ QtGLVideoItem::updatePaintNode(QSGNode * oldNode,
|
||||||
QRectF rect(result.x, result.y, result.w, result.h);
|
QRectF rect(result.x, result.y, result.w, result.h);
|
||||||
QRectF sourceRect(0, 0, 1, 1);
|
QRectF sourceRect(0, 0, 1, 1);
|
||||||
QSGGeometry::updateTexturedRectGeometry(geometry, rect, sourceRect);
|
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);
|
g_mutex_unlock (&this->priv->lock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue