Closed Vibinreji closed 5 years ago
Please check this function and see if the front-facing camera cannot be found:
Yes there is chooseCameraIdByFacing().But still it is not working.I am using moto x play.
Sorry I cannot reproduce this, please try to debug with the source code. I guess there is something wrong with finding the front camera.
okay.
okay.
Got solution?
Does CameraView support onTouch for Swipe action?
This library is a good starting point to understand the complex Camera2 API, so I'm using it in a client's project. I've found this issue to be a common one among our test devices, so I went through the source code and I this that the issue here is at Camera2Photographer, method chooseCameraIdByFacing. In my case, the camera is not changing to the frontal one, because it has INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY mark in its INFO_SUPPORTED_HARDWARE_LEVEL property at the CameraCharacteristics object. I don't know yet why you are ignoring these cameras, but I think it has to do with the limitations of the hardware, as stated here: https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY But I don't see any reason to do that, because in my phone, for example, both cameras (front and back) have INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY level, and the library is working with the back camera. But when I try to switch to the front one, it refuses and force selects again the back camera here:
updateCameraInfo(ids[0], cameraManager.getCameraCharacteristics(ids[0]));
Am I right? Any advice about this?
Got solution ?
Camera flip to front camera not working