libcamera: egl: Remove eGLImage::image_

This member stores an egl image handle, but currently there is no need for it
since the image handle is only really used in `createDMABufTexture2D()`.
(`destroyDMABufTexture()` is an unused function.)

So remove the member (and the unused function), and instead destroy the image
immediately after calling `glEGLImageTargetTexture2DOES()`. The texture will
keep a reference to the image, so this is safe to do. In fact, this solves
an issue, specifically, the egl images were never destroyed, and continuously
leaked during streaming.

Fixes: f520b29fe9 ("libcamera: software_isp: debayer_egl: Add an eGL Debayer class")
Closes: https://gitlab.freedesktop.org/camera/libcamera/-/work_items/322
Signed-off-by: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Gianfranco Mariotti
2026-04-01 10:30:22 +02:00
committed by Barnabás Pőcze
parent 3ca844bd94
commit b4ca5e6ff8
2 changed files with 10 additions and 29 deletions
-2
View File
@@ -88,7 +88,6 @@ public:
GLenum texture_unit_; /**< Texture unit associated with this image eg (GL_TEXTURE0) */
GLuint texture_; /**< OpenGL texture object ID */
GLuint fbo_; /**< OpenGL frame buffer object ID */
EGLImageKHR image_; /**< EGL Image handle */
private:
LIBCAMERA_DISABLE_COPY_AND_MOVE(eGLImage)
@@ -104,7 +103,6 @@ public:
int createInputDMABufTexture2D(eGLImage &eglImage, int fd);
int createOutputDMABufTexture2D(eGLImage &eglImage, int fd);
void destroyDMABufTexture(eGLImage &eglImage);
void createTexture2D(eGLImage &eglImage, GLint format, uint32_t width, uint32_t height, void *data);
void pushEnv(std::vector<std::string> &shaderEnv, const char *str);