Reputation: 354
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.
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.
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