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);

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to