开发者

Any experience with the Android Honeycomb SurfaceTexture class?

I'm wanting to implement a simple demo example of streaming the camera feed to an opengl es object as a texture. This looks to be possible using this SurfaceTexture class. Can anyone point me in the right direction on where to start with this? Or can anyone explain how to use this class?

Right now I'm doing something like:

int[] textures = new int[1];
gl.glGenTextures(1, textures, 0);
mTextureId = textures[0];

gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureId);

gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);

gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,
                GL10.GL_LINEAR);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER,
                GL10.GL_LINEAR);

gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRA开发者_运维百科P_S,
                GL10.GL_CLAMP_TO_EDGE);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T,
                GL10.GL_REPEAT);

mSurfaceTexture = new SurfaceTexture(mTextureId);

Originally you would supply an image for this texture using gl.glTexImage2D() but because there is not a bitmap/image from the SurfaceTexture object to supply it's kind of confusing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜