I'm trying to write my own camera app using the newer camera2 API. At this point I'm just trying to get the app to start with the camera showing up on a fixed 640x480 SurfaceView in the emulated Nexus 5.
Here's the error I'm getting from Logcat, as well as the relevant code: http://pastebin.com/sESf6C1p
I honestly have no clue what's wrong here, even after lots of debugging and reading the API documentation over and over. I've found some evidence that I should add a delay before calling createCaptureSession (Android Camera - app passed NULL surface) which I tried with SystemClock.sleep(1000), but to no avail. Not sure what to make of "eglCreateContext: EGL error: 0x3005" either.
I'm calling createCaptureSession in the surfaceChanged callback which is run after surfaceCreated, so the surface should be all set up shouldn't it? I don't understand why the SDK is passing around a null surface internally.
Any tips appreciated!