Commit 621a1d3b authored by Yaron Inger's avatar Yaron Inger Committed by Alexander Alekhin

videoio: remove AssetsLibrary dependency.

The entire AssetsLibrary framework is deprecated since iOS 8.0. The code
used in the camera example code can use UIKit to save videos to the
camera instead, which allows to avoid linking with PhotoKit instead to
prevent increasing the iOS deployment target.
parent 14b686cd
...@@ -241,7 +241,7 @@ endif(HAVE_INTELPERC) ...@@ -241,7 +241,7 @@ endif(HAVE_INTELPERC)
if(IOS) if(IOS)
add_definitions(-DHAVE_IOS=1) add_definitions(-DHAVE_IOS=1)
list(APPEND highgui_srcs src/ios_conversions.mm src/cap_ios_abstract_camera.mm src/cap_ios_photo_camera.mm src/cap_ios_video_camera.mm) list(APPEND highgui_srcs src/ios_conversions.mm src/cap_ios_abstract_camera.mm src/cap_ios_photo_camera.mm src/cap_ios_video_camera.mm)
list(APPEND HIGHGUI_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework AssetsLibrary") list(APPEND HIGHGUI_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework UIKit")
endif() endif()
if(WIN32) if(WIN32)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#import "opencv2/highgui/cap_ios.h" #import "opencv2/highgui/cap_ios.h"
#include "precomp.hpp" #include "precomp.hpp"
#import <AssetsLibrary/AssetsLibrary.h> #import <UIKit/UIKit.h>
static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}; static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;};
...@@ -595,11 +595,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}; ...@@ -595,11 +595,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;};
return; return;
} }
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; UISaveVideoAtPathToSavedPhotosAlbum([self videoFileString], nil, nil, NULL);
if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:[self videoFileURL]]) {
[library writeVideoAtPathToSavedPhotosAlbum:[self videoFileURL]
completionBlock:^(NSURL *assetURL, NSError *error){ (void)assetURL; (void)error; }];
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment