Как получить функцию масштабирования в AVCaptureVideoPreviewLayer target-c? - PullRequest
0 голосов
/ 10 октября 2018

Как добавить функцию масштабирования и фильтры в AVCaptureVideoPreviewLayer?

  • (void) loadView

{

self.view = [[UIView alloc] initWithFrame: [[UIScreen mainScreen] bounds]];

self.view.backgroundColor = [UIColor blackColor];

AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:_captureSession];
previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
previewLayer.frame = self.view.bounds;
[[self.view layer] addSublayer:previewLayer];
[self.view addSubview:[self createOverlay]];
_activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
_activityIndicator.center = self.view.center;

[self.view addSubview:_activityIndicator];
[_activityIndicator startAnimating];

}

...