From 220df8252d19e00a652ac7d337b2ab931eea4b5d Mon Sep 17 00:00:00 2001 From: Chris Ballinger Date: Thu, 14 May 2020 12:48:37 -0700 Subject: [PATCH 1/2] Add target conditionals for Mac Catalyst --- modules/videoio/src/cap_avfoundation.mm | 2 +- modules/videoio/src/cap_ios_abstract_camera.mm | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/videoio/src/cap_avfoundation.mm b/modules/videoio/src/cap_avfoundation.mm index 9d4fc66e8b..6592341bc3 100644 --- a/modules/videoio/src/cap_avfoundation.mm +++ b/modules/videoio/src/cap_avfoundation.mm @@ -383,7 +383,7 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) { [mCaptureDecompressedVideoOutput setVideoSettings:pixelBufferOptions]; mCaptureDecompressedVideoOutput.alwaysDiscardsLateVideoFrames = YES; -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR +#if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) && !TARGET_OS_MACCATALYST mCaptureDecompressedVideoOutput.minFrameDuration = CMTimeMake(1, 30); #endif diff --git a/modules/videoio/src/cap_ios_abstract_camera.mm b/modules/videoio/src/cap_ios_abstract_camera.mm index 032ab850fa..1f698424d8 100644 --- a/modules/videoio/src/cap_ios_abstract_camera.mm +++ b/modules/videoio/src/cap_ios_abstract_camera.mm @@ -299,11 +299,13 @@ } else { +#if !TARGET_OS_MACCATALYST // Deprecated in 6.0; here for backward compatibility if ([self.captureVideoPreviewLayer isOrientationSupported]) { [self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation]; } +#endif } if (parentView != nil) { From d81ac52ce263e6edde17d85cb25ac0b678411fe0 Mon Sep 17 00:00:00 2001 From: Chris Ballinger Date: Thu, 14 May 2020 13:43:03 -0700 Subject: [PATCH 2/2] Remove linking against AssetsLibrary framework --- modules/imgcodecs/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgcodecs/CMakeLists.txt b/modules/imgcodecs/CMakeLists.txt index 50354769e6..92f380ea22 100644 --- a/modules/imgcodecs/CMakeLists.txt +++ b/modules/imgcodecs/CMakeLists.txt @@ -105,7 +105,7 @@ file(GLOB imgcodecs_ext_hdrs if(IOS) list(APPEND imgcodecs_srcs ${CMAKE_CURRENT_LIST_DIR}/src/ios_conversions.mm) - list(APPEND IMGCODECS_LIBRARIES "-framework Accelerate" "-framework CoreGraphics" "-framework QuartzCore" "-framework AssetsLibrary") + list(APPEND IMGCODECS_LIBRARIES "-framework Accelerate" "-framework CoreGraphics" "-framework QuartzCore") endif() if(APPLE_FRAMEWORK) list(APPEND IMGCODECS_LIBRARIES "-framework UIKit")