Reputation: 701
Folks,
I have been following the camera2 of the likes of camera2basic, camera2raw, and camera2video (and also webjb/myrobot on github), but everything always displays the images. Are there any camera2 examples that do not have preview the image? My app is already using the texture view for something else, but I don't want to modify it to show a camera image that I don't need to see (I can save the image if I want to see what is going on).
Upvotes: 2
Views: 759
Reputation: 18137
You can just remove it - don't include the Surface from the SurfaceView in the capture session creation, and don't include it in the capture requests.
You'll need something to send camera images to, of course - but that depends on what you want to do with the data. An ImageReader can be used to receive YUV, JPEG, and on some devices, RAW buffers; a SurfaceTexture can be used to read camera data into OpenGL, etc.
It's also important to submit capture requests to the camera on a regular basis so that it can maintain auto-exposure, focus, and white-balance, even if you don't use the data for anything.
(Though keep in mind - if you expect users to take pictures with your application, they need some way to aim the phone accurately)
Upvotes: 2