Ejemplo n.º 1
0
        public override void OnDisconnected(CameraDevice camera)
        {
            _cameraOpenCloseLock.Release();

            camera.Close();

            _cameraDeviceStateEventArgs.Camera = null;
            OnDisconnedted(this, _cameraDeviceStateEventArgs);
        }
Ejemplo n.º 2
0
        public override void OnOpened(CameraDevice camera)
        {
            _cameraOpenCloseLock.Release();

            _cameraDeviceStateEventArgs.Camera = camera;
            OnOpened(this, _cameraDeviceStateEventArgs);

            _createCameraCaptureSession();               // Creates CameraCaptureSession
        }
Ejemplo n.º 3
0
        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
        }
Ejemplo n.º 4
0
        /// <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;
 }