Hi,

I have an OpenGLES2 app that does some rendering via NDK (similar to
the way the NDK hello-gl2 sample app does it). I want to get the
camera preview as either NV21 or RGB565 and send the bytes via JNI to C
++, update a texture using those bytes, and finally render a quad with
the updated texture. I've converted NV21 as just grayscale at the
moment, since it's easier, and that looks fine on one phone, but on
another phone I get an image that is 1/2 or 1/4 the height, and it
looks duplicated along the width. RGB565 looks "jumpy" on one phone
(it's like the image is offset negative units from the top, and the
offset varies). On the other phone, I get the same "half height,
duplicated width" effect. I'm making sure I lock/unlock a mutex when I
update the texture bytes and when I call glTexImage2D right before
rendering. Could I missing some other thread problem?

Right now, my GLSurfaceView implements surfaceCreated, surfaceChanged,
and surfaceDestroyed. On surfaceChanged(), the camera parameters are
set and the preview is started. My renderer calls a JNI function on
onDrawFrame() which does the actual rendering. The camera buffer's
data is sent via JNI on the PreviewCallback's onPreviewFrame().

Any help is appreciated :)

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to