I want to draw on top of a SurfaceTexture
that is connected to a Camera
via setPreviewTexture
. I can get the SurfaceTexture
by a SurfaceTextureListener
. But if I just try to use eglCreateWindowSurface
& eglMakeCurrent
it fails due to the surface already being connected.
1) Is it possible to draw on this surface at all? Or does binding it to the camera make it impossible to do that.
2) If it isn't possible. Can the surface be used (or copied) quickly to an OpenGL texture and used in a separate surface? If so how?
3) If not, what would be the fastest way to get the camera preview out of a SurfaceTexture and into OpenGL?
Also note, the code that gave me the failure regarding already being connected was inspired by Romain Guy's post here: http://groups.google.com/group/android-developers/browse_thread/thread/539457146a401cf1