diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt index b48c52bb5827850ed38bb84528086a284009e668..0ded292f0c24192d33a171a0e713b2f15e7111f8 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -222,10 +222,7 @@ if(IOS) ${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_photo_camera.mm ${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_video_camera.mm) - list(APPEND VIDEOIO_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework AssetsLibrary") - if(APPLE_FRAMEWORK) - list(APPEND VIDEOIO_LIBRARIES "-framework UIKit") - endif() + list(APPEND VIDEOIO_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework UIKit") endif() if(WIN32) diff --git a/modules/videoio/src/cap_ios_video_camera.mm b/modules/videoio/src/cap_ios_video_camera.mm index 8a19a47f2fd5d0c04d2c9f12a70e6435b7934d12..94c1bab4b0254c95a3f0bae48538836492f9c627 100644 --- a/modules/videoio/src/cap_ios_video_camera.mm +++ b/modules/videoio/src/cap_ios_video_camera.mm @@ -31,7 +31,7 @@ #import "opencv2/videoio/cap_ios.h" #include "precomp.hpp" -#import <AssetsLibrary/AssetsLibrary.h> +#import <UIKit/UIKit.h> static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} @@ -626,11 +626,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;} return; } - ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; - if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:[self videoFileURL]]) { - [library writeVideoAtPathToSavedPhotosAlbum:[self videoFileURL] - completionBlock:^(NSURL *assetURL, NSError *error){ (void)assetURL; (void)error; }]; - } + UISaveVideoAtPathToSavedPhotosAlbum([self videoFileString], nil, nil, NULL); }