I have been trying to use GLView’s
createCameraTextureAsync to show a live preview of the camera feed using some shaders, but I realised that the preview does not follow the camera settings, despite being linked to it with a
- The camera view is set at a ratio of
4:3, but the corresponding
cameraTextureis at a ratio of
16:9. When the
GLViewcontainer is constrained to a
4:3size, the image is compressed.
- Also, when flipping cameras (to the front camera), the texture itself is reversed (but this can be adjusted with a shader anyway).
Here is an example snack, where I have overlapped two camera previews with the same dimensions (one with
Camera, and another one with
GLView), one of which being transparent: they should perfectly align. (They don’t.)
One last question, is there any way to disable the camera preview? When using both the
Camera and the
GLView, I have the impression that they are running simultaneously, which seems wasteful.