デリゲート メソッドから pixelBuffer を取得したいdidFinishProcessingPhoto
のですが、nil です。
func capturePhoto() {
let format = [AVVideoCodecKey: AVVideoCodecType.jpeg]
let settings = AVCapturePhotoSettings(format: format)
output.capturePhoto(with: settings, delegate: self)
}
および拡張子:
extension CaptureSessionManager: AVCapturePhotoCaptureDelegate {
func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {
guard let pixelBuffer = photo.pixelBuffer else {
return
}
bufferSubject.onNext(pixelBuffer)
}
}
その前に、明らかに出力をセッションに追加しています。このデリゲートとは別の方法を使用する必要がありますか?