I'm trying to capture frames from a camera preview so that I can do some image processing on the frames in the background while the user sees the camera preview. For that, I'm adding 60 buffers initially using addCallbackBuffer() in surfaceChanged() method of the SurfaceView and then on each onPreviewFrame() call, I'm re-adding the used buffer. The problem is re-adding the buffer in onPreviewFrame() slows down the preview. I'm also counting the number of calls to onPreviewFrame() every second. In the first second, I'm getting more than 70 calls to onPreviewFrame() which decreases to less than 25 in the second second and later.
Here is the code for the SurfaceView which implements SurfaceHolder.Callback and Camera.PreviewCallback https://dpaste.de/ZvCdE/ and the FPSCounter class which is used in the above class https://dpaste.de/as87Q/ -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

