【问题标题】:Implementing AVCapturePhotoCaptureDelegate in Xamarin.iOS在 Xamarin.iOS 中实现 AVCapturePhotoCaptureDelegate
【发布时间】:2018-02-18 00:04:18
【问题描述】:

我尝试在 Xamarin.iOS 中针对 iOS 11 实现 AVCapturePhotoCaptureDelegate,但我还没有找到一个可行的示例。

大多数示例使用缓冲区实现已弃用的方法,但目前唯一支持的方法是:

void DidFinishProcessingPhoto(AVCapturePhotoOutput output,
                    AVCapturePhoto photo, Foundation.NSError error);

我找到了一些针对 iOS 11 的更新教程,但他们通常建议使用 AVCapturePhoto.fileDataRepresentation method,但由于某种原因,这似乎在 Xamarin 中不可用。

能否请您指出如何在 Xamarin 中从 AVCapturePhoto 检索 JPEG 和 RAW 数据?

更新

我检查了Apple documentation 中的AVCapturePhoto,似乎Xamarin.iOS class 缺少许多其他成员,例如bracketSettings,但只有imageRepresentation 相关的方法实际上在代码中不可用。

我将非常感谢对此原因的解释,因为如果没有数据表示方法,除了使用已弃用的委托方法之外,似乎没有任何方便的方法可以从 AVCapturePhoto 检索 UIImage .

【问题讨论】:

    标签: ios xamarin xamarin.ios avfoundation


    【解决方案1】:

    这是一个为 Xcode 9.3 支持/里程碑计划的开放错误/问题:

    回复:https://github.com/xamarin/xamarin-macios/blob/4da8016db4330bde0a09b4a5453a26427ca6685d/tests/xtro-sharpie/iOS-AVFoundation.ignore

    !missing-selector! +AVCapturePhotoBracketSettings::photoBracketSettingsWithRawPixelFormatType:rawFileType:processedFormat:processedFileType:bracketedSettings: not bound
    !missing-selector! AVCapturePhoto::fileDataRepresentationWithReplacementMetadata:replacementEmbeddedThumbnailPhotoFormat:replacementEmbeddedThumbnailPixelBuffer:replacementDepthData: not bound
    !missing-selector! AVCapturePhotoOutput::availableLivePhotoVideoCodecTypes not bound
    !missing-selector! AVCapturePhotoOutput::isCameraCalibrationDataDeliverySupported not bound
    !missing-selector! AVCapturePhotoOutput::isDualCameraDualPhotoDeliveryEnabled not bound
    !missing-selector! AVCapturePhotoOutput::isDualCameraDualPhotoDeliverySupported not bound
    !missing-selector! AVCapturePhotoOutput::setDualCameraDualPhotoDeliveryEnabled: not bound
    !missing-selector! AVCaptureResolvedPhotoSettings::embeddedThumbnailDimensions not bound
    !missing-selector! AVCaptureResolvedPhotoSettings::expectedPhotoCount not bound
    

    【讨论】:

    • 非常感谢!即使经过一个小时的搜索,我也没有偶然发现这个:-)
    • @MartinZikmund 我必须自己为客户实现它们,所以我知道它们丢失了:-(
    猜你喜欢
    • 2013-05-22
    • 2020-07-01
    • 1970-01-01
    • 2021-11-19
    • 2023-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-23
    相关资源
    最近更新 更多