My app provides a camera, which allows user to either take a picture or record a video. I have no possibility to know which action user is going to choose. So I need to provide camera preview for both actions. With old camera API there was no problem at all, but I'm not sure about camera2 API.
I have thoroughly looked through both Google examples: Camera2Basic and Camera2Video, and I noticed that for taking pictures the preview builder uses CameraDevice.TEMPLATE_PREVIEW:
mPreviewRequestBuilder = mCameraDevice.createCaptureRequesT(CameraDevice.TEMPLATE_PREVIEW);
For Video recording it uses CameraDevice.TEMPLATE_RECORD;
mPreviewBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_RECORD);
I have checked the descriptions for all templates in CameraDevice class, but still am not sure what is the right way in my case. I have tried to set TEMPLATE_PREVIEW for video recording, and it worked ok, but do I understand it correctly that in this case the quality of the video may be lower? Cause in docs it says the following:
Specifically, this means that high frame rate is given priority over the highest-quality post-processing.