I'm trying to create an app that takes some photos from a service using the camera2 API.
I can get the app to take pictures fine from a fragment based on the Camera2Basic sample.
But when I try move to a service the image doesn't finish capturing properly. It never progresses past the autoexposure precapture state.
I narrowed it down to being some problem with not having a preview. I've put together a test fragment by taking the Camera2Basic code and removing the preview, which results in the same issue.
I put together a test fragment that has the issue, based on the Camera2Basic sample where i've basically just removed code for the preview. Fragment code uploaded here http://pastebin.ca/3182401.
I'm getting the onCaptureCompleted() callback but when i check the camera autoexposure state here, it's still in the CONTROL_AE_STATE_PRECAPTURE state.
It doesn't make sense to me that the capture would be completed if one of the camera states is still in precapture.
Anyone know what might be happening here?
It's not mentioned in the docs, but onCaptureCompleted is actually called when the request has been sent, not when precapture or autofocus sequence has finished. Camera2Basic relies on preview running constantly, because preview acts as a constant monitor for the camera's state. Without it, you won't know when the precapture sequence actually finishes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With