public override void OnDisconnected(CameraDevice camera) { _cameraOpenCloseLock.Release(); camera.Close(); _cameraDeviceStateEventArgs.Camera = null; OnDisconnedted(this, _cameraDeviceStateEventArgs); }
public override void OnOpened(CameraDevice camera) { _cameraOpenCloseLock.Release(); _cameraDeviceStateEventArgs.Camera = camera; OnOpened(this, _cameraDeviceStateEventArgs); _createCameraCaptureSession(); // Creates CameraCaptureSession }
public override void OnError(CameraDevice camera, CameraError error) { _cameraOpenCloseLock.Release(); camera.Close(); _cameraDeviceStateEventArgs.Camera = null; _cameraDeviceStateEventArgs.Error = error; OnError(this, _cameraDeviceStateEventArgs); // Undone: Stop Activity/Service }
/// <summary> /// Closes the camera. /// </summary> /// <returns>Completed Task.</returns> protected virtual Task CloseCamera() { if (CameraCaptureSession != null) { CameraCaptureSession.Close(); CameraCaptureSession = null; } if (CameraDevice != null) { CameraDevice.Close(); CameraDevice = null; } return(Task.CompletedTask); }
public Camera2Controls(Android.Hardware.Camera2.CameraDevice camera) { this.camera = camera; }
internal void SetCamera(Android.Hardware.Camera2.CameraDevice camera) { this.camera = camera; }