📜  Android Camera2 获取前置摄像头的摄像头 ID - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:18.251000             🧑  作者: Mango

代码示例1
CameraCharacteristics cameraCharacteristics = manager.getCameraCharacteristics(cameraId);

        if (cameraCharacteristics == null)
            throw new NullPointerException("No camera with id " + cameraId);

        return cameraCharacteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;