I use the glTexImage2D to draw YUV frame date,but it is too slowly. so I want to use EGLimage to draw YUV frame,but it is not display. Do I make any mistake? Thank you! -------------------------------------------------------------------------------------------
glActiveTexture ( GL_TEXTURE1 ); glBindTexture ( GL_TEXTURE_2D, userData.textureId[1] ); glPixelStorei(GL_UNPACK_ALIGNMENT,1); glUniform1i ( userData.samplerLocU, 1); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); eglImage = pFnEGLCreateImageKHR(g_Display, 0, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer) pict->data[1], 0); pFnEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage); pFnEGLDestroyImageKHR(g_Display,eglImage); // Bind the texture glActiveTexture ( GL_TEXTURE2 ); glBindTexture ( GL_TEXTURE_2D, userData.textureId[2] ); glPixelStorei(GL_UNPACK_ALIGNMENT,1); glUniform1i ( userData.samplerLocV, 2); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); eglImage = pFnEGLCreateImageKHR(g_Display, 0, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer) pict->data[2], 0); pFnEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage); pFnEGLDestroyImageKHR(g_Display,eglImage); glActiveTexture ( GL_TEXTURE0 ); glBindTexture ( GL_TEXTURE_2D, userData.textureId[0] ); glPixelStorei(GL_UNPACK_ALIGNMENT,1); glUniform1i ( userData.samplerLocY, 0); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); eglImage = pFnEGLCreateImageKHR(g_Display, 0, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer) pict->data[0], 0); pFnEGLImageTargetTexture2DOES(GL_TEXTURE_2D, eglImage); pFnEGLDestroyImageKHR(g_Display,eglImage); -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting