I am trying to display a filtered camera preview, using onPreviewFrame() callback.
The problem is that when i remove this line:
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
to hide the preview, the app crashes. The log reads:
08-19 15:57:51.042: ERROR/CameraService(59): registerBuffers failed with status -38
What does this mean? Is this documented anywhere?
I am using the CameraPreview from the SDK APIDemos: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.html
SURFACE_TYPE_PUSH_BUFFERS generates several buffers for the SurfaceView. Components are locking (fill with data) and pushing (display data) these buffers deep in the OS code. Especially OpenMax (camera hardware device interface) is using “graphic buffers”=”push buffers” to fill data and display data. To be specific, the camera hardware can fill a push buffer directly and die graphics hardware can display a push buffer directly (they share these buffers). Conclusion: The OS forces you to create a SurfaceView with push buffers. Then it can use the buffers for the camera device.