Esempio n. 1
0
 // Camera Error event caller
 private void OnCameraError(CameraError error)
 {
     if (CameraError != null)
     {
         CameraError(this, new CameraErrorEventArgs(error));
     }
 }
        public override void OnError(CameraDevice camera, [GeneratedEnum] CameraError error)
        {
            var e = Tuple.Create <CameraDevice, CameraError>(camera, error);

            //  throw new NotImplementedException();
            OnErrorHandler?.Invoke(this, e);
        }
Esempio n. 3
0
 public override void OnError(CameraDevice camera, CameraError error)
 {
     fragment.cameraOpenCloseLock.Release ();
     camera.Close ();
     fragment.cameraDevice = null;
     if (null != fragment.Activity)
         fragment.Activity.Finish ();
 }
 public static int CameraErrorToErrorCode(CameraError error)
 {
     if (!Util.IsCapableOfRunning(10, 1) && error == CameraError.EALREADY)
     {
         return NativeConvert.FromErrno(Errno.EALREADY);
     }
     return (int)error;
 }
Esempio n. 5
0
            public override void OnError(CameraDevice camera, CameraError error)
            {
                fragment.CameraOpenCloseLock.Release();
                camera.Close();
                fragment.CameraDevice = null;

                fragment.Activity?.Finish();
            }
Esempio n. 6
0
 public override void OnError(CameraDevice camera, [GeneratedEnum] CameraError error)
 {
     mCameraHelper.ReleaseCameraOpenCloseLock();
     camera.Close();
     Log.Debug(TAG, "CameraDevice onError!");
     //Set camera devite as null
     mCameraHelper.SetCameraDevice(null);
 }
Esempio n. 7
0
 public override void OnError(CameraDevice cameraDevice, CameraError error)
 {
     cameraDevice.Close();
     Owner.mCameraDevice = null;
     if (Owner == null)
     {
         return;
     }
 }
 private static string ErrorCodeString(CameraError error)
 {
     switch (error)
     {
         case CameraError.EOK:
             return "The function call to the camera completed successfully.";
         case CameraError.EAGAIN:
             return "The function call failed because the specified camera was not available. Try to call the function again.";
         case CameraError.EINVAL:
             return "The function call failed because of an invalid argument.";
         case CameraError.ENODEV:
             return "The function call failed because the specified camera was not found.";
         case CameraError.EMFILE:
             return "The function call failed because of a file table overflow.";
         case CameraError.EBADF:
             return "The function call failed because an invalid handle to a camera handle value was used.";
         case CameraError.EACCES:
             return "The function call failed because the necessary permissions to access the camera are not available.";
         case CameraError.EBADR:
             return "The function call failed because an invalid file descriptor was used.";
         case CameraError.ENODATA:
             return "The function call failed because the requested data does not exist.";
         case CameraError.ENOENT:
             return "The function call failed because the specified file or directory does not exist.";
         case CameraError.ENOMEM:
             return "The function call failed because memory allocation failed.";
         case CameraError.EOPNOTSUPP:
             return "The function call failed because the requested operation is not supported.";
         case CameraError.ETIMEDOUT:
             return "The function call failed due to communication problem or time-out with the camera.";
         case CameraError.EALREADY:
             return "The function call failed because an operation on the camera is already in progress. In addition, this error can indicate that a call could not be completed because it was invalid or completed already.";
         case CameraError.EBUSY:
             return "The function call failed because the camera is busy. Typically you receive this error when you try to open a camera while the camera or its required resources are in use.";
         case CameraError.ENOSPC:
             return "The function call failed because the disk is full. This typically happens when you are trying to start a video recording and less than the system-reserved amount of disk space remains.";
         case CameraError.EUNINIT:
             return "The function call failed because the Camera library has not been initialized.";
         case CameraError.EREGFAULT:
             return "The function call failed because the registration of a callback failed.";
         case CameraError.EMICINUSE:
             return "The function call failed because the microphone is already in use.";
         case CameraError.EDESKTOPCAMERAINUSE:
             return "The function call failed because the operation cannot be completed while the desktop camera is in use.";
         case CameraError.EPOWERDOWN:
             return "The function call failed because the camera is in the power down state.";
         case CameraError.THREE_ALOCKED:
             return "The function call failed because the 3A have been locked.";
         case CameraError.EVIEWFINDERFROZEN:
             return "The function call failed because the freeze flag was set on the device.";
         case CameraError.EOVERFLOW:
             return "The function call failed due to an internal overflow.";
         case CameraError.ETHERMALSHUTDOWN:
             return "The function call failed because the camera is in power down state to prevent damage due to excessive heat.";
     }
     return string.Format("Unknown error: {0}", error);
 }
Esempio n. 9
0
 public override void OnError(CameraDevice camera, CameraError error)
 {
     recordManager.cameraOpenCloseLock.Release();
     camera.Close();
     recordManager.cameraDevice = null;
     if (null != activity)
     {
         activity.Finish();
     }
 }
Esempio n. 10
0
 public override void OnError(CameraDevice camera, CameraError error)
 {
     fragment.cameraOpenCloseLock.Release();
     camera.Close();
     fragment.cameraDevice = null;
     if (null != fragment.Activity)
     {
         fragment.MakeError(error);
         //fragment.Activity.Finish();
     }
 }
            public override void OnError(CameraDevice camera, [GeneratedEnum] CameraError error)
            {
                var handler = Error;

                if (handler != null)
                {
                    handler(cameraManager, new CameraDeviceEventArgs {
                        Camera = camera, Error = error
                    });
                }
            }
        public override void OnError(CameraDevice camera, CameraError error)
        {
            camera.Close();
            fragment.camera_device = null;
            if (null != fragment.Activity)
            {
                fragment.Activity.Finish();
            }

            fragment.opening_camera = false;
        }
Esempio n. 13
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
        }
Esempio n. 14
0
 public override void OnError(CameraDevice camera, CameraError error)
 {
     camera.Close();
     if (Page != null)
     {
         Page.mCameraDevice = null;
         Activity activity = Page.Activity;
         Page.mOpeningCamera = false;
         if (activity != null)
         {
             activity.Finish();
         }
     }
 }
        public override void OnError(CameraDevice cameraDevice, CameraError error)
        {
            owner.mCameraOpenCloseLock.Release();
            cameraDevice.Close();
            owner.mCameraDevice = null;
            if (owner == null)
                return;
            Activity activity = owner.Activity;
            if (activity != null)
            {
                activity.Finish();
            }

        }
        public override void OnError(CameraDevice cameraDevice, CameraError error)
        {
            _owner.CameraOpenCloseLock.Release();
            cameraDevice.Close();
            _owner.CurrentCameraDevice = null;
            if (_owner == null)
            {
                return;
            }
            Activity activity = _owner.Activity;

            if (activity != null)
            {
                activity.Finish();
            }
        }
Esempio n. 17
0
        public override void OnError(CameraDevice cameraDevice, CameraError error)
        {
            owner.mCameraOpenCloseLock.Release();
            cameraDevice.Close();
            owner.mCameraDevice = null;
            if (owner == null)
            {
                return;
            }

            /*
             * Activity activity = owner.Activity;
             * if (activity != null)
             * {
             *  activity.Finish();
             * }
             */
        }
        public override void OnError(CameraDevice cameraDevice, CameraError error)
        {
            _camera2.CameraOpenCloseLock.Release();
            cameraDevice.Close();
            _camera2.CameraDevice = null;

            if (_camera2 == null)
            {
                return;
            }

            var activity = _camera2.Activity;

            if (activity != null)
            {
                activity.Finish();
            }
        }
Esempio n. 19
0
        internal static void ThrowIfError(CameraError errorCode, string errorMessage = null,
                                          [CallerMemberName] string caller           = null, [CallerLineNumber] int line = 0)
        {
            if (errorCode == CameraError.None)
            {
                return;
            }

            Log.Info(CameraLog.Tag, "errorCode : " + errorCode.ToString() + ", Caller : " + caller + ", line " + line.ToString());

            switch (errorCode)
            {
            case CameraError.InvalidParameter:
                throw new ArgumentException(errorMessage);

            case CameraError.OutOfMemory:
                throw new OutOfMemoryException(errorMessage);

            case CameraError.DeviceError:
            case CameraError.DeviceBusy:
            case CameraError.Esd:
                throw new CameraDeviceException(errorMessage);

            case CameraError.DeviceNotFound:
                throw new CameraDeviceNotFoundException(errorMessage);

            case CameraError.SecurityRestricted:
            case CameraError.PermissionDenied:
                throw new UnauthorizedAccessException(errorMessage);

            case CameraError.NotSupported:
                throw new NotSupportedException(errorMessage);

            case CameraError.InvalidState:
            case CameraError.InvalidOperation:
            case CameraError.ResourceConflict:
            case CameraError.ServiceDisconnected:
                throw new InvalidOperationException(errorMessage);

            default:
                throw new Exception("Unknown error : " + errorCode);
            }
        }
Esempio n. 20
0
        public override void OnError(CameraDevice cameraDevice, CameraError error)
        {
            Log.Error(TAG, "OnError");

            owner.mCameraOpenCloseLock.Release();
            cameraDevice.Close();
            owner.mCameraDevice = null;

            if (owner == null)
            {
                return;
            }

            //Activity activity = owner.Activity;
            //if (activity != null)
            //{
            //    activity.Finish();
            //}

            if (owner != null)
            {
                owner.Finish();
            }
        }
Esempio n. 21
0
 public CameraException(CameraError error, string message)
     : this(error, message, null)
 {
 }
Esempio n. 22
0
 public CameraException(CameraError error, string message, Exception innerException)
     : base(message, innerException)
 {
     ErrorCode = error;
 }
Esempio n. 23
0
 public static int CameraErrorToErrorCode(CameraError error)
 {
     if (!Util.IsCapableOfRunning(10, 1) && error == CameraError.EALREADY)
     {
         return NativeConvert.FromErrno(Errno.EALREADY);
     }
     return (int)error;
 }
Esempio n. 24
0
 private static string ErrorCodeString(CameraError error)
 {
     switch (error)
     {
         case CameraError.EOK:
             return "The function call to the camera completed successfully.";
         case CameraError.EAGAIN:
             return "The function call failed because the specified camera was not available. Try to call the function again.";
         case CameraError.EINVAL:
             return "The function call failed because of an invalid argument.";
         case CameraError.ENODEV:
             return "The function call failed because the specified camera was not found.";
         case CameraError.EMFILE:
             return "The function call failed because of a file table overflow.";
         case CameraError.EBADF:
             return "The function call failed because an invalid handle to a camera handle value was used.";
         case CameraError.EACCES:
             return "The function call failed because the necessary permissions to access the camera are not available.";
         case CameraError.EBADR:
             return "The function call failed because an invalid file descriptor was used.";
         case CameraError.ENODATA:
             return "The function call failed because the requested data does not exist.";
         case CameraError.ENOENT:
             return "The function call failed because the specified file or directory does not exist.";
         case CameraError.ENOMEM:
             return "The function call failed because memory allocation failed.";
         case CameraError.EOPNOTSUPP:
             return "The function call failed because the requested operation is not supported.";
         case CameraError.ETIMEDOUT:
             return "The function call failed due to communication problem or time-out with the camera.";
         case CameraError.EALREADY:
             return "The function call failed because an operation on the camera is already in progress. In addition, this error can indicate that a call could not be completed because it was invalid or completed already.";
         case CameraError.EBUSY:
             return "The function call failed because the camera is busy. Typically you receive this error when you try to open a camera while the camera or its required resources are in use.";
         case CameraError.ENOSPC:
             return "The function call failed because the disk is full. This typically happens when you are trying to start a video recording and less than the system-reserved amount of disk space remains.";
         case CameraError.EUNINIT:
             return "The function call failed because the Camera library has not been initialized.";
         case CameraError.EREGFAULT:
             return "The function call failed because the registration of a callback failed.";
         case CameraError.EMICINUSE:
             return "The function call failed because the microphone is already in use.";
         case CameraError.EDESKTOPCAMERAINUSE:
             return "The function call failed because the operation cannot be completed while the desktop camera is in use.";
         case CameraError.EPOWERDOWN:
             return "The function call failed because the camera is in the power down state.";
         case CameraError.THREE_ALOCKED:
             return "The function call failed because the 3A have been locked.";
         case CameraError.EVIEWFINDERFROZEN:
             return "The function call failed because the freeze flag was set on the device.";
         case CameraError.EOVERFLOW:
             return "The function call failed due to an internal overflow.";
         case CameraError.ETHERMALSHUTDOWN:
             return "The function call failed because the camera is in power down state to prevent damage due to excessive heat.";
     }
     return string.Format("Unknown error: {0}", error);
 }
Esempio n. 25
0
 public CameraException(CameraError error, Exception innerException)
     : this(error, ErrorCodeString(error), innerException)
 {
 }
Esempio n. 26
0
 public CameraException(CameraError error)
     : this(error, (Exception)null)
 {
 }