Ejemplo n.º 1
0
 public new static CameraDeviceAndroid[] GetDevices()
 {
     CameraDevice = CameraDevice ?? new AndroidJavaClass(@"com.olokobayusuf.natcam.CameraDevice");
     Unmanaged    = Unmanaged ?? new AndroidJavaClass(@"com.olokobayusuf.natrender.Unmanaged");
     try {
         using (var devicesArray = CameraDevice.CallStatic <AndroidJavaObject>(@"getDevices")) {
             var devices = AndroidJNIHelper.ConvertFromJNIArray <AndroidJavaObject[]>(devicesArray.GetRawObject());
             var result  = new CameraDeviceAndroid[devices.Length];
             for (var i = 0; i < devices.Length; i++)
             {
                 result[i] = new CameraDeviceAndroid(devices[i]);
             }
             return(result);
         }
     } catch (Exception) { // Permissions denied
         return(null);
     }
 }