Diff of /modules/highgui/src/cap_ios_abstract_camera.mm [9a98cd] .. [cc529d]  Maximize  Restore

Switch to unified view

a/modules/highgui/src/cap_ios_abstract_camera.mm b/modules/highgui/src/cap_ios_abstract_camera.mm
...
...
277
- (void)createVideoPreviewLayer;
277
- (void)createVideoPreviewLayer;
278
{
278
{
279
    self.captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession];
279
    self.captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession];
280
280
281
    if ([self.captureVideoPreviewLayer respondsToSelector:@selector(connection)])
281
    if ([self.captureVideoPreviewLayer respondsToSelector:@selector(connection)])
282
  {
282
    {
283
      if ([self.captureVideoPreviewLayer.connection isVideoOrientationSupported])
283
        if ([self.captureVideoPreviewLayer.connection isVideoOrientationSupported])
284
      {
284
        {
285
          [self.captureVideoPreviewLayer.connection setVideoOrientation:self.defaultAVCaptureVideoOrientation];
285
            [self.captureVideoPreviewLayer.connection setVideoOrientation:self.defaultAVCaptureVideoOrientation];
286
      }
286
        }
287
  }
287
    }
288
  else
288
    else
289
  {
289
    {
290
      // Deprecated in 6.0; here for backward compatibility
290
        // Deprecated in 6.0; here for backward compatibility
291
      if ([self.captureVideoPreviewLayer isOrientationSupported])
291
        if ([self.captureVideoPreviewLayer isOrientationSupported])
292
      {
292
        {
293
          [self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation];
293
            [self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation];
294
      }                
294
        }                
295
  }
295
    }
296
296
297
    if (parentView != nil) {
297
    if (parentView != nil) {
298
        self.captureVideoPreviewLayer.frame = self.parentView.bounds;
298
        self.captureVideoPreviewLayer.frame = self.parentView.bounds;
299
        self.captureVideoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
299
        self.captureVideoPreviewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
300
        [self.parentView.layer addSublayer:self.captureVideoPreviewLayer];
300
        [self.parentView.layer addSublayer:self.captureVideoPreviewLayer];
301
    }
301
    }
302
    NSLog(@"[Camera] created AVCaptureVideoPreviewLayer");
302
    NSLog(@"[Camera] created AVCaptureVideoPreviewLayer");
303
}
303
}
304
305
306
307
304
308
- (void)setDesiredCameraPosition:(AVCaptureDevicePosition)desiredPosition;
305
- (void)setDesiredCameraPosition:(AVCaptureDevicePosition)desiredPosition;
309
{
306
{
310
    for (AVCaptureDevice *device in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) {
307
    for (AVCaptureDevice *device in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) {
311
        if ([device position] == desiredPosition) {
308
        if ([device position] == desiredPosition) {

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks