sixpain
sixpain

Reputation: 354

Android 10: Camera2 Effects not shown in camera preview

I made a simple camera App using Camera2 API, but i have a problem with showing effects in the preview using android 10.

Running the app on OnePlus 5T (Android 9.0), Xiaomi Redmi Note 5 (Android 8.0) and Asus Zenfone 2 Laser (Android 7.1), the effect is correctly applied in both the preview and the photo taken.

Camera Preview on android 9 Photo Taken on android 9

Testing it on Oneplus 7 Pro, Xiaomi Mi 9T, Huawei P30 Pro (Android 10), the effect is not shown in the preview, while is applied once the photo is taken.

Camera Preview on android 10 Photo Taken on android 10

I used in order to apply the effect the following code

previewRequestBuilder = cameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);  
pictureRequestBuilder = cameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);    
previewRequestBuilder.set(CaptureRequest.CONTROL_EFFECT_MODE,CameraMetadata.CONTROL_EFFECT_MODE_NEGATIVE);
pictureRequestBuilder.set(CaptureRequest.CONTROL_EFFECT_MODE,CameraMetadata.CONTROL_EFFECT_MODE_NEGATIVE);

Any idea? I'm pretty sure that the problem is in something changed with CameraMetadata or CaptureRequest in android 10, but i haven't found nothing useful.

Upvotes: 1

Views: 458

Answers (1)

michsalv
michsalv

Reputation: 47

Try to check multicamera support news for android 10

Upvotes: 1

Related Questions