Hi Andre,
Yesterday I was a little ill and I guess I wasn't thinking clearly, sorry. So, I'm going to tell you what I have until now...
When the stagefright ends, it returns to me an array with the frame decoded in YUV420 format. I worked out the total size of a frame in YUV420@1080p and its size is 3110400 bytes is it correct?. Until now, I've managed to display the frames correctly but it takes so much time that it starts to add a display delay until a queue overflow, then the app crashes... hahaha.
So, what do I want to do? "Easy", I only need to do the colorspace conversion using the IPU and display it. I guess that the source code that you give me yesterday does what I need but I'm really noob in openGL framework... Could it be as easy as doing a memcpy from my array to a magic direction that It was able to do all that I need automatically?
I guess I haven't understand the SurfaceFlinger concept.
UPDATE: I've found the part of the application that I'm working with where it's defined the OpenGL operations... I've paid attention to this:
|
GL_OPERATION(glActiveTexture(GL_TEXTURE0)) |
GL_OPERATION(glBindTexture(GL_TEXTURE_2D, gldisp->textures[gldisp->texture_index][type][Y]))
GL_OPERATION(glUniform1i(gldisp->uniforms[UNIFORM_TEXTURE_Y], 0))
|
GL_OPERATION(glActiveTexture(GL_TEXTURE1)) |
GL_OPERATION(glBindTexture(GL_TEXTURE_2D, gldisp->textures[gldisp->texture_index][type][U]))
GL_OPERATION(glUniform1i(gldisp->uniforms[UNIFORM_TEXTURE_U], 1))
|
GL_OPERATION(glActiveTexture(GL_TEXTURE2)) |
GL_OPERATION(glBindTexture(GL_TEXTURE_2D, gldisp->textures[gldisp->texture_index][type][V]))
GL_OPERATION(glUniform1i(gldisp->uniforms[UNIFORM_TEXTURE_V], 2))
GL_OPERATION(glVertexAttribPointer(ATTRIB_VERTEX, 2, GL_FLOAT, 0, 0, squareVertices))
GL_OPERATION(glEnableVertexAttribArray(ATTRIB_VERTEX))
GL_OPERATION(glVertexAttribPointer(ATTRIB_UV, 2, GL_FLOAT, 1, 0, squareUvs))
GL_OPERATION(glEnableVertexAttribArray(ATTRIB_UV))
GL_OPERATION(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4))
What do you think about this?
Thank you!
Regards,
Javi.