public void Release() { CaptureSession.StopRunning(); Recorder.Dispose(); Queue.Dispose(); CaptureSession.RemoveOutput(Output); CaptureSession.RemoveInput(Input); Output.Dispose(); Input.Dispose(); MainDevice.Dispose(); this.RemoveGestureRecognizer(Pinch); }
public void UpdateCameraOption(CameraOptions option) { if (CameraOption == option) { return; } CameraOption = option; var cameraPosition = (CameraOption == CameraOptions.Front) ? AVCaptureDevicePosition.Front : AVCaptureDevicePosition.Back; var device = GetCameraForOrientation(cameraPosition); ConfigureCameraForDevice(device); CaptureSession.BeginConfiguration(); CaptureSession.RemoveInput(captureDeviceInput); captureDeviceInput = AVCaptureDeviceInput.FromDevice(device); CaptureSession.AddInput(captureDeviceInput); CaptureSession.CommitConfiguration(); }
public void CameraButtonTapped() { var devicePosition = captureDeviceInput.Device.Position; if (devicePosition == AVCaptureDevicePosition.Front) { devicePosition = AVCaptureDevicePosition.Back; } else { devicePosition = AVCaptureDevicePosition.Front; } var device = GetCameraForOrientation(devicePosition); // ConfigureCameraForDevice(device); CaptureSession.BeginConfiguration(); CaptureSession.RemoveInput(captureDeviceInput); captureDeviceInput = AVCaptureDeviceInput.FromDevice(device); CaptureSession.AddInput(captureDeviceInput); CaptureSession.CommitConfiguration(); }