Wednesday, September 12, 2012

[android-developers] Using 2 TextureView or 1 TextureView + 1 GLSurfaceView at the same time

Hi,

I'm currently developping a sort of AR application.
It basically features of a camera preview as a background and of the rendering of 3D objects as an overlay, inside
the same fragment.
Currently I use a SurfaceView for camera preview and an overlaying GLSurfaceView for the OpenGL rendering
thread ; it works but I'd like to improve things.

First I'd like to use a TextureView for camera preview and keeping the GLSurfaceView for the OpenGL rendering engine.
When I tried, the camera preview was black (but when I disabled the OpenGL rendering engine, it works). So I presume
there's a kind of conflict between a TextureView and a GLSurfaceView, since the TextureView does some tricks with
GL textures, as the GL rendering thread (3D objects are meant to be textured).

My Question is : how can we have a TextureView and a GLSurfaceView coexist in the same app at the same time ?


Secondly, would it be better to have 2 TextureView (one for camera, the other for GL rendering) or 1 TextureView shared by the camera
and the GL thread ? I'd like to dissociate the camera preview from the display of 3D objects, and being able to disable one or the other.


Thanks in advance,



--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment