Skip to content

Commit 87595a6

Browse files
committed
Merge pull request opencv#9779 from Lightricks:feature/assetslibrary-remove-link
2 parents 56fe2dc + 0d979a7 commit 87595a6

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

modules/videoio/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,7 @@ if(IOS)
222222
${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_photo_camera.mm
223223
${CMAKE_CURRENT_LIST_DIR}/src/cap_ios_video_camera.mm)
224224

225-
list(APPEND VIDEOIO_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework AssetsLibrary")
226-
if(APPLE_FRAMEWORK)
227-
list(APPEND VIDEOIO_LIBRARIES "-framework UIKit")
228-
endif()
225+
list(APPEND VIDEOIO_LIBRARIES "-framework Accelerate" "-framework AVFoundation" "-framework CoreGraphics" "-framework CoreImage" "-framework CoreMedia" "-framework CoreVideo" "-framework QuartzCore" "-framework UIKit")
229226
endif()
230227

231228
if(WIN32)

modules/videoio/src/cap_ios_video_camera.mm

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#import "opencv2/videoio/cap_ios.h"
3333
#include "precomp.hpp"
34-
#import <AssetsLibrary/AssetsLibrary.h>
34+
#import <UIKit/UIKit.h>
3535

3636

3737
static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
@@ -626,11 +626,7 @@ - (void)saveVideo;
626626
return;
627627
}
628628

629-
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
630-
if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:[self videoFileURL]]) {
631-
[library writeVideoAtPathToSavedPhotosAlbum:[self videoFileURL]
632-
completionBlock:^(NSURL *assetURL, NSError *error){ (void)assetURL; (void)error; }];
633-
}
629+
UISaveVideoAtPathToSavedPhotosAlbum([self videoFileString], nil, nil, NULL);
634630
}
635631

636632

0 commit comments

Comments
 (0)