This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to use eglimage on linux platform

I want to use eglimage as texture my linux platform using Mali400.

But the result image is not correct.

-------------------------------------------------------------my source-------------------------------------------------------------------------

glGenTextures(1, texID);

glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texID[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

#if 0 //===> It's OK     ----------------glTexImage2d case OK---------------------

glTexImage2D(GL_TEXTURE_2D,0,GL_RGB, img_width, img_height,0,GL_RGB,GL_UNSIGNED_BYTE,imgBuf)

#else //===> it's not OK  ----------------eglimage case Fail---------------------

//set teximage

glTexImage2D(GL_TEXTURE_2D,0,GL_RGB, img_width, img_height,0,GL_RGB,GL_UNSIGNED_BYTE,NULL);

//create

eglimage = eglCreateImageKHR( pStatics->sEGLInfo.sEGLDisplay, pStatics->sEGLInfo.sEGLContext,

       EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer) texID[0], NULL);

//update eglimage data from texture data

EGLint attribs_rgb[] =
{
  MALI_EGL_IMAGE_PLANE, MALI_EGL_IMAGE_PLANE_RGB,
  MALI_EGL_IMAGE_MIPLEVEL, 0,
  MALI_EGL_IMAGE_ACCESS_MODE, MALI_EGL_IMAGE_ACCESS_READ_WRITE,
  EGL_NONE
};

mali_egl_image *img = mali_egl_image_lock_ptr( eglimage );
void *rgb = mali_egl_image_map_buffer( img, attribs_rgb );
MEMCPY( rgb, pdata, width*height*3);
mali_egl_image_unmap_buffer( img, attribs_rgb );

//connect eglimage to texture

glEGLImageTargetTexture2DOES( GL_TEXTURE_2D, (GLeglImageOES)eglImage);

//destroy

eglDestroyImageKHR(pStatics->sEGLInfo.sEGLDisplay, eglImage);

#endif

----------------------------------------------------------------------------------------------------------------------------------------

I checked there are no egl_error, gl_error, egl_image_error through eglGetError(), glGetError(), mali_egl_image_get_error().

I don't know how to update eglImage exactly.

Can I get some information to solve this problem?

Parents Reply Children