我正在使用AVCaptureSession
带有重力AVCaptureVideoPreviewLayer
的a。AVLayerVideoGravityResizeAspectFill
self.captureSession =[[AVCaptureSession alloc] init];
captureSession.sessionPreset = AVCaptureSessionPresetPhoto;
self.previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession];
[self.previewLayer setVideoGravity: AVLayerVideoGravityResizeAspectFill];
如何知道如何调整视频大小以适应预览区域AVLayerVideoGravityResizeAspectFill
?图像的哪个部分在预览区域中可见?
从文档:
AVLayerVideoGravityResizeAspectFill:保留纵横比,但填充可用屏幕区域,必要时裁剪视频
基本上,如何准确获取 previewLayer 中显示的内容?