Fix customPreviewLayer layout issue when rotateVideo is NO in iOS

pull/10124/head
zhongwuzw 7 years ago
parent 438e456ce9
commit 01b581048d
  1. 3
      modules/videoio/src/cap_ios_video_camera.mm

@ -353,7 +353,8 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
// create a custom preview layer // create a custom preview layer
self.customPreviewLayer = [CALayer layer]; self.customPreviewLayer = [CALayer layer];
self.customPreviewLayer.bounds = CGRectMake(0, 0, self.parentView.frame.size.width, self.parentView.frame.size.height); self.customPreviewLayer.bounds = CGRectMake(0, 0, self.parentView.frame.size.width, self.parentView.frame.size.height);
[self layoutPreviewLayer]; self.customPreviewLayer.position = CGPointMake(self.parentView.frame.size.width/2., self.parentView.frame.size.height/2.);
[self updateOrientation];
// create a serial dispatch queue used for the sample buffer delegate as well as when a still image is captured // create a serial dispatch queue used for the sample buffer delegate as well as when a still image is captured
// a serial dispatch queue must be used to guarantee that video frames will be delivered in order // a serial dispatch queue must be used to guarantee that video frames will be delivered in order

Loading…
Cancel
Save