wodong
wodong

Reputation: 307

How to get grey preview from camera using OpenGL ES 2

I'm a newer on OpenGL ES 2. I think I need to add some logic in camera's previewCallback, but I have no idea how to do that. What I need is a black-and-white preview. That will be great if you can provide an example. I read android doc but still have no idea, please help. http://developer.android.com/guide/topics/graphics/opengl.html

camera.setPreviewCallback(new PreviewCallback() {
    @Override
    public void onPreviewFrame(byte[] data, Camera camera) {
//do something here
    }
}

Upvotes: 1

Views: 202

Answers (1)

user2218823
user2218823

Reputation: 36

The data format is yuv420sp commonly, first 1/2 length of data is Y data, this can be taken as your grey data.

Upvotes: 2

Related Questions