[vlc-commits] [Git][videolan/vlc][master] doc: QtGL: fix textures being recreated

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Tue Oct 5 08:52:42 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
180cc786 by Craig Turner at 2021-10-05T08:30:04+00:00
doc: QtGL: fix textures being recreated

QOpenGLFramebufferObject::takeTexture is detaching the current texture
and transfering ownership to the caller, and the texture was never
destroyed afterwards. It was leading to a huge memory consumption and
leak when using the sample app.

>From the documentation[^1] in Qt5:

    Returns the texture id for the texture attached to this framebuffer
    object. The ownership of the texture is transferred to the caller.

    If the framebuffer object is currently bound, an implicit release()
    will be done. During the next call to bind() a new texture will be
    created.

[1]: https://doc.qt.io/qt-5/qopenglframebufferobject.html#takeTexture

Co-authored-by: Alexandre Janniaux <ajanni at videolabs.io>
For the commit message and cleaning the fix mostly.

Fixes #25867

- - - - -


1 changed file:

- doc/libvlc/QtGL/qtvlcwidget.cpp


Changes:

=====================================
doc/libvlc/QtGL/qtvlcwidget.cpp
=====================================
@@ -360,7 +360,7 @@ void QtVLCWidget::paintGL()
         GL->glClearColor(1.0, 0.5, 0.0, 1.0);
 
         GL->glActiveTexture(GL_TEXTURE0);
-        GL->glBindTexture(GL_TEXTURE_2D, fbo->takeTexture());
+        GL->glBindTexture(GL_TEXTURE_2D, fbo->texture());
 
         vertexBuffer.bind();
         m_program->setAttributeArray("position", (const QVector2D *)nullptr, sizeof(GLfloat)*2);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/180cc78689af27ff06c636cebabcf92ec7a9f454

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/180cc78689af27ff06c636cebabcf92ec7a9f454
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list