I have an Android app that decodes video in yuv420p format and then creates video clips using OpenGLES. I use glTexSubImage2D () to load the y / u / v buffer into the GPU and then convert the YUV2RGB using a shader. All EGL / OpenGL installation / rendering code is native code.
Now I'm not saying that there is no problem with my code, but given the same code, it works fine on iOS (iPad / iPhone), Nexus 7, Kindle HD 8.9, Samsung Note 1 and several other cheap Chinese tablets (A31 / RockChip 3188) running Android 4.0 / 4.1 / 4.2. I would say that it is less likely that my code is wrong. On these devices, glTexSubImage2D () uses less than 16 ms to load HD SD or 720P textures.
However, on a Nexus 10 glTexSubImage2D (), an SD or 720P HD texture takes about 50 ~ 90 ms, which is too slow for video at 30 frames per second or 60 frames per second.
I'd like to know
1) if I have to choose a different texture format (RGBA or BGRA). Are there any ways to determine which of the best textures is used by the GPU?
2) if there is a function that is “OFF” for all other SOCs, but set to 'ON' on Exynos 5. For example, the option to automatically select MIPMAP. (I have it, by the way)
3) if this is a known Samsung Exynos SOC issue - I cannot find a support forum for Exynos CPU
4) Is there any parameter that I need to set when setting up the EGL surface? e.g. transparency, surface format, etc.? (I have no idea what I'm talking about)
5) This may mean that the GPU is performing an implicit format conversion, but I checked that GL_LUMINANCE is always used. Again it works on any other platform.
6) anything else?
My EGL configuration:
const EGLint attribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_BLUE_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_NONE };
Initial setting:
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, ctx->frameW, ctx->frameH, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL);
subsequent partial replacement:
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, ctx->frameW, ctx->frameH, GL_LUMINANCE, GL_UNSIGNED_BYTE, yBuffer);
I am trying to make a video with a resolution of ~ 30FPS or ~ 60FPS with a resolution of SD or 720P HD.