AVCamManual.AVCamManualCameraViewController.DidFinishProcessingPhoto C# (CSharp) Метод

DidFinishProcessingPhoto() приватный Метод

private DidFinishProcessingPhoto ( AVCapturePhotoOutput captureOutput, CMSampleBuffer photoSampleBuffer, CMSampleBuffer previewPhotoSampleBuffer, AVCaptureResolvedPhotoSettings resolvedSettings, AVCaptureBracketedStillImageSettings bracketSettings, NSError error ) : void
captureOutput AVCapturePhotoOutput
photoSampleBuffer CMSampleBuffer
previewPhotoSampleBuffer CMSampleBuffer
resolvedSettings AVCaptureResolvedPhotoSettings
bracketSettings AVCaptureBracketedStillImageSettings
error NSError
Результат void
		void DidFinishProcessingPhoto (AVCapturePhotoOutput captureOutput,
									   CMSampleBuffer photoSampleBuffer, CMSampleBuffer previewPhotoSampleBuffer,
									   AVCaptureResolvedPhotoSettings resolvedSettings, AVCaptureBracketedStillImageSettings bracketSettings,
									   NSError error)
		{
			if (photoSampleBuffer == null) {
				Console.WriteLine ($"Error occurred while capturing photo: {error}");
				return;
			}

			NSData imageData = AVCapturePhotoOutput.GetJpegPhotoDataRepresentation (photoSampleBuffer, previewPhotoSampleBuffer);
			PHPhotoLibrary.RequestAuthorization (status => {
				if (status == PHAuthorizationStatus.Authorized) {
					PHPhotoLibrary.SharedPhotoLibrary.PerformChanges (() => {
						PHAssetCreationRequest.CreationRequestForAsset ().AddResource (PHAssetResourceType.Photo, imageData, null);
					}, (success, err) => {
						if (!success) {
							Console.WriteLine ($"Error occurred while saving photo to photo library: {err}");
						} else {
							Console.WriteLine ("Photo was saved to photo library");
						}
					});
				} else {
					Console.WriteLine ("Not authorized to save photo");
				}
			});
		}