1

Hi i am using the getSupportedVideoSizes method to get the supported video sizes which works great. I just need to know how to get it for front facing cameras only. Thanks

4

1 回答 1

0

调用Camera.open()时像这样传递前置摄像头的IDCamera.open( camId )

要获取前置摄像头的 id,请查看:

    public static int getFrontCameraId() {
        CameraInfo ci = new CameraInfo();
        for (int i = 0 ; i < Camera.getNumberOfCameras(); i++) {
            Camera.getCameraInfo(i, ci);
            if (ci.facing == CameraInfo.CAMERA_FACING_FRONT) return i;
        }
        return -1; // No front-facing camera found
    }

拥有正确的相机实例后,您将获得相关的支持的视频大小。

于 2013-06-29T20:15:54.597 回答