From 9a98cd6e6520d348b0be067360236c50181e9983 Mon Sep 17 00:00:00 2001 From: Marijan Vukcevich Date: Tue, 4 Feb 2014 10:10:50 -0800 Subject: [PATCH 1/3] Update cap_ios_abstract_camera.mm AVCaptureVideoPreviewLayer setOrientation is depricated. This fixes the warning and provides backward compatibility. --- modules/highgui/src/cap_ios_abstract_camera.mm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/highgui/src/cap_ios_abstract_camera.mm b/modules/highgui/src/cap_ios_abstract_camera.mm index a77e200a8..6675a9db6 100644 --- a/modules/highgui/src/cap_ios_abstract_camera.mm +++ b/modules/highgui/src/cap_ios_abstract_camera.mm @@ -278,9 +278,21 @@ { self.captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession]; - if ([self.captureVideoPreviewLayer isOrientationSupported]) { - [self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation]; - } + if ([self.captureVideoPreviewLayer respondsToSelector:@selector(connection)]) + { + if ([self.captureVideoPreviewLayer.connection isVideoOrientationSupported]) + { + [self.captureVideoPreviewLayer.connection setVideoOrientation:self.defaultAVCaptureVideoOrientation]; + } + } + else + { + // Deprecated in 6.0; here for backward compatibility + if ([self.captureVideoPreviewLayer isOrientationSupported]) + { + [self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation]; + } + } if (parentView != nil) { self.captureVideoPreviewLayer.frame = self.parentView.bounds; From cc529d971b7fb6b459c9cc5acde44cf1afded5d9 Mon Sep 17 00:00:00 2001 From: Alexander Shishkov Date: Mon, 17 Feb 2014 17:37:02 +0400 Subject: [PATCH 2/3] removed tabs --- .../highgui/src/cap_ios_abstract_camera.mm | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/modules/highgui/src/cap_ios_abstract_camera.mm b/modules/highgui/src/cap_ios_abstract_camera.mm index 6675a9db6..e5c70724b 100644 --- a/modules/highgui/src/cap_ios_abstract_camera.mm +++ b/modules/highgui/src/cap_ios_abstract_camera.mm @@ -279,20 +279,20 @@ self.captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession]; if ([self.captureVideoPreviewLayer respondsToSelector:@selector(connection)]) - { - if ([self.captureVideoPreviewLayer.connection isVideoOrientationSupported]) - { - [self.captureVideoPreviewLayer.connection setVideoOrientation:self.defaultAVCaptureVideoOrientation]; - } - } - else - { - // Deprecated in 6.0; here for backward compatibility - if ([self.captureVideoPreviewLayer isOrientationSupported]) - { - [self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation]; - } - } + { + if ([self.captureVideoPreviewLayer.connection isVideoOrientationSupported]) + { + [self.captureVideoPreviewLayer.connection setVideoOrientation:self.defaultAVCaptureVideoOrientation]; + } + } + else + { + // Deprecated in 6.0; here for backward compatibility + if ([self.captureVideoPreviewLayer isOrientationSupported]) + { + [self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation]; + } + } if (parentView != nil) { self.captureVideoPreviewLayer.frame = self.parentView.bounds; @@ -302,9 +302,6 @@ NSLog(@"[Camera] created AVCaptureVideoPreviewLayer"); } - - - - (void)setDesiredCameraPosition:(AVCaptureDevicePosition)desiredPosition; { for (AVCaptureDevice *device in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) { From 77df5948e78cc630c8f6478f276b386c8affaa61 Mon Sep 17 00:00:00 2001 From: Alexander Shishkov Date: Tue, 18 Feb 2014 13:56:26 +0400 Subject: [PATCH 3/3] removed trailing spaces --- modules/highgui/src/cap_ios_abstract_camera.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/highgui/src/cap_ios_abstract_camera.mm b/modules/highgui/src/cap_ios_abstract_camera.mm index e5c70724b..b40b3648d 100644 --- a/modules/highgui/src/cap_ios_abstract_camera.mm +++ b/modules/highgui/src/cap_ios_abstract_camera.mm @@ -291,7 +291,7 @@ if ([self.captureVideoPreviewLayer isOrientationSupported]) { [self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation]; - } + } } if (parentView != nil) {