package com.unity3d.player;

import android.hardware.Camera;
import android.view.MotionEvent;
import java.util.ArrayList;
import java.util.List;

/* loaded from: /storage/emulated/0/Documents/jadec/sources/com.UBI.A90.WW/dex-files/2.dex */
public final class h {
    public static int a() {
        return Camera.getNumberOfCameras();
    }

    public static int a(MotionEvent motionEvent) {
        return motionEvent.getSource();
    }

    public static List a(Camera.Parameters parameters) {
        List<int[]> supportedPreviewFpsRange = parameters.getSupportedPreviewFpsRange();
        return supportedPreviewFpsRange != null ? supportedPreviewFpsRange : new ArrayList();
    }

    public static void a(Camera.Parameters parameters, int[] iArr) {
        parameters.setPreviewFpsRange(iArr[0], iArr[1]);
    }

    public static boolean a(int i) {
        Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
        Camera.getCameraInfo(i, cameraInfo);
        return cameraInfo.facing == 1;
    }

    public static int b(int i) {
        Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
        Camera.getCameraInfo(i, cameraInfo);
        return cameraInfo.orientation;
    }

    public static void b(Camera.Parameters parameters) {
        if (parameters.getSupportedFocusModes().contains("continuous-video")) {
            parameters.setFocusMode("continuous-video");
        }
    }

    public static Camera c(int i) {
        return Camera.open(i);
    }
}
