My application needs to compare adjacent frames of an MJPEG stream. I am decoding the jpegs via OMX, and each frame is displayed on the screen in GLES via a texture populated by egl_render. I would like to use a shader to subtract each new frame from the one that precedes it, but I can't manage to locate a way to make a copy of the texture without bringing the data back to the arm cpu.
Is there a way to have the GPU make a copy of the texture before it gets overwritten by the next incoming frame? I've tried using glCopyTexImage2D and glCopyTexSubImage2D to grab the texture from the display, but the resulting texture is 100% black. I'm sure that there must be a way to do this, and I could use a hint as to the correct method.
thanks in advance