private void AutoFocusThread() { try { CameraDevice.AutoFocus(); } catch (Exception exception) { Log.Error("Unable to autofocus", exception); StaticHelper.Instance.SystemMessage = exception.Message; } }
private void StartLiveViewThread() { lock (_locker) { try { ServiceProvider.Instance.OnMessage(Messages.ClearBusy); bool retry = false; int retryNum = 0; Log.Debug("LiveView: Liveview started"); do { try { CameraDevice.StartLiveView(); if (!CaptureWithNoAf) { CameraDevice.AutoFocus(); } } catch (DeviceException deviceException) { if (deviceException.ErrorCode == ErrorCodes.ERROR_BUSY || deviceException.ErrorCode == ErrorCodes.MTP_Device_Busy) { Thread.Sleep(100); Log.Debug("Retry live view :" + deviceException.ErrorCode.ToString("X")); retry = true; retryNum++; } else { throw; } } catch (EosException eosException) { if (eosException.EosErrorCode == EosErrorCode.DeviceBusy) { Thread.Sleep(100); Log.Debug("Retry live view :"); retry = true; retryNum++; } else { throw; } } } while (retry && retryNum < 35); _isLiveViewPaused = false; _Livetimer.Start(); Log.Debug("LiveView: Liveview start done"); IsLiveViewEnable = true; } catch (Exception exception) { Log.Error("Unable to start liveview !", exception); StaticHelper.Instance.SystemMessage = "Unable to start liveview ! " + exception.Message; } } }