From: Marijan Vukcevich Date: Tue, 4 Feb 2014 18:10:50 +0000 (-0800) Subject: Update cap_ios_abstract_camera.mm X-Git-Tag: accepted/tizen/ivi/20140515.103456~1^2~72^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a98cd6e6520d348b0be067360236c50181e9983;p=profile%2Fivi%2Fopencv.git Update cap_ios_abstract_camera.mm AVCaptureVideoPreviewLayer setOrientation is depricated. This fixes the warning and provides backward compatibility. --- diff --git a/modules/highgui/src/cap_ios_abstract_camera.mm b/modules/highgui/src/cap_ios_abstract_camera.mm index a77e200..6675a9d 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;