Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use android camera with OpenGL ES to work?

I want to use the OpenGL ES for the Android camera preview and Save the captured Image.

I like to use the OpenGL ES in Android camera to give some effect to the Android camera. So please anyone tell me how to do it?

like image 826
Android_Developer Avatar asked Oct 21 '11 09:10

Android_Developer


1 Answers

you need to implement the android.hardware.Camera.PreviewCallback interface and override the method

public synchronized void onPreviewFrame(byte[] data, Camera camera) {
                        myOpenGLObject.receiveFrames(data);
        }

to read the frames received from the camera callback. I suggest you to have a look into the andar source http://code.google.com/p/andar/. Especially the class CameraPreviewHandler.java.

I hope this answers your question.

like image 182
andreasg Avatar answered Oct 01 '22 00:10

andreasg