mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
qml, qml6: Fix leak of QSGMaterial/Geometry (and therefore a possible GstBuffer)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6160>
This commit is contained in:
parent
2dae3775d9
commit
392fd00f4c
2 changed files with 4 additions and 0 deletions
|
@ -314,8 +314,10 @@ QtGLVideoItem::updatePaintNode(QSGNode * oldNode,
|
||||||
texNode = new QSGGeometryNode();
|
texNode = new QSGGeometryNode();
|
||||||
geometry = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4);
|
geometry = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4);
|
||||||
texNode->setGeometry(geometry);
|
texNode->setGeometry(geometry);
|
||||||
|
texNode->setFlag(QSGGeometryNode::Flag::OwnsGeometry);
|
||||||
tex = GstQSGMaterial::new_for_format(GST_VIDEO_INFO_FORMAT (&this->priv->v_info));
|
tex = GstQSGMaterial::new_for_format(GST_VIDEO_INFO_FORMAT (&this->priv->v_info));
|
||||||
texNode->setMaterial(tex);
|
texNode->setMaterial(tex);
|
||||||
|
texNode->setFlag(QSGGeometryNode::Flag::OwnsMaterial);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((old_buffer = tex->getBuffer(&was_bound))) {
|
if ((old_buffer = tex->getBuffer(&was_bound))) {
|
||||||
|
|
|
@ -309,10 +309,12 @@ Qt6GLVideoItem::updatePaintNode(QSGNode * oldNode,
|
||||||
texNode = new QSGGeometryNode();
|
texNode = new QSGGeometryNode();
|
||||||
geometry = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4);
|
geometry = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4);
|
||||||
texNode->setGeometry(geometry);
|
texNode->setGeometry(geometry);
|
||||||
|
texNode->setFlag(QSGGeometryNode::OwnsGeometry);
|
||||||
tex = GstQSGMaterial::new_for_format(GST_VIDEO_INFO_FORMAT (&this->priv->v_info));
|
tex = GstQSGMaterial::new_for_format(GST_VIDEO_INFO_FORMAT (&this->priv->v_info));
|
||||||
tex->setFiltering(is_smooth ? QSGTexture::Filtering::Linear :
|
tex->setFiltering(is_smooth ? QSGTexture::Filtering::Linear :
|
||||||
QSGTexture::Filtering::Nearest);
|
QSGTexture::Filtering::Nearest);
|
||||||
texNode->setMaterial(tex);
|
texNode->setMaterial(tex);
|
||||||
|
texNode->setFlag(QSGGeometryNode::OwnsMaterial);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((old_buffer = tex->getBuffer(&was_bound))) {
|
if ((old_buffer = tex->getBuffer(&was_bound))) {
|
||||||
|
|
Loading…
Reference in a new issue