Hi All,
RT.
In our project, we used glTexDirectVIVMap to reduce CPU load, but we found it caused memory leak issue,
how to fix it? is there the existed patch to fix it?
Source code as follow:
=============================================
v4l2_buffer v4l2buf;
/* v4l2 setup: MMAP memory mode */
if (ioctl(fd_v4l, VIDIOC_DQBUF, &v4l2buf) < 0)
{
printf("line=%d, fd_v4l, VIDIOC_DQBUF error!!!\n", __LINE__);
return -1;
}
GLuint physical = ~0U;
/* m_pvirtualaddr: mmap(xxx) from V4L2 DMA address, just do mmap one time when v4l2 setup */
glTexDirectVIVMap(GL_TEXTURE_2D, g_cap_width, g_cap_height,
GL_VIV_UYVY, (GLvoid**)&(m_pvirtualaddr), &physical);
=============================================