Good, because the preview buffers that you receive in the callback are only a copy of the preview buffers, so any changes you make will not be displayed, since the buffer you receive is your copy. Mentioned in android sdk here
I'm not sure how to do this, but I was thinking about how to do it, and here is what I have to do -
- Register Preview Buffers
- Disable default preview display
- If you don’t install the preview screen on the surface, you should not display (but I'm not sure that it will work) by reading it on some forum that the source couldn’t remember)
- If the above does not work, we will need to hide the view (I know that it’s hardly effective, but I could not come up with anything else).
- Reduce the preview frame rate so that we are not overloaded with buffers.
- Now, to display our buffers, we can either use the default bitmap drawing function, or use opengl to display buffers. But so far I have not used either one or the other, I do not even know if this is possible, any thoughts on the same thing?
UPDATE
Revising the SDK documentation I found this API - setPreviewTexture , this API allows us to "capture frames from an image stream as an OpenGL ES texture." When you have images with texture applied, you can use OpenGL to display your frames. (Take a look at the answer posted by @Stephan on how to do this.)
NOTE - setPreviewTexture is available from API level starting at 11! SDK Link
source share