Skip to content

Commit

Permalink
Removed jpegPhotoDataRepresentation(forJPEGSampleBuffer because it's …
Browse files Browse the repository at this point in the history
…deprecated.
  • Loading branch information
NikKovIos committed Jan 6, 2022
1 parent cc1cea3 commit 9db1076
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions Source/Pages/Photo/YPPhotoCaptureHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,25 +120,10 @@ extension YPPhotoCaptureHelper {
}

extension YPPhotoCaptureHelper: AVCapturePhotoCaptureDelegate {
@available(iOS 11.0, *)
func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {
guard let data = photo.fileDataRepresentation() else { return }
block?(data)
}

func photoOutput(_ output: AVCapturePhotoOutput,
didFinishProcessingPhoto photoSampleBuffer: CMSampleBuffer?,
previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?,
resolvedSettings: AVCaptureResolvedPhotoSettings,
bracketSettings: AVCaptureBracketedStillImageSettings?,
error: Error?) {
guard let buffer = photoSampleBuffer else { return }
if let data = AVCapturePhotoOutput
.jpegPhotoDataRepresentation(forJPEGSampleBuffer: buffer,
previewPhotoSampleBuffer: previewPhotoSampleBuffer) {
block?(data)
}
}
}

// MARK: - Private
Expand Down

0 comments on commit 9db1076

Please sign in to comment.