【问题标题】:AVCaptureVideoOrientationPortrait issuesAVCapture 视频方向人像问题
【发布时间】:2017-11-19 19:42:34
【问题描述】:

看起来 avcapturevideoorientationportrait 的方向在 iOS 6 中已被弃用,因为我现在正在尝试修复 Vyne(Vine 但它会重写所有内容)应用程序。有人知道新代码吗?这是我当前(已弃用)的代码:

AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:_captureSession];
[previewLayer setFrame:[_previewContainerView bounds]];
[previewLayer setOrientation:AVCaptureVideoOrientationPortrait];
[previewLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill];
[[_previewContainerView layer] addSublayer:previewLayer];

【问题讨论】:

    标签: ios avfoundation


    【解决方案1】:

    那么,如果我们真的查看标题而不是懒惰地让其他人为我们做,会发生什么?

    @property(nonatomic) AVCaptureVideoOrientation orientation 
        NS_DEPRECATED_IOS(4_0, 6_0, 
        "Use AVCaptureConnection's videoOrientation instead.");
    

    如果我像夏洛克·福尔摩斯一样聪明,我可能会得出结论,我们应该改用 AVCaptureConnection 的 videoOrientation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-30
      • 1970-01-01
      • 1970-01-01
      • 2012-10-04
      • 1970-01-01
      相关资源
      最近更新 更多