diff --git a/APIDiffs/api-diffs-2.0.0.md b/APIDiffs/api-diffs-2.0.0.md new file mode 100644 index 00000000..d237b012 --- /dev/null +++ b/APIDiffs/api-diffs-2.0.0.md @@ -0,0 +1,15 @@ +# PLShortVideoKit 1.16.1 to 2.0.0 API Differences + +## General Headers + +``` +PLShortVideoRecorder.h +``` + +- *Added* - (void)toggleCamera:(void(^)(BOOL isFinish))completeBlock; + +``` +PLSVideoMixRecorder.h +``` + +- *Added* - (void)toggleCamera:(void(^)(BOOL isFinish))completeBlock; \ No newline at end of file diff --git a/Example/PLShortVideoKitDemo.xcodeproj/project.pbxproj b/Example/PLShortVideoKitDemo.xcodeproj/project.pbxproj index 221cc012..225e039d 100644 --- a/Example/PLShortVideoKitDemo.xcodeproj/project.pbxproj +++ b/Example/PLShortVideoKitDemo.xcodeproj/project.pbxproj @@ -204,6 +204,7 @@ 76F41C52219D77B40099E668 /* mulitRate.png in Resources */ = {isa = PBXBuildFile; fileRef = 76F41C51219D77B40099E668 /* mulitRate.png */; }; 9343A8C01F66763A007213BD /* Time_Machine_No_Reverser.png in Resources */ = {isa = PBXBuildFile; fileRef = 9343A8BE1F66763A007213BD /* Time_Machine_No_Reverser.png */; }; 9343A8C11F66763A007213BD /* Time_Machine_Reverser.png in Resources */ = {isa = PBXBuildFile; fileRef = 9343A8BF1F66763A007213BD /* Time_Machine_Reverser.png */; }; + BC8DD6BA224E320200E05B26 /* PLScreenRecorderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8DD6B9224E320200E05B26 /* PLScreenRecorderManager.m */; }; BCCF75E121C3884500BF9BA2 /* ImageVideoMixViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCCF75DF21C3884500BF9BA2 /* ImageVideoMixViewController.m */; }; C35043641FB3152600F9633D /* draft_video.png in Resources */ = {isa = PBXBuildFile; fileRef = C35043631FB3121E00F9633D /* draft_video.png */; }; C35043971FBED6B900F9633D /* music_no_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = C35043941FBED11C00F9633D /* music_no_selected.png */; }; @@ -488,6 +489,8 @@ 85B60FAE619932ED649E6840 /* Pods-PLShortVideoKitDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PLShortVideoKitDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.release.xcconfig"; sourceTree = ""; }; 9343A8BE1F66763A007213BD /* Time_Machine_No_Reverser.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Time_Machine_No_Reverser.png; path = images/Time_Machine_No_Reverser.png; sourceTree = ""; }; 9343A8BF1F66763A007213BD /* Time_Machine_Reverser.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Time_Machine_Reverser.png; path = images/Time_Machine_Reverser.png; sourceTree = ""; }; + BC8DD6B8224E320200E05B26 /* PLScreenRecorderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLScreenRecorderManager.h; sourceTree = ""; }; + BC8DD6B9224E320200E05B26 /* PLScreenRecorderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PLScreenRecorderManager.m; sourceTree = ""; }; BCCF75DF21C3884500BF9BA2 /* ImageVideoMixViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageVideoMixViewController.m; sourceTree = ""; }; BCCF75E021C3884500BF9BA2 /* ImageVideoMixViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageVideoMixViewController.h; sourceTree = ""; }; C35043631FB3121E00F9633D /* draft_video.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = draft_video.png; path = images/draft_video.png; sourceTree = ""; }; @@ -875,6 +878,8 @@ 0A6340301F15E8CC005ADF6C /* PLSSelectionView.m */, 0A534EA8200E27F00032A981 /* PLSViewRecorderManager.h */, 0A534EAA200E27F10032A981 /* PLSViewRecorderManager.m */, + BC8DD6B8224E320200E05B26 /* PLScreenRecorderManager.h */, + BC8DD6B9224E320200E05B26 /* PLScreenRecorderManager.m */, ); path = "UI+Tools"; sourceTree = ""; @@ -1236,6 +1241,7 @@ 0AD98DC4203173F5006551EC /* H265MovieViewController.m in Sources */, 760AE4F820B014FD00DA4EC3 /* VideoSelectViewController.m in Sources */, 760F7706202AF92A0052F513 /* BaseViewController.m in Sources */, + BC8DD6BA224E320200E05B26 /* PLScreenRecorderManager.m in Sources */, 0A398F6C1ED6259000996229 /* PhotoAlbumViewController.m in Sources */, 0AE8AC951F063E3E006166E2 /* PLSClipAudioView.m in Sources */, C39EA3D71F4E753D0007D1C3 /* PLSRateButtonView.m in Sources */, diff --git a/Example/PLShortVideoKitDemo/EditViewController.m b/Example/PLShortVideoKitDemo/EditViewController.m index 841f3904..10a7d49e 100644 --- a/Example/PLShortVideoKitDemo/EditViewController.m +++ b/Example/PLShortVideoKitDemo/EditViewController.m @@ -1153,6 +1153,9 @@ - (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL { } [self.shortVideoEditor addMVLayerWithColor:self.colorURL alpha:self.alphaURL timeRange:kCMTimeRangeZero loopEnable:YES]; + if (![self.shortVideoEditor isEditing]) { + [self.shortVideoEditor startEditing]; + } } - (void)addFilter:(NSString *)colorImagePath { @@ -2249,7 +2252,9 @@ - (void)nextButtonClick { } // 添加背景音乐信息 - [self.audioSettingsArray insertObject:self.backgroundAudioSettings atIndex:0]; + if (self.backgroundAudioSettings[PLSURLKey] && ![self.audioSettingsArray containsObject:self.backgroundAudioSettings]) { + [self.audioSettingsArray insertObject:self.backgroundAudioSettings atIndex:0]; + } AVAsset *asset = self.movieSettings[PLSAssetKey]; PLSAVAssetExportSession *exportSession = [[PLSAVAssetExportSession alloc] initWithAsset:asset]; @@ -2271,8 +2276,12 @@ - (void)nextButtonClick { // 旋转视频 exportSession.videoLayerOrientation = self.videoLayerOrientation; - [exportSession addFilter:self.colorImagePath]; - [exportSession addMVLayerWithColor:self.colorURL alpha:self.alphaURL timeRange:kCMTimeRangeZero loopEnable:YES]; + if (self.colorImagePath) { + [exportSession addFilter:self.colorImagePath]; + } + if (self.colorURL && self.alphaURL) { + [exportSession addMVLayerWithColor:self.colorURL alpha:self.alphaURL timeRange:kCMTimeRangeZero loopEnable:YES]; + } __weak typeof(self) weakSelf = self; [exportSession setCompletionBlock:^(NSURL *url) { @@ -2295,7 +2304,9 @@ - (void)nextButtonClick { [exportSession setProcessingBlock:^(float progress) { // 更新进度 UI NSLog(@"Asset Export Progress: %f", progress); - weakSelf.progressLabel.text = [NSString stringWithFormat:@"%d%%", (int)(progress * 100)]; + dispatch_async(dispatch_get_main_queue(), ^{ + weakSelf.progressLabel.text = [NSString stringWithFormat:@"%d%%", (int)(progress * 100)]; + }); }]; [exportSession exportAsynchronously]; diff --git a/Example/PLShortVideoKitDemo/Info.plist b/Example/PLShortVideoKitDemo/Info.plist index aeae327e..f91c572b 100644 --- a/Example/PLShortVideoKitDemo/Info.plist +++ b/Example/PLShortVideoKitDemo/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.16.1 + 2.0.0 CFBundleVersion - 1.16.1.git-2019-01-28-eac39a6 + 2.0.0.git-2019-03-29-1d37a62 Fabric APIKey diff --git a/Example/PLShortVideoKitDemo/Librarys/libMuseProcessor.a b/Example/PLShortVideoKitDemo/Librarys/libMuseProcessor.a index bc296285..ed5e2127 100644 Binary files a/Example/PLShortVideoKitDemo/Librarys/libMuseProcessor.a and b/Example/PLShortVideoKitDemo/Librarys/libMuseProcessor.a differ diff --git a/Example/PLShortVideoKitDemo/RecordViewController.m b/Example/PLShortVideoKitDemo/RecordViewController.m index 9c3e0681..9b2ecbca 100644 --- a/Example/PLShortVideoKitDemo/RecordViewController.m +++ b/Example/PLShortVideoKitDemo/RecordViewController.m @@ -17,6 +17,7 @@ #import "PLSFilterGroup.h" #import "PLSViewRecorderManager.h" #import "PLSRateButtonView.h" +#import "PLScreenRecorderManager.h" #define AlertViewShow(msg) [[[UIAlertView alloc] initWithTitle:@"warning" message:[NSString stringWithFormat:@"%@", msg] delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil] show] @@ -37,13 +38,15 @@ @interface RecordViewController () UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, PLSViewRecorderManagerDelegate, -PLSRateButtonViewDelegate +PLSRateButtonViewDelegate, +PLScreenRecorderManagerDelegate > @property (strong, nonatomic) PLSVideoConfiguration *videoConfiguration; @property (strong, nonatomic) PLSAudioConfiguration *audioConfiguration; @property (strong, nonatomic) PLShortVideoRecorder *shortVideoRecorder; @property (strong, nonatomic) PLSViewRecorderManager *viewRecorderManager; +@property (strong, nonatomic) PLScreenRecorderManager *screenRecorderManager; @property (strong, nonatomic) PLSProgressBar *progressBar; @property (strong, nonatomic) UIButton *recordButton; @property (strong, nonatomic) UIButton *viewRecordButton; @@ -88,6 +91,8 @@ @interface RecordViewController () @property (strong, nonatomic) UIButton *monitorButton; // 实时截图按钮 @property (strong, nonatomic) UIButton *snapshotButton; +// 帧率切换按钮 +@property (strong, nonatomic) UIButton *frameRateButton; // 录制前是否开启自动检测设备方向调整视频拍摄的角度(竖屏、横屏) @property (assign, nonatomic) BOOL isUseAutoCheckDeviceOrientationBeforeRecording; @@ -166,10 +171,11 @@ - (void)setupShortVideoRecorder { self.videoConfiguration = [PLSVideoConfiguration defaultConfiguration]; self.videoConfiguration.position = AVCaptureDevicePositionFront; - self.videoConfiguration.videoFrameRate = 25; - self.videoConfiguration.averageVideoBitRate = 1024*1000; - self.videoConfiguration.videoSize = CGSizeMake(544, 960); + self.videoConfiguration.videoFrameRate = 30; + self.videoConfiguration.averageVideoBitRate = 1000*2500; + self.videoConfiguration.videoSize = CGSizeMake(720, 1280); self.videoConfiguration.videoOrientation = AVCaptureVideoOrientationPortrait; + self.videoConfiguration.sessionPreset = AVCaptureSessionPreset1280x720; self.audioConfiguration = [PLSAudioConfiguration defaultConfiguration]; @@ -393,6 +399,17 @@ - (void)setupRightButtonView { [self.musicButton addTarget:self action:@selector(musicButtonOnClick:) forControlEvents:UIControlEventTouchUpInside]; [self.rightScrollView addSubview:self.musicButton]; + index ++; + // 30FPS/60FPS + self.frameRateButton = [[UIButton alloc] initWithFrame:CGRectMake(0, index * 60 + 10, 46, 46)]; + self.frameRateButton.layer.cornerRadius = 23; + self.frameRateButton.backgroundColor = backgroundColor; + [self.frameRateButton setTitle:@"30帧" forState:(UIControlStateNormal)]; + self.frameRateButton.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.frameRateButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [self.frameRateButton addTarget:self action:@selector(frameRateButtonOnClick:) forControlEvents:UIControlEventTouchUpInside]; + [self.rightScrollView addSubview:self.frameRateButton]; + index ++; //是否开启 SDK 退到后台监听 self.monitorButton = [UIButton buttonWithType:UIButtonTypeCustom]; @@ -544,6 +561,7 @@ - (void)getFirstMovieFromPhotoAlbum { - (void)backButtonEvent:(id)sender { if (self.viewRecordButton.isSelected) { [self.viewRecorderManager cancelRecording]; + [self.screenRecorderManager cancelRecording]; } if ([self.shortVideoRecorder getFilesCount] > 0) { self.alertView = [[UIAlertView alloc] initWithTitle:@"提醒" message:[NSString stringWithFormat:@"放弃这个视频(共%ld个视频段)?", (long)[self.shortVideoRecorder getFilesCount]] delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; @@ -559,7 +577,7 @@ - (void)squareRecordButtonEvent:(id)sender { UIButton *button = (UIButton *)sender; button.selected = !button.selected; if (button.selected) { - self.videoConfiguration.videoSize = CGSizeMake(480, 480); + self.videoConfiguration.videoSize = CGSizeMake(720, 720); [self.shortVideoRecorder reloadvideoConfiguration:self.videoConfiguration]; self.shortVideoRecorder.maxDuration = 10.0f; @@ -571,7 +589,7 @@ - (void)squareRecordButtonEvent:(id)sender { }); } else { - self.videoConfiguration.videoSize = CGSizeMake(544, 960); + self.videoConfiguration.videoSize = CGSizeMake(720, 1280); [self.shortVideoRecorder reloadvideoConfiguration:self.videoConfiguration]; self.shortVideoRecorder.maxDuration = 10.0f; @@ -585,26 +603,39 @@ - (void)squareRecordButtonEvent:(id)sender { //录制 self.view - (void)viewRecorderButtonClick:(id)sender { - if (!self.viewRecorderManager) { - self.viewRecorderManager = [[PLSViewRecorderManager alloc] initWithRecordedView:self.view]; - self.viewRecorderManager.delegate = self; - } - - if (self.viewRecordButton.isSelected) { - self.viewRecordButton.selected = NO; - [self.viewRecorderManager stopRecording]; - - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillResignActiveNotification object:nil]; - } - else { - self.viewRecordButton.selected = YES; - [self.viewRecorderManager startRecording]; + if (@available(iOS 11.0, *)) { + if (!self.screenRecorderManager) { + self.screenRecorderManager = [[PLScreenRecorderManager alloc] init]; + self.screenRecorderManager.delegate = self; + } + if (self.viewRecordButton.isSelected) { + self.viewRecordButton.selected = NO; + [self.screenRecorderManager stopRecording]; + } else { + self.viewRecordButton.selected = YES; + [self.screenRecorderManager startRecording]; + } + } else { + if (!self.viewRecorderManager) { + self.viewRecorderManager = [[PLSViewRecorderManager alloc] initWithRecordedView:self.shortVideoRecorder.previewView]; + self.viewRecorderManager.delegate = self; + } - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(applicationWillResignActive:) - name:UIApplicationWillResignActiveNotification - object:nil]; - } + if (self.viewRecordButton.isSelected) { + self.viewRecordButton.selected = NO; + [self.viewRecorderManager stopRecording]; + + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillResignActiveNotification object:nil]; + } + else { + self.viewRecordButton.selected = YES; + [self.viewRecorderManager startRecording]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(applicationWillResignActive:) + name:UIApplicationWillResignActiveNotification + object:nil]; + }} } // 打开/关闭闪光灯 @@ -626,8 +657,22 @@ - (void)beautyFaceButtonEvent:(id)sender { } // 切换前后置摄像头 -- (void)toggleCameraButtonEvent:(id)sender { - [self.shortVideoRecorder toggleCamera]; +- (void)toggleCameraButtonEvent:(UIButton *)sender { + // 采集帧率不大于 30 帧的时候,使用 [self.shortVideoRecorder toggleCamera] 和 [self.shortVideoRecorder toggleCamera:block] 都可以。当采集大于 30 帧的时候,为确保切换成功,需要先停止采集,再切换相机,切换完成再启动采集。如果不先停止采集,部分机型上采集 60 帧的时候,切换摄像头可能会耗时几秒钟 + if (self.videoConfiguration.videoFrameRate > 30) { + sender.enabled = NO; + __weak typeof(self) weakself = self; + [self.shortVideoRecorder stopCaptureSession]; + [self.shortVideoRecorder toggleCamera:^(BOOL isFinish) { + [weakself checkActiveFormat];// 默认的 active 可能最大只支持采集 30 帧,这里手动设置一下 + [weakself.shortVideoRecorder startCaptureSession]; + dispatch_async(dispatch_get_main_queue(), ^{ + sender.enabled = YES; + }); + }]; + } else { + [self.shortVideoRecorder toggleCamera]; + } } // 七牛滤镜 @@ -671,6 +716,23 @@ - (void)musicButtonOnClick:(id)sender { } } +- (void)frameRateButtonOnClick:(UIButton *)button { + if (60 == self.videoConfiguration.videoFrameRate) { + self.videoConfiguration.videoFrameRate = 30; + self.videoConfiguration.averageVideoBitRate = 1000 * 2500; + self.videoConfiguration.sessionPreset = AVCaptureSessionPreset1280x720; + [button setTitle:@"30帧" forState:(UIControlStateNormal)]; + [self.shortVideoRecorder reloadvideoConfiguration:self.videoConfiguration]; + } else { + self.videoConfiguration.videoFrameRate = 60; + self.videoConfiguration.averageVideoBitRate = 1000 * 3500; + self.videoConfiguration.sessionPreset = AVCaptureSessionPresetInputPriority; + [button setTitle:@"60帧" forState:(UIControlStateNormal)]; + [self.shortVideoRecorder reloadvideoConfiguration:self.videoConfiguration]; + [self checkActiveFormat]; + } +} + // 拍照 -(void)snapshotButtonOnClick:(UIButton *)sender { sender.enabled = NO; @@ -767,6 +829,7 @@ - (void)endButtonEvent:(id)sender { AVAsset *asset = self.shortVideoRecorder.assetRepresentingAllFiles; [self playEvent:asset]; [self.viewRecorderManager cancelRecording]; + [self.screenRecorderManager cancelRecording]; self.viewRecordButton.selected = NO; } @@ -857,6 +920,31 @@ - (void)viewRecorderManager:(PLSViewRecorderManager *)manager didFinishRecording [self presentViewController:videoEditViewController animated:YES completion:nil]; } +#pragma mark - PLScreenRecorderManagerDelegate +- (void)screenRecorderManager:(PLScreenRecorderManager *)manager didFinishRecordingToAsset:(AVAsset *)asset totalDuration:(CGFloat)totalDuration { + self.viewRecordButton.selected = NO; + // 设置音视频、水印等编辑信息 + NSMutableDictionary *outputSettings = [[NSMutableDictionary alloc] init]; + // 待编辑的原始视频素材 + NSMutableDictionary *plsMovieSettings = [[NSMutableDictionary alloc] init]; + plsMovieSettings[PLSAssetKey] = asset; + plsMovieSettings[PLSStartTimeKey] = [NSNumber numberWithFloat:0.f]; + plsMovieSettings[PLSDurationKey] = [NSNumber numberWithFloat:totalDuration]; + plsMovieSettings[PLSVolumeKey] = [NSNumber numberWithFloat:1.0f]; + outputSettings[PLSMovieSettingsKey] = plsMovieSettings; + + EditViewController *videoEditViewController = [[EditViewController alloc] init]; + videoEditViewController.settings = outputSettings; + [self presentViewController:videoEditViewController animated:YES completion:nil]; +} + +- (void)screenRecorderManager:(PLScreenRecorderManager *)manager errorOccur:(NSError *)error { + NSString *message = [NSString stringWithFormat:@"%@", error]; + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"错误" message:message delegate:nil cancelButtonTitle:@"确定" otherButtonTitles: nil]; + [alert show]; + self.viewRecordButton.selected = NO; +} + #pragma mark -- PLShortVideoRecorderDelegate 摄像头/麦克风鉴权的回调 - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didGetCameraAuthorizationStatus:(PLSAuthorizationStatus)status { if (status == PLSAuthorizationStatusAuthorized) { @@ -916,6 +1004,7 @@ - (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didRecordingToOutput self.importMovieView.hidden = YES; self.musicButton.hidden = YES; self.filePathButton.hidden = YES; + self.frameRateButton.hidden = YES; self.durationLabel.text = [NSString stringWithFormat:@"%.2fs", totalDuration]; } @@ -933,6 +1022,7 @@ - (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didDeleteFileAtURL:( self.importMovieView.hidden = NO; self.musicButton.hidden = NO; self.filePathButton.hidden = NO; + self.frameRateButton.hidden = NO; } AVAsset *asset = [AVAsset assetWithURL:_URL]; @@ -1211,5 +1301,39 @@ - (void)applicationDidBecomeActive:(id)sender { NSLog(@"%s, %d, applicationDidBecomeActive:", __func__, __LINE__); } +- (void)checkActiveFormat { + + CGSize needCaptureSize = self.videoConfiguration.videoSize; + + if (AVCaptureVideoOrientationPortrait == self.videoConfiguration.videoOrientation || + AVCaptureVideoOrientationPortraitUpsideDown == self.videoConfiguration.videoOrientation) { + needCaptureSize = CGSizeMake(self.videoConfiguration.videoSize.height, self.videoConfiguration.videoSize.width); + } + + AVCaptureDeviceFormat *activeFormat = self.shortVideoRecorder.videoActiveFormat; + AVFrameRateRange *frameRateRange = [activeFormat.videoSupportedFrameRateRanges firstObject]; + + CMVideoDimensions captureSize = CMVideoFormatDescriptionGetDimensions(activeFormat.formatDescription); + if (frameRateRange.maxFrameRate < self.videoConfiguration.videoFrameRate || + frameRateRange.minFrameRate > self.videoConfiguration.videoFrameRate || + needCaptureSize.width > captureSize.width || + needCaptureSize.height > captureSize.height) { + + NSArray *videoFormats = self.shortVideoRecorder.videoFormats; + for (AVCaptureDeviceFormat *format in videoFormats) { + frameRateRange = [format.videoSupportedFrameRateRanges firstObject]; + captureSize = CMVideoFormatDescriptionGetDimensions(format.formatDescription); + + if (frameRateRange.maxFrameRate >= self.videoConfiguration.videoFrameRate && + frameRateRange.minFrameRate <= self.videoConfiguration.videoFrameRate && + captureSize.width >= needCaptureSize.width && + captureSize.height >= needCaptureSize.height) { + NSLog(@"size = {%d x %d}, fps = %f ~ %f", captureSize.width, captureSize.height, frameRateRange.minFrameRate, frameRateRange.maxFrameRate); + self.shortVideoRecorder.videoActiveFormat = format; + break; + } + } + } +} @end diff --git a/Example/PLShortVideoKitDemo/SegmentEffects/MulitClipViewController.m b/Example/PLShortVideoKitDemo/SegmentEffects/MulitClipViewController.m index c1da9c87..9f9de124 100644 --- a/Example/PLShortVideoKitDemo/SegmentEffects/MulitClipViewController.m +++ b/Example/PLShortVideoKitDemo/SegmentEffects/MulitClipViewController.m @@ -369,7 +369,7 @@ - (void)clipView:(PLSClipMulitMediaView *)clipView finishClip:(NSArray +#import + +NS_ASSUME_NONNULL_BEGIN + +@class PLScreenRecorderManager; + +@protocol PLScreenRecorderManagerDelegate + +@optional +- (void)screenRecorderManager:(PLScreenRecorderManager *)manager didFinishRecordingToAsset:(AVAsset *)asset totalDuration:(CGFloat)totalDuration; +- (void)screenRecorderManager:(PLScreenRecorderManager *)manager errorOccur:(NSError *)error; +@end + +@interface PLScreenRecorderManager : NSObject + +@property (weak, nonatomic) id delegate; + +- (void)startRecording; + +- (void)stopRecording; + +- (void)cancelRecording; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Example/PLShortVideoKitDemo/UI+Tools/PLScreenRecorderManager.m b/Example/PLShortVideoKitDemo/UI+Tools/PLScreenRecorderManager.m new file mode 100644 index 00000000..5b4c5bbf --- /dev/null +++ b/Example/PLShortVideoKitDemo/UI+Tools/PLScreenRecorderManager.m @@ -0,0 +1,152 @@ +// +// PLScreenRecorderManager.m +// PLShortVideoKitDemo +// +// Created by hxiongan on 2019/3/28. +// Copyright © 2019年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import "PLScreenRecorderManager.h" +#import +#include +#import + +@interface PLScreenRecorderManager () + +@property (nonatomic, strong) PLShortVideoRecorder *shortVideoRecorder; +@property (nonatomic, weak) RPScreenRecorder *screenRecorder; + +@end + + +@implementation PLScreenRecorderManager + +- (instancetype)init { + self = [super init]; + if (self) { + [self setupShortRecorder]; + [self setupScreenRecorder]; + } + return self; +} + +- (void)setupShortRecorder { + PLSVideoConfiguration *videoConfiguration = [PLSVideoConfiguration defaultConfiguration]; + videoConfiguration.videoFrameRate = 60; + videoConfiguration.videoSize = CGSizeMake(720, 1280); + videoConfiguration.averageVideoBitRate = 3500 * 1000; + PLSAudioConfiguration *audioConfiguration = [PLSAudioConfiguration defaultConfiguration]; + self.shortVideoRecorder = [[PLShortVideoRecorder alloc] initWithVideoConfiguration:videoConfiguration audioConfiguration:audioConfiguration captureEnabled:NO]; + self.shortVideoRecorder.maxDuration = 120; + self.shortVideoRecorder.delegate = self; + self.shortVideoRecorder.backgroundMonitorEnable = NO; +} + +- (void)setupScreenRecorder { + self.screenRecorder = [RPScreenRecorder sharedRecorder]; + self.screenRecorder.microphoneEnabled = YES; +} + +- (void)startRecording { + __weak typeof(self) weakSelf = self; + if (@available(iOS 11.0, *)) { + + [weakSelf.screenRecorder startCaptureWithHandler:^(CMSampleBufferRef _Nonnull sampleBuffer, RPSampleBufferType bufferType, NSError * _Nullable error) { + if (RPSampleBufferTypeVideo == bufferType) { + [weakSelf.shortVideoRecorder writePixelBuffer:CMSampleBufferGetImageBuffer(sampleBuffer) timeStamp:CMSampleBufferGetPresentationTimeStamp(sampleBuffer)]; + } else if (RPSampleBufferTypeAudioMic == bufferType){ + [weakSelf.shortVideoRecorder writeSampleBuffer:sampleBuffer]; + } + } completionHandler:^(NSError * _Nullable error) { + if (error) { + dispatch_async(dispatch_get_main_queue(), ^{ + if ([weakSelf.delegate respondsToSelector:@selector(screenRecorderManager:errorOccur:)]) { + [weakSelf.delegate screenRecorderManager:weakSelf errorOccur:error]; + } + [weakSelf cancelRecording]; + }); + } else { + dispatch_sync(dispatch_get_main_queue(), ^{ + // 注意: [shortVideoRecorder startRecording] 需要再主线程中执行,不然拍的时长会不正确 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; + [weakSelf.shortVideoRecorder deleteAllFiles]; + [weakSelf.shortVideoRecorder startRecording]; + }); + } + }]; + } else { + // Fallback on earlier versions + } +} + +- (void)stopRecording { + if (@available(iOS 11.0, *)) { + [self.screenRecorder stopCaptureWithHandler:^(NSError * _Nullable error) { + if (error) { + NSLog(@"screenRecorder stop error: %@", error); + } + }]; + } else { + // Fallback on earlier versions + } + [self.shortVideoRecorder stopRecording]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil]; +} + +- (void)cancelRecording { + if (@available(iOS 11.0, *)) { + [self.screenRecorder stopCaptureWithHandler:^(NSError * _Nullable error) { + if (error) { + NSLog(@"screenRecorder stop error: %@", error); + } + }]; + } else { + // Fallback on earlier versions + } + NSLog(@"cancel"); + [self.shortVideoRecorder cancelRecording]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil]; +} + +- (void)applicationDidEnterBackground:(id)sender { + [self stopRecording]; +} + +- (void)dealloc { + [self cancelRecording]; + NSLog(@"dealloc: %@", self.description); +} + +#pragma mark - Recorder Delegate + +// 开始录制一段视频时 +- (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didStartRecordingToOutputFileAtURL:(NSURL *)fileURL { + NSLog(@"start recording fileURL: %@", fileURL); +} + +// 完成一段视频的录制时 +- (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didFinishRecordingToOutputFileAtURL:(NSURL *)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration { + NSLog(@"finish recording fileURL: %@, fileDuration: %f, totalDuration: %f", fileURL, fileDuration, totalDuration); + + AVAsset *asset = self.shortVideoRecorder.assetRepresentingAllFiles; + if (self.delegate && [self.delegate respondsToSelector:@selector(screenRecorderManager:didFinishRecordingToAsset:totalDuration:)]) { + [self.delegate screenRecorderManager:self didFinishRecordingToAsset:asset totalDuration:totalDuration]; + } +} + +// 在达到指定的视频录制时间 maxDuration 后,如果再调用 [PLShortVideoRecorder startRecording],直接执行该回调 +- (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didFinishRecordingMaxDuration:(CGFloat)maxDuration { + NSLog(@"finish recording maxDuration: %f", maxDuration); + if (@available(iOS 11.0, *)) { + [self.screenRecorder stopCaptureWithHandler:^(NSError * _Nullable error) {}]; + } else { + // Fallback on earlier versions + } + AVAsset *asset = self.shortVideoRecorder.assetRepresentingAllFiles; + if (self.delegate && [self.delegate respondsToSelector:@selector(screenRecorderManager:didFinishRecordingToAsset:totalDuration:)]) { + [self.delegate screenRecorderManager:self didFinishRecordingToAsset:asset totalDuration:maxDuration]; + } +} + +@end + diff --git a/Example/Podfile.lock b/Example/Podfile.lock index e6e0ed5b..0fb8105a 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -5,13 +5,13 @@ PODS: - FLAnimatedImage (1.0.12) - HappyDNS (0.3.14) - Masonry (1.0.2) - - PLShortVideoKit (1.16.1): - - PLShortVideoKit/ex-libMuseProcessor (= 1.16.1) - - PLShortVideoKit/libMuseProcessor (= 1.16.1) + - PLShortVideoKit (2.0.0): + - PLShortVideoKit/ex-libMuseProcessor (= 2.0.0) + - PLShortVideoKit/libMuseProcessor (= 2.0.0) - Qiniu (= 7.2.5) - - PLShortVideoKit/ex-libMuseProcessor (1.16.1): + - PLShortVideoKit/ex-libMuseProcessor (2.0.0): - Qiniu (= 7.2.5) - - PLShortVideoKit/libMuseProcessor (1.16.1): + - PLShortVideoKit/libMuseProcessor (2.0.0): - Qiniu (= 7.2.5) - Qiniu (7.2.5): - HappyDNS (~> 0.3) @@ -43,7 +43,7 @@ SPEC CHECKSUMS: FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31 HappyDNS: dc6a164ee81979093123c241c6353bcf0218add6 Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e - PLShortVideoKit: 1261bb8af6184d15f9d1eebad748a5bdcc52cb62 + PLShortVideoKit: 1eb46e83fc541451a62d088f295cfccff8b84b91 Qiniu: 909b408ee489ea54827e9717be90b94bc9dfbc48 PODFILE CHECKSUM: 464a1d9cdafee0a2337603af681aa59f2814b116 diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/AVAsset+PLSExtendProperty.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/AVAsset+PLSExtendProperty.h index b2417f58..3006ffe5 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/AVAsset+PLSExtendProperty.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/AVAsset+PLSExtendProperty.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAVAssetExportSession.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAVAssetExportSession.h index c5ae5824..1a128624 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAVAssetExportSession.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAVAssetExportSession.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioConfiguration.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioConfiguration.h index 94e0a928..93f6a03c 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioConfiguration.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioMixConfiguration.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioMixConfiguration.h index c36a0715..abc4cdea 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioMixConfiguration.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioMixConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSComposeMediaItem.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSComposeMediaItem.h index 14eb0dd7..84812d22 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSComposeMediaItem.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSComposeMediaItem.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditPlayer.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditPlayer.h index 8f182a0f..125ca2d7 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditPlayer.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditPlayer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSEditPlayer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditPlayer.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditSettings.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditSettings.h index c16edf18..9779a781 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditSettings.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditSettings.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSEditSettings.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditSettings.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFadeTranstion.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFadeTranstion.h index 4ccfe97d..e130821c 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFadeTranstion.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFadeTranstion.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFilter.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFilter.h index fe0edb2d..63c11e9e 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFilter.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFilter.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSFilter.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFilter.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSGifComposer.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSGifComposer.h index 0cca4e3c..765e55c5 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSGifComposer.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSGifComposer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSGifComposer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSGifComposer.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageRotateRecorder.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageRotateRecorder.h index a9de0e4d..cb42a7a0 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageRotateRecorder.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageRotateRecorder.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageSetting.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageSetting.h index 5f3b0a9c..866dc7df 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageSetting.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageSetting.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSImageSetting.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageSetting.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageToMovieComposer.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageToMovieComposer.h index eb55182f..0a5f0cf0 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageToMovieComposer.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageToMovieComposer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageVideoComposer.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageVideoComposer.h index 0561aca5..474d3d07 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageVideoComposer.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageVideoComposer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMixMediaItem.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMixMediaItem.h index fc2f7412..888f7143 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMixMediaItem.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMixMediaItem.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMovieComposer.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMovieComposer.h index 695dcf6d..d80705a0 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMovieComposer.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMovieComposer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSMovieComposer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMovieComposer.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMultiVideoMixer.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMultiVideoMixer.h index d236bd19..33b6faaf 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMultiVideoMixer.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMultiVideoMixer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSPositionTransition.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSPositionTransition.h index d939aba0..476a904b 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSPositionTransition.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSPositionTransition.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSPositionTransition.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSPositionTransition.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMedia.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMedia.h index 8dc03581..ad9acd13 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMedia.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMedia.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMedia.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMedia.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMediaTools.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMediaTools.h index 79b82c42..647c5380 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMediaTools.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMediaTools.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMovieExport.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMovieExport.h index 1275f06d..f0dfc22e 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMovieExport.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMovieExport.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSReverserEffect.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSReverserEffect.h index 9b01273f..ec750516 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSReverserEffect.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSReverserEffect.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSReverserEffect.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSReverserEffect.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRotateTransition.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRotateTransition.h index f17116e3..301cd5ce 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRotateTransition.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRotateTransition.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSRotateTransition.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRotateTransition.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSScaleTransition.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSScaleTransition.h index c18ada24..df6cf752 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSScaleTransition.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSScaleTransition.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSScaleTransition.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSScaleTransition.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTextSetting.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTextSetting.h index a6227904..613d6d0d 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTextSetting.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTextSetting.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSTextSetting.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTextSetting.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransition.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransition.h index 28f33069..b5525292 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransition.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransition.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSTransition.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransition.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransitionMaker.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransitionMaker.h index c9e83cca..961a8ad9 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransitionMaker.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransitionMaker.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTypeDefines.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTypeDefines.h index 25a88277..abe8940e 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTypeDefines.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTypeDefines.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSTypeDefines.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTypeDefines.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderConfiguration.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderConfiguration.h index 9da44da6..8db4b0ef 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderConfiguration.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderResponseInfo.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderResponseInfo.h index 94583791..222a7e69 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderResponseInfo.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderResponseInfo.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoConfiguration.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoConfiguration.h index f1dbd5ba..4dc6fdac 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoConfiguration.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixConfiguration.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixConfiguration.h index c2a9e6de..e5e5791f 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixConfiguration.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixRecorder.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixRecorder.h index 7abbbb4c..52d17161 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixRecorder.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixRecorder.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoAsset.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoAsset.h index aa615417..6920cbc4 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoAsset.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoAsset.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoEditor.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoEditor.h index 986fb29e..017e855c 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoEditor.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoEditor.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKit.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKit.h index ec5123a9..ba560a9d 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKit.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKit.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoKit.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoKit.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKitEnv.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKitEnv.h index 747b964d..6d6b081e 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKitEnv.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKitEnv.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoRecorder.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoRecorder.h index be64002c..d5c1c4b7 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoRecorder.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoRecorder.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoTranscoder.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoTranscoder.h index 0a5f9af6..26ded8a3 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoTranscoder.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoTranscoder.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h \ No newline at end of file diff --git a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoUploader.h b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoUploader.h index 657c3c9d..feaacaab 120000 --- a/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoUploader.h +++ b/Example/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoUploader.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h \ No newline at end of file diff --git a/Example/Pods/Local Podspecs/PLShortVideoKit.podspec.json b/Example/Pods/Local Podspecs/PLShortVideoKit.podspec.json index dd7a97d4..ba0be00f 100644 --- a/Example/Pods/Local Podspecs/PLShortVideoKit.podspec.json +++ b/Example/Pods/Local Podspecs/PLShortVideoKit.podspec.json @@ -1,6 +1,6 @@ { "name": "PLShortVideoKit", - "version": "1.16.1", + "version": "2.0.0", "summary": "PILI iOS short video record SDK", "homepage": "https://github.com/pili-engineering/PLShortVideoKit", "license": "Apache License 2.0", @@ -8,7 +8,7 @@ "pili": "pili@qiniu.com" }, "source": { - "http": "https://sdk-release.qnsdk.com/PLShortVideoKit-v1.16.1.zip" + "http": "https://sdk-release.qnsdk.com/PLShortVideoKit-profession-v2.0.0.zip" }, "platforms": { "ios": "8.0" @@ -22,11 +22,11 @@ "subspecs": [ { "name": "ex-libMuseProcessor", - "vendored_frameworks": "Pod/Library/PLShortVideoKit.framework" + "vendored_frameworks": "Pod/Library/Profession/PLShortVideoKit.framework" }, { "name": "libMuseProcessor", - "vendored_libraries": "Pod/Library/*.a" + "vendored_libraries": "Pod/Library/Profession/*.a" } ] } diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index e6e0ed5b..0fb8105a 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -5,13 +5,13 @@ PODS: - FLAnimatedImage (1.0.12) - HappyDNS (0.3.14) - Masonry (1.0.2) - - PLShortVideoKit (1.16.1): - - PLShortVideoKit/ex-libMuseProcessor (= 1.16.1) - - PLShortVideoKit/libMuseProcessor (= 1.16.1) + - PLShortVideoKit (2.0.0): + - PLShortVideoKit/ex-libMuseProcessor (= 2.0.0) + - PLShortVideoKit/libMuseProcessor (= 2.0.0) - Qiniu (= 7.2.5) - - PLShortVideoKit/ex-libMuseProcessor (1.16.1): + - PLShortVideoKit/ex-libMuseProcessor (2.0.0): - Qiniu (= 7.2.5) - - PLShortVideoKit/libMuseProcessor (1.16.1): + - PLShortVideoKit/libMuseProcessor (2.0.0): - Qiniu (= 7.2.5) - Qiniu (7.2.5): - HappyDNS (~> 0.3) @@ -43,7 +43,7 @@ SPEC CHECKSUMS: FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31 HappyDNS: dc6a164ee81979093123c241c6353bcf0218add6 Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e - PLShortVideoKit: 1261bb8af6184d15f9d1eebad748a5bdcc52cb62 + PLShortVideoKit: 1eb46e83fc541451a62d088f295cfccff8b84b91 Qiniu: 909b408ee489ea54827e9717be90b94bc9dfbc48 PODFILE CHECKSUM: 464a1d9cdafee0a2337603af681aa59f2814b116 diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 73839498..741c72a6 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -183,16 +183,13 @@ 02FB104A8CB8C3F643379FD3C1C1727B /* QNPHAssetResource.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNPHAssetResource.h; path = QiniuSDK/Common/QNPHAssetResource.h; sourceTree = ""; }; 05D176AE37DBE76577F68AC64A2523A4 /* HappyDNS-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "HappyDNS-dummy.m"; sourceTree = ""; }; 07FF1E3901A122C74CEFB21D17D4A99B /* QNAssessment.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNAssessment.m; path = HappyDNS/Assessment/QNAssessment.m; sourceTree = ""; }; - 082942A4DBDDDC0D2E8A8D8DF99A4A7E /* libMuseProcessor.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libMuseProcessor.a; path = Pod/Library/libMuseProcessor.a; sourceTree = ""; }; 0869A48DAE27D06F7DF24D788C64BE4B /* Pods-PLShortVideoKitDemo-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-PLShortVideoKitDemo-dummy.m"; sourceTree = ""; }; - 0C113B350843FEBA088012B67BAEBDE9 /* PLShortVideoKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PLShortVideoKit.framework; path = Pod/Library/PLShortVideoKit.framework; sourceTree = ""; }; 0D0F098BD729B1EAC261DF11B14F6A73 /* MASConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASConstraint.h; path = Masonry/MASConstraint.h; sourceTree = ""; }; 0D2F1071DEF6B48EB093F6D7D9ACCD69 /* FLAnimatedImage-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FLAnimatedImage-dummy.m"; sourceTree = ""; }; 0D75AC56D47DF78EB80A6E2C8579FCAE /* CLSAttributes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = CLSAttributes.h; path = iOS/Crashlytics.framework/Headers/CLSAttributes.h; sourceTree = ""; }; 0DFE945289987FA560F4C55282F80A4F /* MASConstraint+Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MASConstraint+Private.h"; path = "Masonry/MASConstraint+Private.h"; sourceTree = ""; }; 0E6079BD190E3C67CED9A36639469D0C /* QNDnsManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNDnsManager.h; path = HappyDNS/Common/QNDnsManager.h; sourceTree = ""; }; 0EAF5B005FA1A5ABECC63ACA08CCC264 /* QNUserAgent.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNUserAgent.m; path = QiniuSDK/Http/QNUserAgent.m; sourceTree = ""; }; - 10A9146753D3A7E91C2F1BE6486F66E2 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; 151B6ACB34C0E35DCCA9F80D470F0520 /* QNPHAssetFile.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNPHAssetFile.m; path = QiniuSDK/Common/QNPHAssetFile.m; sourceTree = ""; }; 17653E88F912E9E23F969F5D1F2A47E4 /* MASLayoutConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASLayoutConstraint.m; path = Masonry/MASLayoutConstraint.m; sourceTree = ""; }; 177BC682D0BEB2FC17F5840C730A4224 /* QN_GTM_Base64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QN_GTM_Base64.h; path = QiniuSDK/Common/QN_GTM_Base64.h; sourceTree = ""; }; @@ -239,11 +236,11 @@ 553ECB0DB0D3B61EFCC0A8DA0EC97C61 /* QNIpModel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNIpModel.h; path = HappyDNS/Assessment/QNIpModel.h; sourceTree = ""; }; 565D99E1EFF1D1AF888A143839705DAE /* Pods-PLShortVideoKitDemo-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-PLShortVideoKitDemo-acknowledgements.markdown"; sourceTree = ""; }; 59AF2181EA02011F146367C67F624B5F /* MASViewAttribute.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASViewAttribute.h; path = Masonry/MASViewAttribute.h; sourceTree = ""; }; - 5A16161D246ACB5C4C2DDC66B568CA79 /* PLShortVideoKit.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = PLShortVideoKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 5A165F01E4E0EDCF729AE9656C1D90A8 /* QNUploadOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNUploadOption.h; path = QiniuSDK/Storage/QNUploadOption.h; sourceTree = ""; }; 5B500D6AB230F27BAAF6C88E63885F09 /* QNSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNSessionManager.m; path = QiniuSDK/Http/QNSessionManager.m; sourceTree = ""; }; 5BB27B69AB8C7283EDDA1B92428995A8 /* QNFileRecorder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNFileRecorder.m; path = QiniuSDK/Recorder/QNFileRecorder.m; sourceTree = ""; }; 5F8B2946022455300C6F270F10B82860 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + 60D0924A874DD8CE78FBFC0212F67369 /* PLShortVideoKit.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = PLShortVideoKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 621E5BC1B21D569FEFBDB39AF6D2D8EC /* MASConstraintMaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASConstraintMaker.h; path = Masonry/MASConstraintMaker.h; sourceTree = ""; }; 630337F493AA175B302B92F8BF671F18 /* View+MASAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "View+MASAdditions.h"; path = "Masonry/View+MASAdditions.h"; sourceTree = ""; }; 63C2A276D28472EAAFB8A0C665E148FB /* FLAnimatedImage-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FLAnimatedImage-prefix.pch"; sourceTree = ""; }; @@ -275,6 +272,7 @@ 943E8DB192B27700E2F110BF27F67BF7 /* Qiniu-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Qiniu-prefix.pch"; sourceTree = ""; }; 94F5116CF8A7715B90BBE23B6AA60C48 /* FLAnimatedImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FLAnimatedImage.m; path = FLAnimatedImage/FLAnimatedImage.m; sourceTree = ""; }; 973D8A36495AECBD481B60DEAD378726 /* QNAsyncRun.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNAsyncRun.m; path = QiniuSDK/Common/QNAsyncRun.m; sourceTree = ""; }; + 98DBE29B081A107AB73570E5E00E09C2 /* libMuseProcessor.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libMuseProcessor.a; path = Pod/Library/Profession/libMuseProcessor.a; sourceTree = ""; }; 9953C1298216DB4132424AC20A9CE4C6 /* QNFormUpload.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNFormUpload.h; path = QiniuSDK/Storage/QNFormUpload.h; sourceTree = ""; }; 9B6A48BE9095A182A04783676924B4CD /* QNResolver.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNResolver.m; path = HappyDNS/Local/QNResolver.m; sourceTree = ""; }; 9CBF51300C897CBEB49439713BE35F4E /* QNDes.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNDes.m; path = HappyDNS/Util/QNDes.m; sourceTree = ""; }; @@ -295,7 +293,6 @@ B3CD4797BBAE52557DA2AD4AC0CE5F70 /* QNPipeline.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNPipeline.h; path = QiniuSDK/BigData/QNPipeline.h; sourceTree = ""; }; BAF2EE45F811DA5E39976103C2CBE7B9 /* QNMD5.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNMD5.m; path = HappyDNS/Util/QNMD5.m; sourceTree = ""; }; BAF6C7F95C7F59017083490E3DC1B6DE /* QNMD5.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNMD5.h; path = HappyDNS/Util/QNMD5.h; sourceTree = ""; }; - BB985C8EB70C15B125D3AA515DCC9AD6 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; BDAAC74D3FACEA0A525EB5AD38C4ECA5 /* Qiniu-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Qiniu-dummy.m"; sourceTree = ""; }; C117D4ABC2F2BFBAFC6FE81A27157A94 /* ViewController+MASAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "ViewController+MASAdditions.m"; path = "Masonry/ViewController+MASAdditions.m"; sourceTree = ""; }; C2EC21B84D17094135223A5AD5965067 /* QNAssessment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNAssessment.h; path = HappyDNS/Assessment/QNAssessment.h; sourceTree = ""; }; @@ -331,6 +328,7 @@ E5A588A32127ACCF50D2B9EB58A04815 /* Pods-PLShortVideoKitDemo-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PLShortVideoKitDemo-resources.sh"; sourceTree = ""; }; E62ECC028B52A1AAD8D766686EF9AE27 /* QNSystem.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNSystem.m; path = QiniuSDK/Common/QNSystem.m; sourceTree = ""; }; E6A7D978E9D778B3E58A60E89A2C7D89 /* QNGetAddrInfo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNGetAddrInfo.m; path = HappyDNS/Util/QNGetAddrInfo.m; sourceTree = ""; }; + E756431FF16568A7DBD52F67E17B3B89 /* PLShortVideoKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PLShortVideoKit.framework; path = Pod/Library/Profession/PLShortVideoKit.framework; sourceTree = ""; }; E802F7E2CE7A4D6D546EDDFF9B2450CF /* MASConstraintMaker.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASConstraintMaker.m; path = Masonry/MASConstraintMaker.m; sourceTree = ""; }; EBFB9661553669AFEB6DBAD39E50097E /* QNAsyncRun.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNAsyncRun.h; path = QiniuSDK/Common/QNAsyncRun.h; sourceTree = ""; }; EEBBAB169837402F509CF8E7DCBC7AAA /* QNCrc32.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNCrc32.h; path = QiniuSDK/Common/QNCrc32.h; sourceTree = ""; }; @@ -395,16 +393,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 023B2EF8DB9D5107BB136CDFF1C4209D /* Pod */ = { - isa = PBXGroup; - children = ( - BB985C8EB70C15B125D3AA515DCC9AD6 /* LICENSE */, - 5A16161D246ACB5C4C2DDC66B568CA79 /* PLShortVideoKit.podspec */, - 10A9146753D3A7E91C2F1BE6486F66E2 /* README.md */, - ); - name = Pod; - sourceTree = ""; - }; 0F75DF6C7C5F002280EC53F48E80B587 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -518,7 +506,7 @@ 56AAF8433E98189615B2345C3972DB3C /* Development Pods */ = { isa = PBXGroup; children = ( - E545F49C91B27E6956164C6F2F9DB88E /* PLShortVideoKit */, + D39CC67E4153F0EA5AB6F644E84C94E7 /* PLShortVideoKit */, ); name = "Development Pods"; sourceTree = ""; @@ -534,10 +522,10 @@ path = "../Target Support Files/FLAnimatedImage"; sourceTree = ""; }; - 63931BDF741A0CF6226BB1752332D745 /* libMuseProcessor */ = { + 67E0AA350D8C02083F2653AAA6D4ED99 /* libMuseProcessor */ = { isa = PBXGroup; children = ( - C2340B897011D80A1A425A11074477FB /* Frameworks */, + 86F29E0B646F8F3214CDEF62E2741B3D /* Frameworks */, ); name = libMuseProcessor; sourceTree = ""; @@ -622,6 +610,14 @@ path = Qiniu; sourceTree = ""; }; + 86F29E0B646F8F3214CDEF62E2741B3D /* Frameworks */ = { + isa = PBXGroup; + children = ( + 98DBE29B081A107AB73570E5E00E09C2 /* libMuseProcessor.a */, + ); + name = Frameworks; + sourceTree = ""; + }; 9AAEC43466D23484E851B15F74A20612 /* Support Files */ = { isa = PBXGroup; children = ( @@ -709,14 +705,6 @@ path = HappyDNS; sourceTree = ""; }; - B71EE3AC0DFAA31F12CE2DE64E8C3E31 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 0C113B350843FEBA088012B67BAEBDE9 /* PLShortVideoKit.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; BD1C4CE75170BEB42C2D10B3778C5839 /* Pods */ = { isa = PBXGroup; children = ( @@ -746,41 +734,49 @@ path = Crashlytics; sourceTree = ""; }; - C2340B897011D80A1A425A11074477FB /* Frameworks */ = { + D39CC67E4153F0EA5AB6F644E84C94E7 /* PLShortVideoKit */ = { isa = PBXGroup; children = ( - 082942A4DBDDDC0D2E8A8D8DF99A4A7E /* libMuseProcessor.a */, + E8C7C813C198B3700DC12F5108DEB535 /* ex-libMuseProcessor */, + 67E0AA350D8C02083F2653AAA6D4ED99 /* libMuseProcessor */, + E288F74ED75F903F8B3B882F16CD27EC /* Pod */, ); - name = Frameworks; + name = PLShortVideoKit; + path = ../..; sourceTree = ""; }; - E545F49C91B27E6956164C6F2F9DB88E /* PLShortVideoKit */ = { + E277B4121503FCFF273E5AA8F9B13265 /* Frameworks */ = { isa = PBXGroup; children = ( - F0EBA6A9C4CC2529564133C8AB83A648 /* ex-libMuseProcessor */, - 63931BDF741A0CF6226BB1752332D745 /* libMuseProcessor */, - 023B2EF8DB9D5107BB136CDFF1C4209D /* Pod */, + E756431FF16568A7DBD52F67E17B3B89 /* PLShortVideoKit.framework */, ); - name = PLShortVideoKit; - path = ../..; + name = Frameworks; sourceTree = ""; }; - F064143FD0A060ACAFCCD86224C201D2 /* Frameworks */ = { + E288F74ED75F903F8B3B882F16CD27EC /* Pod */ = { isa = PBXGroup; children = ( - 82F6A9B14C326E2504B27122A838E69E /* Fabric.framework */, + 60D0924A874DD8CE78FBFC0212F67369 /* PLShortVideoKit.podspec */, ); - name = Frameworks; + name = Pod; sourceTree = ""; }; - F0EBA6A9C4CC2529564133C8AB83A648 /* ex-libMuseProcessor */ = { + E8C7C813C198B3700DC12F5108DEB535 /* ex-libMuseProcessor */ = { isa = PBXGroup; children = ( - B71EE3AC0DFAA31F12CE2DE64E8C3E31 /* Frameworks */, + E277B4121503FCFF273E5AA8F9B13265 /* Frameworks */, ); name = "ex-libMuseProcessor"; sourceTree = ""; }; + F064143FD0A060ACAFCCD86224C201D2 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 82F6A9B14C326E2504B27122A838E69E /* Fabric.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ diff --git a/Example/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.debug.xcconfig b/Example/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.debug.xcconfig index 29ad35df..3287d17e 100644 --- a/Example/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.debug.xcconfig +++ b/Example/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.debug.xcconfig @@ -1,7 +1,7 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/../../Pod/Library" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/../../Pod/Library/Profession" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Crashlytics" "${PODS_ROOT}/Headers/Public/FLAnimatedImage" "${PODS_ROOT}/Headers/Public/Fabric" "${PODS_ROOT}/Headers/Public/HappyDNS" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/PLShortVideoKit" "${PODS_ROOT}/Headers/Public/Qiniu" -LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/HappyDNS" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/Qiniu" "${PODS_ROOT}/../../Pod/Library" +LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/HappyDNS" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/Qiniu" "${PODS_ROOT}/../../Pod/Library/Profession" OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Crashlytics" -isystem "${PODS_ROOT}/Headers/Public/FLAnimatedImage" -isystem "${PODS_ROOT}/Headers/Public/Fabric" -isystem "${PODS_ROOT}/Headers/Public/HappyDNS" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/PLShortVideoKit" -isystem "${PODS_ROOT}/Headers/Public/Qiniu" OTHER_LDFLAGS = $(inherited) -ObjC -l"FLAnimatedImage" -l"HappyDNS" -l"Masonry" -l"MuseProcessor" -l"Qiniu" -l"c++" -l"resolv" -l"z" -framework "CoreGraphics" -framework "Crashlytics" -framework "Fabric" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "PLShortVideoKit" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" PODS_BUILD_DIR = ${BUILD_DIR} diff --git a/Example/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.release.xcconfig b/Example/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.release.xcconfig index 29ad35df..3287d17e 100644 --- a/Example/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.release.xcconfig +++ b/Example/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.release.xcconfig @@ -1,7 +1,7 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/../../Pod/Library" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/../../Pod/Library/Profession" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Crashlytics" "${PODS_ROOT}/Headers/Public/FLAnimatedImage" "${PODS_ROOT}/Headers/Public/Fabric" "${PODS_ROOT}/Headers/Public/HappyDNS" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/PLShortVideoKit" "${PODS_ROOT}/Headers/Public/Qiniu" -LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/HappyDNS" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/Qiniu" "${PODS_ROOT}/../../Pod/Library" +LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/HappyDNS" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/Qiniu" "${PODS_ROOT}/../../Pod/Library/Profession" OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Crashlytics" -isystem "${PODS_ROOT}/Headers/Public/FLAnimatedImage" -isystem "${PODS_ROOT}/Headers/Public/Fabric" -isystem "${PODS_ROOT}/Headers/Public/HappyDNS" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/PLShortVideoKit" -isystem "${PODS_ROOT}/Headers/Public/Qiniu" OTHER_LDFLAGS = $(inherited) -ObjC -l"FLAnimatedImage" -l"HappyDNS" -l"Masonry" -l"MuseProcessor" -l"Qiniu" -l"c++" -l"resolv" -l"z" -framework "CoreGraphics" -framework "Crashlytics" -framework "Fabric" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "PLShortVideoKit" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" PODS_BUILD_DIR = ${BUILD_DIR} diff --git a/Example_TuTu/PLShortVideoKitDemo.xcodeproj/project.pbxproj b/Example_TuTu/PLShortVideoKitDemo.xcodeproj/project.pbxproj index d9d602f3..14de8627 100644 --- a/Example_TuTu/PLShortVideoKitDemo.xcodeproj/project.pbxproj +++ b/Example_TuTu/PLShortVideoKitDemo.xcodeproj/project.pbxproj @@ -228,6 +228,7 @@ 9343A8C01F66763A007213BD /* Time_Machine_No_Reverser.png in Resources */ = {isa = PBXBuildFile; fileRef = 9343A8BE1F66763A007213BD /* Time_Machine_No_Reverser.png */; }; 9343A8C11F66763A007213BD /* Time_Machine_Reverser.png in Resources */ = {isa = PBXBuildFile; fileRef = 9343A8BF1F66763A007213BD /* Time_Machine_Reverser.png */; }; BC490FDD21B161B700959C8A /* ImageVideoMixViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC490FDC21B161B700959C8A /* ImageVideoMixViewController.m */; }; + BC8DD6C6224E340400E05B26 /* PLScreenRecorderManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8DD6C4224E340400E05B26 /* PLScreenRecorderManager.m */; }; BCA3CEC221B16C8F009F25B5 /* mulitRate.png in Resources */ = {isa = PBXBuildFile; fileRef = BCA3CEC021B16C8F009F25B5 /* mulitRate.png */; }; BCA3CEC421B16D06009F25B5 /* watermark.gif in Resources */ = {isa = PBXBuildFile; fileRef = BCA3CEC321B16D06009F25B5 /* watermark.gif */; }; BCA3CF5A21B22154009F25B5 /* TuSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = BCA3CEC821B22153009F25B5 /* TuSDK.bundle */; }; @@ -662,6 +663,8 @@ 9343A8BF1F66763A007213BD /* Time_Machine_Reverser.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Time_Machine_Reverser.png; path = images/Time_Machine_Reverser.png; sourceTree = ""; }; BC490FDA21B161B700959C8A /* ImageVideoMixViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageVideoMixViewController.h; sourceTree = ""; }; BC490FDC21B161B700959C8A /* ImageVideoMixViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageVideoMixViewController.m; sourceTree = ""; }; + BC8DD6C4224E340400E05B26 /* PLScreenRecorderManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PLScreenRecorderManager.m; sourceTree = ""; }; + BC8DD6C5224E340400E05B26 /* PLScreenRecorderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLScreenRecorderManager.h; sourceTree = ""; }; BCA3CEC021B16C8F009F25B5 /* mulitRate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = mulitRate.png; path = images/mulitRate.png; sourceTree = ""; }; BCA3CEC321B16D06009F25B5 /* watermark.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = watermark.gif; sourceTree = ""; }; BCA3CEC821B22153009F25B5 /* TuSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TuSDK.bundle; sourceTree = ""; }; @@ -1207,6 +1210,8 @@ 0A6340301F15E8CC005ADF6C /* PLSSelectionView.m */, 0A534EA8200E27F00032A981 /* PLSViewRecorderManager.h */, 0A534EAA200E27F10032A981 /* PLSViewRecorderManager.m */, + BC8DD6C5224E340400E05B26 /* PLScreenRecorderManager.h */, + BC8DD6C4224E340400E05B26 /* PLScreenRecorderManager.m */, ); path = "UI+Tools"; sourceTree = ""; @@ -1997,6 +2002,7 @@ 764FD4302112CE8B00CF1F0C /* SPARUtil.m in Sources */, BCA3CFBB21B22154009F25B5 /* EffectsView.m in Sources */, BCA3CFAC21B22154009F25B5 /* StickerPanelView.m in Sources */, + BC8DD6C6224E340400E05B26 /* PLScreenRecorderManager.m in Sources */, 0A928BE31EE75703007D2250 /* PLSAudioVolumeView.m in Sources */, 7697482C202835D2001AC847 /* TransitionViewController.m in Sources */, BCA3CFB921B22154009F25B5 /* OnlineStickerGroup.m in Sources */, diff --git a/Example_TuTu/PLShortVideoKitDemo/EditViewController.m b/Example_TuTu/PLShortVideoKitDemo/EditViewController.m index 8d54bb3b..b834f778 100644 --- a/Example_TuTu/PLShortVideoKitDemo/EditViewController.m +++ b/Example_TuTu/PLShortVideoKitDemo/EditViewController.m @@ -1219,6 +1219,9 @@ - (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL { } [self.shortVideoEditor addMVLayerWithColor:self.colorURL alpha:self.alphaURL timeRange:kCMTimeRangeZero loopEnable:YES]; + if (![self.shortVideoEditor isEditing]) { + [self.shortVideoEditor startEditing]; + } } - (void)addFilter:(NSString *)colorImagePath { @@ -2343,7 +2346,9 @@ - (void)nextButtonClick { } // 添加背景音乐信息 - [self.audioSettingsArray insertObject:self.backgroundAudioSettings atIndex:0]; + if (self.backgroundAudioSettings[PLSURLKey] && ![self.audioSettingsArray containsObject:self.backgroundAudioSettings]) { + [self.audioSettingsArray insertObject:self.backgroundAudioSettings atIndex:0]; + } AVAsset *asset = self.movieSettings[PLSAssetKey]; PLSAVAssetExportSession *exportSession = [[PLSAVAssetExportSession alloc] initWithAsset:asset]; @@ -2365,8 +2370,12 @@ - (void)nextButtonClick { // 旋转视频 exportSession.videoLayerOrientation = self.videoLayerOrientation; - [exportSession addFilter:self.colorImagePath]; - [exportSession addMVLayerWithColor:self.colorURL alpha:self.alphaURL timeRange:kCMTimeRangeZero loopEnable:YES]; + if (self.colorImagePath) { + [exportSession addFilter:self.colorImagePath]; + } + if (self.colorURL && self.alphaURL) { + [exportSession addMVLayerWithColor:self.colorURL alpha:self.alphaURL timeRange:kCMTimeRangeZero loopEnable:YES]; + } __weak typeof(self) weakSelf = self; [exportSession setCompletionBlock:^(NSURL *url) { @@ -2397,7 +2406,9 @@ - (void)nextButtonClick { [exportSession setProcessingBlock:^(float progress) { // 更新进度 UI NSLog(@"Asset Export Progress: %f", progress); - weakSelf.progressLabel.text = [NSString stringWithFormat:@"%d%%", (int)(progress * 100)]; + dispatch_async(dispatch_get_main_queue(), ^{ + weakSelf.progressLabel.text = [NSString stringWithFormat:@"%d%%", (int)(progress * 100)]; + }); }]; [exportSession exportAsynchronously]; diff --git a/Example_TuTu/PLShortVideoKitDemo/Info.plist b/Example_TuTu/PLShortVideoKitDemo/Info.plist index 00e5d40a..c0554a9e 100644 --- a/Example_TuTu/PLShortVideoKitDemo/Info.plist +++ b/Example_TuTu/PLShortVideoKitDemo/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.16.1 + 2.0.0 CFBundleVersion - 1.16.1.git-2019-01-28-1f597d9 + 2.0.0.git-2019-03-29-1cdc0b4 Fabric APIKey diff --git a/Example_TuTu/PLShortVideoKitDemo/Librarys/libMuseProcessor.a b/Example_TuTu/PLShortVideoKitDemo/Librarys/libMuseProcessor.a index bc296285..ed5e2127 100644 Binary files a/Example_TuTu/PLShortVideoKitDemo/Librarys/libMuseProcessor.a and b/Example_TuTu/PLShortVideoKitDemo/Librarys/libMuseProcessor.a differ diff --git a/Example_TuTu/PLShortVideoKitDemo/RecordViewController.m b/Example_TuTu/PLShortVideoKitDemo/RecordViewController.m index 442d9755..e2b930b3 100644 --- a/Example_TuTu/PLShortVideoKitDemo/RecordViewController.m +++ b/Example_TuTu/PLShortVideoKitDemo/RecordViewController.m @@ -17,6 +17,7 @@ #import "PLSFilterGroup.h" #import "PLSViewRecorderManager.h" #import "PLSRateButtonView.h" +#import "PLScreenRecorderManager.h" // AR #import "EasyarARViewController.h" @@ -57,6 +58,7 @@ @interface RecordViewController () UICollectionViewDelegateFlowLayout, PLSViewRecorderManagerDelegate, PLSRateButtonViewDelegate, +PLScreenRecorderManagerDelegate, // TuSDK mark - delegate TuSDKFilterProcessorDelegate, TuSDKFilterProcessorMediaEffectDelegate, @@ -85,6 +87,7 @@ @interface RecordViewController () @property (strong, nonatomic) PLSAudioConfiguration *audioConfiguration; @property (strong, nonatomic) PLShortVideoRecorder *shortVideoRecorder; @property (strong, nonatomic) PLSViewRecorderManager *viewRecorderManager; +@property (strong, nonatomic) PLScreenRecorderManager *screenRecorderManager; @property (strong, nonatomic) PLSProgressBar *progressBar; @property (strong, nonatomic) UIButton *recordButton; @property (strong, nonatomic) UIButton *viewRecordButton; @@ -129,6 +132,8 @@ @interface RecordViewController () @property (strong, nonatomic) UIButton *monitorButton; // 实时截图按钮 @property (strong, nonatomic) UIButton *snapshotButton; +// 帧率切换按钮 +@property (strong, nonatomic) UIButton *frameRateButton; // 录制前是否开启自动检测设备方向调整视频拍摄的角度(竖屏、横屏) @property (assign, nonatomic) BOOL isUseAutoCheckDeviceOrientationBeforeRecording; @@ -183,7 +188,8 @@ - (instancetype)init { _audioSampleArray = CFArrayCreateMutable(kCFAllocatorDefault, 0, NULL); _audioTimeStampArray = [[NSMutableArray alloc] init]; - NSLog(@"TuSDK version: %@", lsqVideoVersion); + NSLog(@"TuSDK version: %@", lsqSDKVersion); + NSLog(@"TuSDK video version: %@", lsqVideoVersion); } return self; } @@ -242,10 +248,11 @@ - (void)setupShortVideoRecorder { self.videoConfiguration = [PLSVideoConfiguration defaultConfiguration]; self.videoConfiguration.position = AVCaptureDevicePositionFront; - self.videoConfiguration.videoFrameRate = 25; - self.videoConfiguration.averageVideoBitRate = 1024*1000; - self.videoConfiguration.videoSize = CGSizeMake(544, 960); + self.videoConfiguration.videoFrameRate = 30; + self.videoConfiguration.averageVideoBitRate = 1000*2500; + self.videoConfiguration.videoSize = CGSizeMake(720, 1280); self.videoConfiguration.videoOrientation = AVCaptureVideoOrientationPortrait; + self.videoConfiguration.sessionPreset = AVCaptureSessionPreset1280x720; self.audioConfiguration = [PLSAudioConfiguration defaultConfiguration]; @@ -486,6 +493,17 @@ - (void)setupRightButtonView { [self.musicButton addTarget:self action:@selector(musicButtonOnClick:) forControlEvents:UIControlEventTouchUpInside]; [self.rightScrollView addSubview:self.musicButton]; + index ++; + // 30FPS/60FPS + self.frameRateButton = [[UIButton alloc] initWithFrame:CGRectMake(0, index * 60 + 10, 46, 46)]; + self.frameRateButton.layer.cornerRadius = 23; + self.frameRateButton.backgroundColor = backgroundColor; + [self.frameRateButton setTitle:@"30帧" forState:(UIControlStateNormal)]; + self.frameRateButton.titleLabel.font = [UIFont systemFontOfSize:14]; + [self.frameRateButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + [self.frameRateButton addTarget:self action:@selector(frameRateButtonOnClick:) forControlEvents:UIControlEventTouchUpInside]; + [self.rightScrollView addSubview:self.frameRateButton]; + index ++; // AR UIButton *ARButton = [[UIButton alloc] initWithFrame:CGRectMake(0, index * 60 + 10, 46, 46)]; @@ -497,17 +515,6 @@ - (void)setupRightButtonView { [self.rightScrollView addSubview:ARButton]; index ++; - // 外部滤镜 -// UIButton *externalFilterButton = [[UIButton alloc] initWithFrame:CGRectMake(0, index * 60 + 10, 46, 46)]; -// externalFilterButton.layer.cornerRadius = 23; -// externalFilterButton.backgroundColor = backgroundColor; -// [externalFilterButton setTitle:@"美化" forState:UIControlStateNormal]; -// [externalFilterButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; -// externalFilterButton.titleLabel.font = [UIFont systemFontOfSize:13]; -// [externalFilterButton addTarget:self action:@selector(externalFilterButtonOnClick:) forControlEvents:UIControlEventTouchUpInside]; -// [self.rightScrollView addSubview:externalFilterButton]; -// -// index ++; // 滤镜按钮 _filterBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, index * 60 + 10, 46, 46)]; _filterBtn.layer.cornerRadius = 23; @@ -693,6 +700,7 @@ - (void)getFirstMovieFromPhotoAlbum { - (void)backButtonEvent:(id)sender { if (self.viewRecordButton.isSelected) { [self.viewRecorderManager cancelRecording]; + [self.screenRecorderManager cancelRecording]; } if ([self.shortVideoRecorder getFilesCount] > 0) { self.alertView = [[UIAlertView alloc] initWithTitle:@"提醒" message:[NSString stringWithFormat:@"放弃这个视频(共%ld个视频段)?", (long)[self.shortVideoRecorder getFilesCount]] delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; @@ -708,7 +716,7 @@ - (void)squareRecordButtonEvent:(id)sender { UIButton *button = (UIButton *)sender; button.selected = !button.selected; if (button.selected) { - self.videoConfiguration.videoSize = CGSizeMake(480, 480); + self.videoConfiguration.videoSize = CGSizeMake(720, 720); [self.shortVideoRecorder reloadvideoConfiguration:self.videoConfiguration]; self.shortVideoRecorder.maxDuration = 10.0f; @@ -720,7 +728,7 @@ - (void)squareRecordButtonEvent:(id)sender { }); } else { - self.videoConfiguration.videoSize = CGSizeMake(544, 960); + self.videoConfiguration.videoSize = CGSizeMake(720, 1280); [self.shortVideoRecorder reloadvideoConfiguration:self.videoConfiguration]; self.shortVideoRecorder.maxDuration = 10.0f; @@ -734,26 +742,39 @@ - (void)squareRecordButtonEvent:(id)sender { //录制 self.view - (void)viewRecorderButtonClick:(id)sender { - if (!self.viewRecorderManager) { - self.viewRecorderManager = [[PLSViewRecorderManager alloc] initWithRecordedView:self.view]; - self.viewRecorderManager.delegate = self; - } - - if (self.viewRecordButton.isSelected) { - self.viewRecordButton.selected = NO; - [self.viewRecorderManager stopRecording]; - - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillResignActiveNotification object:nil]; - } - else { - self.viewRecordButton.selected = YES; - [self clearAudioPitchBuffer]; - [self.viewRecorderManager startRecording]; + if (@available(iOS 11.0, *)) { + if (!self.screenRecorderManager) { + self.screenRecorderManager = [[PLScreenRecorderManager alloc] init]; + self.screenRecorderManager.delegate = self; + } + if (self.viewRecordButton.isSelected) { + self.viewRecordButton.selected = NO; + [self.screenRecorderManager stopRecording]; + } else { + self.viewRecordButton.selected = YES; + [self.screenRecorderManager startRecording]; + } + } else { + if (!self.viewRecorderManager) { + self.viewRecorderManager = [[PLSViewRecorderManager alloc] initWithRecordedView:self.shortVideoRecorder.previewView]; + self.viewRecorderManager.delegate = self; + } - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(applicationWillResignActive:) - name:UIApplicationWillResignActiveNotification - object:nil]; + if (self.viewRecordButton.isSelected) { + self.viewRecordButton.selected = NO; + [self.viewRecorderManager stopRecording]; + + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillResignActiveNotification object:nil]; + } + else { + self.viewRecordButton.selected = YES; + [self.viewRecorderManager startRecording]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(applicationWillResignActive:) + name:UIApplicationWillResignActiveNotification + object:nil]; + } } } @@ -776,8 +797,22 @@ - (void)beautyFaceButtonEvent:(id)sender { } // 切换前后置摄像头 -- (void)toggleCameraButtonEvent:(id)sender { - [self.shortVideoRecorder toggleCamera]; +- (void)toggleCameraButtonEvent:(UIButton *)sender { + // 采集帧率不大于 30 帧的时候,使用 [self.shortVideoRecorder toggleCamera] 和 [self.shortVideoRecorder toggleCamera:block] 都可以。当采集大于 30 帧的时候,为确保切换成功,需要先停止采集,再切换相机,切换完成再启动采集。如果不先停止采集,部分机型上采集 60 帧的时候,切换摄像头可能会耗时几秒钟 + if (self.videoConfiguration.videoFrameRate > 30) { + sender.enabled = NO; + __weak typeof(self) weakself = self; + [self.shortVideoRecorder stopCaptureSession]; + [self.shortVideoRecorder toggleCamera:^(BOOL isFinish) { + [weakself checkActiveFormat];// 默认的 active 可能最大只支持采集 30 帧,这里手动设置一下 + [weakself.shortVideoRecorder startCaptureSession]; + dispatch_async(dispatch_get_main_queue(), ^{ + sender.enabled = YES; + }); + }]; + } else { + [self.shortVideoRecorder toggleCamera]; + } } // 七牛滤镜 @@ -821,6 +856,23 @@ - (void)musicButtonOnClick:(id)sender { } } +- (void)frameRateButtonOnClick:(UIButton *)button { + if (60 == self.videoConfiguration.videoFrameRate) { + self.videoConfiguration.videoFrameRate = 30; + self.videoConfiguration.averageVideoBitRate = 1000 * 2500; + self.videoConfiguration.sessionPreset = AVCaptureSessionPreset1280x720; + [button setTitle:@"30帧" forState:(UIControlStateNormal)]; + [self.shortVideoRecorder reloadvideoConfiguration:self.videoConfiguration]; + } else { + self.videoConfiguration.videoFrameRate = 60; + self.videoConfiguration.averageVideoBitRate = 1000 * 3500; + self.videoConfiguration.sessionPreset = AVCaptureSessionPresetInputPriority; + [button setTitle:@"60帧" forState:(UIControlStateNormal)]; + [self.shortVideoRecorder reloadvideoConfiguration:self.videoConfiguration]; + [self checkActiveFormat]; + } +} + // 拍照 -(void)snapshotButtonOnClick:(UIButton *)sender { sender.enabled = NO; @@ -917,6 +969,7 @@ - (void)endButtonEvent:(id)sender { AVAsset *asset = self.shortVideoRecorder.assetRepresentingAllFiles; [self playEvent:asset]; [self.viewRecorderManager cancelRecording]; + [self.screenRecorderManager cancelRecording]; self.viewRecordButton.selected = NO; } @@ -1007,6 +1060,31 @@ - (void)viewRecorderManager:(PLSViewRecorderManager *)manager didFinishRecording [self presentViewController:videoEditViewController animated:YES completion:nil]; } +#pragma mark - PLScreenRecorderManagerDelegate +- (void)screenRecorderManager:(PLScreenRecorderManager *)manager didFinishRecordingToAsset:(AVAsset *)asset totalDuration:(CGFloat)totalDuration { + self.viewRecordButton.selected = NO; + // 设置音视频、水印等编辑信息 + NSMutableDictionary *outputSettings = [[NSMutableDictionary alloc] init]; + // 待编辑的原始视频素材 + NSMutableDictionary *plsMovieSettings = [[NSMutableDictionary alloc] init]; + plsMovieSettings[PLSAssetKey] = asset; + plsMovieSettings[PLSStartTimeKey] = [NSNumber numberWithFloat:0.f]; + plsMovieSettings[PLSDurationKey] = [NSNumber numberWithFloat:totalDuration]; + plsMovieSettings[PLSVolumeKey] = [NSNumber numberWithFloat:1.0f]; + outputSettings[PLSMovieSettingsKey] = plsMovieSettings; + + EditViewController *videoEditViewController = [[EditViewController alloc] init]; + videoEditViewController.settings = outputSettings; + [self presentViewController:videoEditViewController animated:YES completion:nil]; +} + +- (void)screenRecorderManager:(PLScreenRecorderManager *)manager errorOccur:(NSError *)error { + NSString *message = [NSString stringWithFormat:@"%@", error]; + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"错误" message:message delegate:nil cancelButtonTitle:@"确定" otherButtonTitles: nil]; + [alert show]; + self.viewRecordButton.selected = NO; +} + #pragma mark -- PLShortVideoRecorderDelegate 摄像头/麦克风鉴权的回调 - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didGetCameraAuthorizationStatus:(PLSAuthorizationStatus)status { if (status == PLSAuthorizationStatusAuthorized) { @@ -1105,6 +1183,7 @@ - (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didRecordingToOutput self.importMovieView.hidden = YES; self.musicButton.hidden = YES; self.filePathButton.hidden = YES; + self.frameRateButton.hidden = YES; self.durationLabel.text = [NSString stringWithFormat:@"%.2fs", totalDuration]; } @@ -1122,6 +1201,7 @@ - (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didDeleteFileAtURL:( self.importMovieView.hidden = NO; self.musicButton.hidden = NO; self.filePathButton.hidden = NO; + self.frameRateButton.hidden = NO; } AVAsset *asset = [AVAsset assetWithURL:_URL]; @@ -1334,58 +1414,22 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPa - (void)setupGestureRecognizer { UISwipeGestureRecognizer *recognizer; // 添加右滑手势 - recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)]; + recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleFilterSwipeFrom:)]; [recognizer setDirection:(UISwipeGestureRecognizerDirectionRight)]; [self.view addGestureRecognizer:recognizer]; - recognizer.delegate = self; // 添加左滑手势 - recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)]; + recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleFilterSwipeFrom:)]; [recognizer setDirection:(UISwipeGestureRecognizerDirectionLeft)]; [self.view addGestureRecognizer:recognizer]; - recognizer.delegate = self; - // 添加上滑手势 - recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)]; - [recognizer setDirection:(UISwipeGestureRecognizerDirectionUp)]; - [self.view addGestureRecognizer:recognizer]; - recognizer.delegate = self; // 添加下滑手势 - recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleSwipeFrom:)]; + recognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(handleDownSwipeFrom:)]; [recognizer setDirection:(UISwipeGestureRecognizerDirectionDown)]; [self.view addGestureRecognizer:recognizer]; - recognizer.delegate = self; } --(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { - BOOL result = YES; - if (_filterView) { - result = result && _filterView.hidden; - } - if (_stickerView) { - result = result && _stickerView.hidden; - } - if (_facePanelView) { - result = result && _facePanelView.hidden; - } - if (_cartoonView) { - result = result && _cartoonView.hidden; - } - return result; -} // 添加手势的响应事件 -- (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer{ - if(recognizer.direction == UISwipeGestureRecognizerDirectionDown) { - NSLog(@"swipe down"); - self.filterIndex++; - self.filterIndex %= self.filterGroup.filtersInfo.count; - } - if(recognizer.direction == UISwipeGestureRecognizerDirectionUp) { - NSLog(@"swipe up"); - self.filterIndex--; - if (self.filterIndex < 0) { - self.filterIndex = self.filterGroup.filtersInfo.count - 1; - } - } +- (void)handleFilterSwipeFrom:(UISwipeGestureRecognizer *)recognizer{ if(recognizer.direction == UISwipeGestureRecognizerDirectionLeft) { NSLog(@"swipe left"); self.filterIndex--; @@ -1403,6 +1447,45 @@ - (void)handleSwipeFrom:(UISwipeGestureRecognizer *)recognizer{ self.filterGroup.filterIndex = self.filterIndex; } +- (void)handleDownSwipeFrom:(UISwipeGestureRecognizer *)recognizer{ + if(recognizer.direction == UISwipeGestureRecognizerDirectionDown) { + NSLog(@"swipe down"); + if ([self isViewShow:_filterView]) { + [self hideView:_filterView]; + } + if ([self isViewShow:_cartoonView]) { + [self hideView:_cartoonView]; + } + if ([self isViewShow:_stickerView]) { + [self hideView:_stickerView]; + } + if ([self isViewShow:_facePanelView]) { + [self hideView:_facePanelView]; + } + } +} + +- (void)showView:(UIView *)view { + CGRect rect = view.frame; + rect.origin.y = self.view.bounds.size.height - view.frame.size.height; + [UIView animateWithDuration:.3 animations:^{ + view.frame = rect; + }]; +} + +- (void)hideView:(UIView *)view { + CGRect rect = view.frame; + rect.origin.y = self.view.bounds.size.height; + [UIView animateWithDuration:.3 animations:^{ + view.frame = rect; + }]; +} + +- (BOOL)isViewShow:(UIView *)view { + if (!view) return NO; + return fabs(self.view.bounds.size.height - view.frame.origin.y) > FLT_EPSILON; +} + #pragma mark - addObserverEvent - (void)addObserverEvent { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; @@ -1423,6 +1506,41 @@ - (void)applicationDidBecomeActive:(id)sender { NSLog(@"%s, %d, applicationDidBecomeActive:", __func__, __LINE__); } +- (void)checkActiveFormat { + + CGSize needCaptureSize = self.videoConfiguration.videoSize; + + if (AVCaptureVideoOrientationPortrait == self.videoConfiguration.videoOrientation || + AVCaptureVideoOrientationPortraitUpsideDown == self.videoConfiguration.videoOrientation) { + needCaptureSize = CGSizeMake(self.videoConfiguration.videoSize.height, self.videoConfiguration.videoSize.width); + } + + AVCaptureDeviceFormat *activeFormat = self.shortVideoRecorder.videoActiveFormat; + AVFrameRateRange *frameRateRange = [activeFormat.videoSupportedFrameRateRanges firstObject]; + + CMVideoDimensions captureSize = CMVideoFormatDescriptionGetDimensions(activeFormat.formatDescription); + if (frameRateRange.maxFrameRate < self.videoConfiguration.videoFrameRate || + frameRateRange.minFrameRate > self.videoConfiguration.videoFrameRate || + needCaptureSize.width > captureSize.width || + needCaptureSize.height > captureSize.height) { + + NSArray *videoFormats = self.shortVideoRecorder.videoFormats; + for (AVCaptureDeviceFormat *format in videoFormats) { + frameRateRange = [format.videoSupportedFrameRateRanges firstObject]; + captureSize = CMVideoFormatDescriptionGetDimensions(format.formatDescription); + + if (frameRateRange.maxFrameRate >= self.videoConfiguration.videoFrameRate && + frameRateRange.minFrameRate <= self.videoConfiguration.videoFrameRate && + captureSize.width >= needCaptureSize.width && + captureSize.height >= needCaptureSize.height) { + NSLog(@"size = {%d x %d}, fps = %f ~ %f", captureSize.width, captureSize.height, frameRateRange.minFrameRate, frameRateRange.maxFrameRate); + self.shortVideoRecorder.videoActiveFormat = format; + break; + } + } + } +} + #pragma mark - EasyarSDK AR 入口 - (void)ARButtonOnClick:(id)sender { EasyarARViewController *easyerARViewController = [[EasyarARViewController alloc]init]; @@ -1440,32 +1558,6 @@ - (void)checkBundleId { } } -- (void)externalFilterButtonOnClick:(UIButton *)button { - [self checkBundleId]; - - if (!_filterView) { -// [self initFilterView]; - } - - _filterView.hidden = !_filterView.hidden; - if (!_filterView.hidden) { - _stickerView.hidden = YES; - } -} - -- (void)externalStickerButtonOnClick:(UIButton *)button { - [self checkBundleId]; - - if (!_stickerView) { -// [self initStickerView]; - } - - _stickerView.hidden = !_stickerView.hidden; - if (!_stickerView.hidden) { - _filterView.hidden = YES; - } -} - - (void)initTUSDK { // TuSDK mark [self initFilterProcessor]; @@ -1567,12 +1659,30 @@ - (void)clickStickerBtn; _stickerView.delegate = (id)self; CGSize size = self.view.bounds.size; const CGFloat stickerPanelHeight = 200; - _stickerView.frame = CGRectMake(0, size.height - stickerPanelHeight, size.width, stickerPanelHeight); + _stickerView.frame = CGRectMake(0, size.height, size.width, stickerPanelHeight); [self.view addSubview:_stickerView]; - }else{ - _stickerView.hidden = !_stickerView.hidden; + + UIVisualEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; + UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect]; + effectView.frame = _stickerView.bounds; + [_stickerView insertSubview:effectView atIndex:0]; + } + + if ([self isViewShow:_cartoonView]) { + [self hideView:_cartoonView]; + } + if ([self isViewShow:_facePanelView]) { + [self hideView:_facePanelView]; + } + if ([self isViewShow:_filterView]) { + [self hideView:_filterView]; + } + + if ([self isViewShow:_stickerView]) { + [self hideView:_stickerView]; + } else { + [self showView:_stickerView]; } - _cartoonView.hidden =_facePanelView.hidden = _filterView.hidden = YES; } - (void)clickFilterBtn; @@ -1583,16 +1693,29 @@ - (void)clickFilterBtn; CGFloat filterPanelHeight = 276; // 滤镜视图 - _filterView = [[FilterPanelView alloc] initWithFrame:CGRectMake(0, size.height - filterPanelHeight, size.width, filterPanelHeight)]; + _filterView = [[FilterPanelView alloc] initWithFrame:CGRectMake(0, size.height, size.width, filterPanelHeight)]; _filterView.delegate = (id)self; _filterView.dataSource = (id)self; _filterView.codes = @[kCameraFilterCodes]; [self.view addSubview:_filterView]; - }else{ - _filterView.hidden = !_filterView.hidden; } - _cartoonView.hidden = _facePanelView.hidden = _stickerView.hidden = YES; + + if ([self isViewShow:_cartoonView]) { + [self hideView:_cartoonView]; + } + if ([self isViewShow:_facePanelView]) { + [self hideView:_facePanelView]; + } + if ([self isViewShow:_stickerView]) { + [self hideView:_stickerView]; + } + + if ([self isViewShow:_filterView]) { + [self hideView:_filterView]; + } else { + [self showView:_filterView]; + } } - (void)clickFaceBtn; @@ -1604,12 +1727,25 @@ - (void)clickFaceBtn; _facePanelView.dataSource = (id)self; CGSize size = self.view.bounds.size; const CGFloat filterPanelHeight = 276; - _facePanelView.frame = CGRectMake(0, size.height - filterPanelHeight, size.width, filterPanelHeight); + _facePanelView.frame = CGRectMake(0, size.height, size.width, filterPanelHeight); [self.view addSubview:_facePanelView]; - }else{ - _facePanelView.hidden = !_facePanelView.hidden; } - _cartoonView.hidden = _stickerView.hidden = _filterView.hidden = YES; + + if ([self isViewShow:_cartoonView]) { + [self hideView:_cartoonView]; + } + if ([self isViewShow:_filterView]) { + [self hideView:_filterView]; + } + if ([self isViewShow:_stickerView]) { + [self hideView:_stickerView]; + } + + if ([self isViewShow:_facePanelView]) { + [self hideView:_facePanelView]; + } else { + [self showView:_facePanelView]; + } } - (void)clickCartoonBtn; @@ -1620,15 +1756,27 @@ - (void)clickCartoonBtn; CGFloat filterPanelHeight = 276; // 滤镜视图 - _cartoonView = [[CartoonPanelView alloc] initWithFrame:CGRectMake(0, size.height - filterPanelHeight, size.width, filterPanelHeight)]; + _cartoonView = [[CartoonPanelView alloc] initWithFrame:CGRectMake(0, size.height, size.width, filterPanelHeight)]; _cartoonView.delegate = self; [self.view addSubview:_cartoonView]; - }else{ - _cartoonView.hidden = !_cartoonView.hidden; } - _filterView.hidden = _facePanelView.hidden = _stickerView.hidden = YES; + if ([self isViewShow:_facePanelView]) { + [self hideView:_facePanelView]; + } + if ([self isViewShow:_filterView]) { + [self hideView:_filterView]; + } + if ([self isViewShow:_stickerView]) { + [self hideView:_stickerView]; + } + + if ([self isViewShow:_cartoonView]) { + [self hideView:_cartoonView]; + } else { + [self showView:_cartoonView]; + } } /** diff --git a/Example_TuTu/PLShortVideoKitDemo/SegmentEffects/MulitClipViewController.m b/Example_TuTu/PLShortVideoKitDemo/SegmentEffects/MulitClipViewController.m index c1da9c87..9f9de124 100644 --- a/Example_TuTu/PLShortVideoKitDemo/SegmentEffects/MulitClipViewController.m +++ b/Example_TuTu/PLShortVideoKitDemo/SegmentEffects/MulitClipViewController.m @@ -369,7 +369,7 @@ - (void)clipView:(PLSClipMulitMediaView *)clipView finishClip:(NSArray +#import + +NS_ASSUME_NONNULL_BEGIN + +@class PLScreenRecorderManager; + +@protocol PLScreenRecorderManagerDelegate + +@optional +- (void)screenRecorderManager:(PLScreenRecorderManager *)manager didFinishRecordingToAsset:(AVAsset *)asset totalDuration:(CGFloat)totalDuration; +- (void)screenRecorderManager:(PLScreenRecorderManager *)manager errorOccur:(NSError *)error; +@end + +@interface PLScreenRecorderManager : NSObject + +@property (weak, nonatomic) id delegate; + +- (void)startRecording; + +- (void)stopRecording; + +- (void)cancelRecording; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Example_TuTu/PLShortVideoKitDemo/UI+Tools/PLScreenRecorderManager.m b/Example_TuTu/PLShortVideoKitDemo/UI+Tools/PLScreenRecorderManager.m new file mode 100644 index 00000000..5b4c5bbf --- /dev/null +++ b/Example_TuTu/PLShortVideoKitDemo/UI+Tools/PLScreenRecorderManager.m @@ -0,0 +1,152 @@ +// +// PLScreenRecorderManager.m +// PLShortVideoKitDemo +// +// Created by hxiongan on 2019/3/28. +// Copyright © 2019年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import "PLScreenRecorderManager.h" +#import +#include +#import + +@interface PLScreenRecorderManager () + +@property (nonatomic, strong) PLShortVideoRecorder *shortVideoRecorder; +@property (nonatomic, weak) RPScreenRecorder *screenRecorder; + +@end + + +@implementation PLScreenRecorderManager + +- (instancetype)init { + self = [super init]; + if (self) { + [self setupShortRecorder]; + [self setupScreenRecorder]; + } + return self; +} + +- (void)setupShortRecorder { + PLSVideoConfiguration *videoConfiguration = [PLSVideoConfiguration defaultConfiguration]; + videoConfiguration.videoFrameRate = 60; + videoConfiguration.videoSize = CGSizeMake(720, 1280); + videoConfiguration.averageVideoBitRate = 3500 * 1000; + PLSAudioConfiguration *audioConfiguration = [PLSAudioConfiguration defaultConfiguration]; + self.shortVideoRecorder = [[PLShortVideoRecorder alloc] initWithVideoConfiguration:videoConfiguration audioConfiguration:audioConfiguration captureEnabled:NO]; + self.shortVideoRecorder.maxDuration = 120; + self.shortVideoRecorder.delegate = self; + self.shortVideoRecorder.backgroundMonitorEnable = NO; +} + +- (void)setupScreenRecorder { + self.screenRecorder = [RPScreenRecorder sharedRecorder]; + self.screenRecorder.microphoneEnabled = YES; +} + +- (void)startRecording { + __weak typeof(self) weakSelf = self; + if (@available(iOS 11.0, *)) { + + [weakSelf.screenRecorder startCaptureWithHandler:^(CMSampleBufferRef _Nonnull sampleBuffer, RPSampleBufferType bufferType, NSError * _Nullable error) { + if (RPSampleBufferTypeVideo == bufferType) { + [weakSelf.shortVideoRecorder writePixelBuffer:CMSampleBufferGetImageBuffer(sampleBuffer) timeStamp:CMSampleBufferGetPresentationTimeStamp(sampleBuffer)]; + } else if (RPSampleBufferTypeAudioMic == bufferType){ + [weakSelf.shortVideoRecorder writeSampleBuffer:sampleBuffer]; + } + } completionHandler:^(NSError * _Nullable error) { + if (error) { + dispatch_async(dispatch_get_main_queue(), ^{ + if ([weakSelf.delegate respondsToSelector:@selector(screenRecorderManager:errorOccur:)]) { + [weakSelf.delegate screenRecorderManager:weakSelf errorOccur:error]; + } + [weakSelf cancelRecording]; + }); + } else { + dispatch_sync(dispatch_get_main_queue(), ^{ + // 注意: [shortVideoRecorder startRecording] 需要再主线程中执行,不然拍的时长会不正确 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidEnterBackground:) name:UIApplicationDidEnterBackgroundNotification object:nil]; + [weakSelf.shortVideoRecorder deleteAllFiles]; + [weakSelf.shortVideoRecorder startRecording]; + }); + } + }]; + } else { + // Fallback on earlier versions + } +} + +- (void)stopRecording { + if (@available(iOS 11.0, *)) { + [self.screenRecorder stopCaptureWithHandler:^(NSError * _Nullable error) { + if (error) { + NSLog(@"screenRecorder stop error: %@", error); + } + }]; + } else { + // Fallback on earlier versions + } + [self.shortVideoRecorder stopRecording]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil]; +} + +- (void)cancelRecording { + if (@available(iOS 11.0, *)) { + [self.screenRecorder stopCaptureWithHandler:^(NSError * _Nullable error) { + if (error) { + NSLog(@"screenRecorder stop error: %@", error); + } + }]; + } else { + // Fallback on earlier versions + } + NSLog(@"cancel"); + [self.shortVideoRecorder cancelRecording]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil]; +} + +- (void)applicationDidEnterBackground:(id)sender { + [self stopRecording]; +} + +- (void)dealloc { + [self cancelRecording]; + NSLog(@"dealloc: %@", self.description); +} + +#pragma mark - Recorder Delegate + +// 开始录制一段视频时 +- (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didStartRecordingToOutputFileAtURL:(NSURL *)fileURL { + NSLog(@"start recording fileURL: %@", fileURL); +} + +// 完成一段视频的录制时 +- (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didFinishRecordingToOutputFileAtURL:(NSURL *)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration { + NSLog(@"finish recording fileURL: %@, fileDuration: %f, totalDuration: %f", fileURL, fileDuration, totalDuration); + + AVAsset *asset = self.shortVideoRecorder.assetRepresentingAllFiles; + if (self.delegate && [self.delegate respondsToSelector:@selector(screenRecorderManager:didFinishRecordingToAsset:totalDuration:)]) { + [self.delegate screenRecorderManager:self didFinishRecordingToAsset:asset totalDuration:totalDuration]; + } +} + +// 在达到指定的视频录制时间 maxDuration 后,如果再调用 [PLShortVideoRecorder startRecording],直接执行该回调 +- (void)shortVideoRecorder:(PLShortVideoRecorder *)recorder didFinishRecordingMaxDuration:(CGFloat)maxDuration { + NSLog(@"finish recording maxDuration: %f", maxDuration); + if (@available(iOS 11.0, *)) { + [self.screenRecorder stopCaptureWithHandler:^(NSError * _Nullable error) {}]; + } else { + // Fallback on earlier versions + } + AVAsset *asset = self.shortVideoRecorder.assetRepresentingAllFiles; + if (self.delegate && [self.delegate respondsToSelector:@selector(screenRecorderManager:didFinishRecordingToAsset:totalDuration:)]) { + [self.delegate screenRecorderManager:self didFinishRecordingToAsset:asset totalDuration:maxDuration]; + } +} + +@end + diff --git a/Example_TuTu/Podfile.lock b/Example_TuTu/Podfile.lock index e6e0ed5b..0fb8105a 100644 --- a/Example_TuTu/Podfile.lock +++ b/Example_TuTu/Podfile.lock @@ -5,13 +5,13 @@ PODS: - FLAnimatedImage (1.0.12) - HappyDNS (0.3.14) - Masonry (1.0.2) - - PLShortVideoKit (1.16.1): - - PLShortVideoKit/ex-libMuseProcessor (= 1.16.1) - - PLShortVideoKit/libMuseProcessor (= 1.16.1) + - PLShortVideoKit (2.0.0): + - PLShortVideoKit/ex-libMuseProcessor (= 2.0.0) + - PLShortVideoKit/libMuseProcessor (= 2.0.0) - Qiniu (= 7.2.5) - - PLShortVideoKit/ex-libMuseProcessor (1.16.1): + - PLShortVideoKit/ex-libMuseProcessor (2.0.0): - Qiniu (= 7.2.5) - - PLShortVideoKit/libMuseProcessor (1.16.1): + - PLShortVideoKit/libMuseProcessor (2.0.0): - Qiniu (= 7.2.5) - Qiniu (7.2.5): - HappyDNS (~> 0.3) @@ -43,7 +43,7 @@ SPEC CHECKSUMS: FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31 HappyDNS: dc6a164ee81979093123c241c6353bcf0218add6 Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e - PLShortVideoKit: 1261bb8af6184d15f9d1eebad748a5bdcc52cb62 + PLShortVideoKit: 1eb46e83fc541451a62d088f295cfccff8b84b91 Qiniu: 909b408ee489ea54827e9717be90b94bc9dfbc48 PODFILE CHECKSUM: 464a1d9cdafee0a2337603af681aa59f2814b116 diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/AVAsset+PLSExtendProperty.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/AVAsset+PLSExtendProperty.h index b2417f58..3006ffe5 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/AVAsset+PLSExtendProperty.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/AVAsset+PLSExtendProperty.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAVAssetExportSession.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAVAssetExportSession.h index c5ae5824..1a128624 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAVAssetExportSession.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAVAssetExportSession.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioConfiguration.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioConfiguration.h index 94e0a928..93f6a03c 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioConfiguration.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioMixConfiguration.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioMixConfiguration.h index c36a0715..abc4cdea 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioMixConfiguration.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSAudioMixConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSComposeMediaItem.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSComposeMediaItem.h index 14eb0dd7..84812d22 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSComposeMediaItem.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSComposeMediaItem.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditPlayer.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditPlayer.h index 8f182a0f..125ca2d7 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditPlayer.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditPlayer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSEditPlayer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditPlayer.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditSettings.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditSettings.h index c16edf18..9779a781 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditSettings.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSEditSettings.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSEditSettings.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditSettings.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFadeTranstion.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFadeTranstion.h index 4ccfe97d..e130821c 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFadeTranstion.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFadeTranstion.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFilter.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFilter.h index fe0edb2d..63c11e9e 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFilter.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSFilter.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSFilter.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFilter.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSGifComposer.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSGifComposer.h index 0cca4e3c..765e55c5 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSGifComposer.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSGifComposer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSGifComposer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSGifComposer.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageRotateRecorder.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageRotateRecorder.h index a9de0e4d..cb42a7a0 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageRotateRecorder.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageRotateRecorder.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageSetting.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageSetting.h index 5f3b0a9c..866dc7df 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageSetting.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageSetting.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSImageSetting.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageSetting.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageToMovieComposer.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageToMovieComposer.h index eb55182f..0a5f0cf0 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageToMovieComposer.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageToMovieComposer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageVideoComposer.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageVideoComposer.h index 0561aca5..474d3d07 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageVideoComposer.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSImageVideoComposer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMixMediaItem.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMixMediaItem.h index fc2f7412..888f7143 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMixMediaItem.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMixMediaItem.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMovieComposer.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMovieComposer.h index 695dcf6d..d80705a0 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMovieComposer.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMovieComposer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSMovieComposer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMovieComposer.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMultiVideoMixer.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMultiVideoMixer.h index d236bd19..33b6faaf 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMultiVideoMixer.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSMultiVideoMixer.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSPositionTransition.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSPositionTransition.h index d939aba0..476a904b 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSPositionTransition.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSPositionTransition.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSPositionTransition.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSPositionTransition.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMedia.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMedia.h index 8dc03581..ad9acd13 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMedia.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMedia.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMedia.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMedia.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMediaTools.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMediaTools.h index 79b82c42..647c5380 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMediaTools.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMediaTools.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMovieExport.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMovieExport.h index 1275f06d..f0dfc22e 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMovieExport.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRangeMovieExport.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSReverserEffect.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSReverserEffect.h index 9b01273f..ec750516 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSReverserEffect.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSReverserEffect.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSReverserEffect.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSReverserEffect.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRotateTransition.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRotateTransition.h index f17116e3..301cd5ce 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRotateTransition.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSRotateTransition.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSRotateTransition.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRotateTransition.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSScaleTransition.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSScaleTransition.h index c18ada24..df6cf752 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSScaleTransition.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSScaleTransition.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSScaleTransition.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSScaleTransition.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTextSetting.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTextSetting.h index a6227904..613d6d0d 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTextSetting.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTextSetting.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSTextSetting.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTextSetting.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransition.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransition.h index 28f33069..b5525292 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransition.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransition.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSTransition.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransition.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransitionMaker.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransitionMaker.h index c9e83cca..961a8ad9 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransitionMaker.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTransitionMaker.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTypeDefines.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTypeDefines.h index 25a88277..abe8940e 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTypeDefines.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSTypeDefines.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSTypeDefines.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTypeDefines.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderConfiguration.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderConfiguration.h index 9da44da6..8db4b0ef 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderConfiguration.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderResponseInfo.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderResponseInfo.h index 94583791..222a7e69 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderResponseInfo.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSUploaderResponseInfo.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoConfiguration.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoConfiguration.h index f1dbd5ba..4dc6fdac 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoConfiguration.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixConfiguration.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixConfiguration.h index c2a9e6de..e5e5791f 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixConfiguration.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixConfiguration.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixRecorder.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixRecorder.h index 7abbbb4c..52d17161 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixRecorder.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLSVideoMixRecorder.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoAsset.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoAsset.h index aa615417..6920cbc4 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoAsset.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoAsset.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoEditor.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoEditor.h index 986fb29e..017e855c 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoEditor.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoEditor.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKit.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKit.h index ec5123a9..ba560a9d 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKit.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKit.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoKit.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoKit.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKitEnv.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKitEnv.h index 747b964d..6d6b081e 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKitEnv.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoKitEnv.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoRecorder.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoRecorder.h index be64002c..d5c1c4b7 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoRecorder.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoRecorder.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoTranscoder.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoTranscoder.h index 0a5f9af6..26ded8a3 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoTranscoder.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoTranscoder.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoUploader.h b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoUploader.h index 657c3c9d..feaacaab 120000 --- a/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoUploader.h +++ b/Example_TuTu/Pods/Headers/Public/PLShortVideoKit/PLShortVideoKit/PLShortVideoUploader.h @@ -1 +1 @@ -../../../../../../Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h \ No newline at end of file +../../../../../../Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h \ No newline at end of file diff --git a/Example_TuTu/Pods/Local Podspecs/PLShortVideoKit.podspec.json b/Example_TuTu/Pods/Local Podspecs/PLShortVideoKit.podspec.json index dd7a97d4..ba0be00f 100644 --- a/Example_TuTu/Pods/Local Podspecs/PLShortVideoKit.podspec.json +++ b/Example_TuTu/Pods/Local Podspecs/PLShortVideoKit.podspec.json @@ -1,6 +1,6 @@ { "name": "PLShortVideoKit", - "version": "1.16.1", + "version": "2.0.0", "summary": "PILI iOS short video record SDK", "homepage": "https://github.com/pili-engineering/PLShortVideoKit", "license": "Apache License 2.0", @@ -8,7 +8,7 @@ "pili": "pili@qiniu.com" }, "source": { - "http": "https://sdk-release.qnsdk.com/PLShortVideoKit-v1.16.1.zip" + "http": "https://sdk-release.qnsdk.com/PLShortVideoKit-profession-v2.0.0.zip" }, "platforms": { "ios": "8.0" @@ -22,11 +22,11 @@ "subspecs": [ { "name": "ex-libMuseProcessor", - "vendored_frameworks": "Pod/Library/PLShortVideoKit.framework" + "vendored_frameworks": "Pod/Library/Profession/PLShortVideoKit.framework" }, { "name": "libMuseProcessor", - "vendored_libraries": "Pod/Library/*.a" + "vendored_libraries": "Pod/Library/Profession/*.a" } ] } diff --git a/Example_TuTu/Pods/Manifest.lock b/Example_TuTu/Pods/Manifest.lock index e6e0ed5b..0fb8105a 100644 --- a/Example_TuTu/Pods/Manifest.lock +++ b/Example_TuTu/Pods/Manifest.lock @@ -5,13 +5,13 @@ PODS: - FLAnimatedImage (1.0.12) - HappyDNS (0.3.14) - Masonry (1.0.2) - - PLShortVideoKit (1.16.1): - - PLShortVideoKit/ex-libMuseProcessor (= 1.16.1) - - PLShortVideoKit/libMuseProcessor (= 1.16.1) + - PLShortVideoKit (2.0.0): + - PLShortVideoKit/ex-libMuseProcessor (= 2.0.0) + - PLShortVideoKit/libMuseProcessor (= 2.0.0) - Qiniu (= 7.2.5) - - PLShortVideoKit/ex-libMuseProcessor (1.16.1): + - PLShortVideoKit/ex-libMuseProcessor (2.0.0): - Qiniu (= 7.2.5) - - PLShortVideoKit/libMuseProcessor (1.16.1): + - PLShortVideoKit/libMuseProcessor (2.0.0): - Qiniu (= 7.2.5) - Qiniu (7.2.5): - HappyDNS (~> 0.3) @@ -43,7 +43,7 @@ SPEC CHECKSUMS: FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31 HappyDNS: dc6a164ee81979093123c241c6353bcf0218add6 Masonry: 7c429b56da9d4ee0bbb3ed77a5ea710d6a5df39e - PLShortVideoKit: 1261bb8af6184d15f9d1eebad748a5bdcc52cb62 + PLShortVideoKit: 1eb46e83fc541451a62d088f295cfccff8b84b91 Qiniu: 909b408ee489ea54827e9717be90b94bc9dfbc48 PODFILE CHECKSUM: 464a1d9cdafee0a2337603af681aa59f2814b116 diff --git a/Example_TuTu/Pods/Pods.xcodeproj/project.pbxproj b/Example_TuTu/Pods/Pods.xcodeproj/project.pbxproj index 73839498..741c72a6 100644 --- a/Example_TuTu/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example_TuTu/Pods/Pods.xcodeproj/project.pbxproj @@ -183,16 +183,13 @@ 02FB104A8CB8C3F643379FD3C1C1727B /* QNPHAssetResource.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNPHAssetResource.h; path = QiniuSDK/Common/QNPHAssetResource.h; sourceTree = ""; }; 05D176AE37DBE76577F68AC64A2523A4 /* HappyDNS-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "HappyDNS-dummy.m"; sourceTree = ""; }; 07FF1E3901A122C74CEFB21D17D4A99B /* QNAssessment.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNAssessment.m; path = HappyDNS/Assessment/QNAssessment.m; sourceTree = ""; }; - 082942A4DBDDDC0D2E8A8D8DF99A4A7E /* libMuseProcessor.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libMuseProcessor.a; path = Pod/Library/libMuseProcessor.a; sourceTree = ""; }; 0869A48DAE27D06F7DF24D788C64BE4B /* Pods-PLShortVideoKitDemo-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-PLShortVideoKitDemo-dummy.m"; sourceTree = ""; }; - 0C113B350843FEBA088012B67BAEBDE9 /* PLShortVideoKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PLShortVideoKit.framework; path = Pod/Library/PLShortVideoKit.framework; sourceTree = ""; }; 0D0F098BD729B1EAC261DF11B14F6A73 /* MASConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASConstraint.h; path = Masonry/MASConstraint.h; sourceTree = ""; }; 0D2F1071DEF6B48EB093F6D7D9ACCD69 /* FLAnimatedImage-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FLAnimatedImage-dummy.m"; sourceTree = ""; }; 0D75AC56D47DF78EB80A6E2C8579FCAE /* CLSAttributes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = CLSAttributes.h; path = iOS/Crashlytics.framework/Headers/CLSAttributes.h; sourceTree = ""; }; 0DFE945289987FA560F4C55282F80A4F /* MASConstraint+Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MASConstraint+Private.h"; path = "Masonry/MASConstraint+Private.h"; sourceTree = ""; }; 0E6079BD190E3C67CED9A36639469D0C /* QNDnsManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNDnsManager.h; path = HappyDNS/Common/QNDnsManager.h; sourceTree = ""; }; 0EAF5B005FA1A5ABECC63ACA08CCC264 /* QNUserAgent.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNUserAgent.m; path = QiniuSDK/Http/QNUserAgent.m; sourceTree = ""; }; - 10A9146753D3A7E91C2F1BE6486F66E2 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; 151B6ACB34C0E35DCCA9F80D470F0520 /* QNPHAssetFile.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNPHAssetFile.m; path = QiniuSDK/Common/QNPHAssetFile.m; sourceTree = ""; }; 17653E88F912E9E23F969F5D1F2A47E4 /* MASLayoutConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASLayoutConstraint.m; path = Masonry/MASLayoutConstraint.m; sourceTree = ""; }; 177BC682D0BEB2FC17F5840C730A4224 /* QN_GTM_Base64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QN_GTM_Base64.h; path = QiniuSDK/Common/QN_GTM_Base64.h; sourceTree = ""; }; @@ -239,11 +236,11 @@ 553ECB0DB0D3B61EFCC0A8DA0EC97C61 /* QNIpModel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNIpModel.h; path = HappyDNS/Assessment/QNIpModel.h; sourceTree = ""; }; 565D99E1EFF1D1AF888A143839705DAE /* Pods-PLShortVideoKitDemo-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-PLShortVideoKitDemo-acknowledgements.markdown"; sourceTree = ""; }; 59AF2181EA02011F146367C67F624B5F /* MASViewAttribute.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASViewAttribute.h; path = Masonry/MASViewAttribute.h; sourceTree = ""; }; - 5A16161D246ACB5C4C2DDC66B568CA79 /* PLShortVideoKit.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = PLShortVideoKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 5A165F01E4E0EDCF729AE9656C1D90A8 /* QNUploadOption.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNUploadOption.h; path = QiniuSDK/Storage/QNUploadOption.h; sourceTree = ""; }; 5B500D6AB230F27BAAF6C88E63885F09 /* QNSessionManager.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNSessionManager.m; path = QiniuSDK/Http/QNSessionManager.m; sourceTree = ""; }; 5BB27B69AB8C7283EDDA1B92428995A8 /* QNFileRecorder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNFileRecorder.m; path = QiniuSDK/Recorder/QNFileRecorder.m; sourceTree = ""; }; 5F8B2946022455300C6F270F10B82860 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + 60D0924A874DD8CE78FBFC0212F67369 /* PLShortVideoKit.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = PLShortVideoKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 621E5BC1B21D569FEFBDB39AF6D2D8EC /* MASConstraintMaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASConstraintMaker.h; path = Masonry/MASConstraintMaker.h; sourceTree = ""; }; 630337F493AA175B302B92F8BF671F18 /* View+MASAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "View+MASAdditions.h"; path = "Masonry/View+MASAdditions.h"; sourceTree = ""; }; 63C2A276D28472EAAFB8A0C665E148FB /* FLAnimatedImage-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FLAnimatedImage-prefix.pch"; sourceTree = ""; }; @@ -275,6 +272,7 @@ 943E8DB192B27700E2F110BF27F67BF7 /* Qiniu-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Qiniu-prefix.pch"; sourceTree = ""; }; 94F5116CF8A7715B90BBE23B6AA60C48 /* FLAnimatedImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FLAnimatedImage.m; path = FLAnimatedImage/FLAnimatedImage.m; sourceTree = ""; }; 973D8A36495AECBD481B60DEAD378726 /* QNAsyncRun.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNAsyncRun.m; path = QiniuSDK/Common/QNAsyncRun.m; sourceTree = ""; }; + 98DBE29B081A107AB73570E5E00E09C2 /* libMuseProcessor.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libMuseProcessor.a; path = Pod/Library/Profession/libMuseProcessor.a; sourceTree = ""; }; 9953C1298216DB4132424AC20A9CE4C6 /* QNFormUpload.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNFormUpload.h; path = QiniuSDK/Storage/QNFormUpload.h; sourceTree = ""; }; 9B6A48BE9095A182A04783676924B4CD /* QNResolver.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNResolver.m; path = HappyDNS/Local/QNResolver.m; sourceTree = ""; }; 9CBF51300C897CBEB49439713BE35F4E /* QNDes.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNDes.m; path = HappyDNS/Util/QNDes.m; sourceTree = ""; }; @@ -295,7 +293,6 @@ B3CD4797BBAE52557DA2AD4AC0CE5F70 /* QNPipeline.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNPipeline.h; path = QiniuSDK/BigData/QNPipeline.h; sourceTree = ""; }; BAF2EE45F811DA5E39976103C2CBE7B9 /* QNMD5.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNMD5.m; path = HappyDNS/Util/QNMD5.m; sourceTree = ""; }; BAF6C7F95C7F59017083490E3DC1B6DE /* QNMD5.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNMD5.h; path = HappyDNS/Util/QNMD5.h; sourceTree = ""; }; - BB985C8EB70C15B125D3AA515DCC9AD6 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; BDAAC74D3FACEA0A525EB5AD38C4ECA5 /* Qiniu-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Qiniu-dummy.m"; sourceTree = ""; }; C117D4ABC2F2BFBAFC6FE81A27157A94 /* ViewController+MASAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "ViewController+MASAdditions.m"; path = "Masonry/ViewController+MASAdditions.m"; sourceTree = ""; }; C2EC21B84D17094135223A5AD5965067 /* QNAssessment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNAssessment.h; path = HappyDNS/Assessment/QNAssessment.h; sourceTree = ""; }; @@ -331,6 +328,7 @@ E5A588A32127ACCF50D2B9EB58A04815 /* Pods-PLShortVideoKitDemo-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-PLShortVideoKitDemo-resources.sh"; sourceTree = ""; }; E62ECC028B52A1AAD8D766686EF9AE27 /* QNSystem.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNSystem.m; path = QiniuSDK/Common/QNSystem.m; sourceTree = ""; }; E6A7D978E9D778B3E58A60E89A2C7D89 /* QNGetAddrInfo.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QNGetAddrInfo.m; path = HappyDNS/Util/QNGetAddrInfo.m; sourceTree = ""; }; + E756431FF16568A7DBD52F67E17B3B89 /* PLShortVideoKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PLShortVideoKit.framework; path = Pod/Library/Profession/PLShortVideoKit.framework; sourceTree = ""; }; E802F7E2CE7A4D6D546EDDFF9B2450CF /* MASConstraintMaker.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASConstraintMaker.m; path = Masonry/MASConstraintMaker.m; sourceTree = ""; }; EBFB9661553669AFEB6DBAD39E50097E /* QNAsyncRun.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNAsyncRun.h; path = QiniuSDK/Common/QNAsyncRun.h; sourceTree = ""; }; EEBBAB169837402F509CF8E7DCBC7AAA /* QNCrc32.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QNCrc32.h; path = QiniuSDK/Common/QNCrc32.h; sourceTree = ""; }; @@ -395,16 +393,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 023B2EF8DB9D5107BB136CDFF1C4209D /* Pod */ = { - isa = PBXGroup; - children = ( - BB985C8EB70C15B125D3AA515DCC9AD6 /* LICENSE */, - 5A16161D246ACB5C4C2DDC66B568CA79 /* PLShortVideoKit.podspec */, - 10A9146753D3A7E91C2F1BE6486F66E2 /* README.md */, - ); - name = Pod; - sourceTree = ""; - }; 0F75DF6C7C5F002280EC53F48E80B587 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -518,7 +506,7 @@ 56AAF8433E98189615B2345C3972DB3C /* Development Pods */ = { isa = PBXGroup; children = ( - E545F49C91B27E6956164C6F2F9DB88E /* PLShortVideoKit */, + D39CC67E4153F0EA5AB6F644E84C94E7 /* PLShortVideoKit */, ); name = "Development Pods"; sourceTree = ""; @@ -534,10 +522,10 @@ path = "../Target Support Files/FLAnimatedImage"; sourceTree = ""; }; - 63931BDF741A0CF6226BB1752332D745 /* libMuseProcessor */ = { + 67E0AA350D8C02083F2653AAA6D4ED99 /* libMuseProcessor */ = { isa = PBXGroup; children = ( - C2340B897011D80A1A425A11074477FB /* Frameworks */, + 86F29E0B646F8F3214CDEF62E2741B3D /* Frameworks */, ); name = libMuseProcessor; sourceTree = ""; @@ -622,6 +610,14 @@ path = Qiniu; sourceTree = ""; }; + 86F29E0B646F8F3214CDEF62E2741B3D /* Frameworks */ = { + isa = PBXGroup; + children = ( + 98DBE29B081A107AB73570E5E00E09C2 /* libMuseProcessor.a */, + ); + name = Frameworks; + sourceTree = ""; + }; 9AAEC43466D23484E851B15F74A20612 /* Support Files */ = { isa = PBXGroup; children = ( @@ -709,14 +705,6 @@ path = HappyDNS; sourceTree = ""; }; - B71EE3AC0DFAA31F12CE2DE64E8C3E31 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 0C113B350843FEBA088012B67BAEBDE9 /* PLShortVideoKit.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; BD1C4CE75170BEB42C2D10B3778C5839 /* Pods */ = { isa = PBXGroup; children = ( @@ -746,41 +734,49 @@ path = Crashlytics; sourceTree = ""; }; - C2340B897011D80A1A425A11074477FB /* Frameworks */ = { + D39CC67E4153F0EA5AB6F644E84C94E7 /* PLShortVideoKit */ = { isa = PBXGroup; children = ( - 082942A4DBDDDC0D2E8A8D8DF99A4A7E /* libMuseProcessor.a */, + E8C7C813C198B3700DC12F5108DEB535 /* ex-libMuseProcessor */, + 67E0AA350D8C02083F2653AAA6D4ED99 /* libMuseProcessor */, + E288F74ED75F903F8B3B882F16CD27EC /* Pod */, ); - name = Frameworks; + name = PLShortVideoKit; + path = ../..; sourceTree = ""; }; - E545F49C91B27E6956164C6F2F9DB88E /* PLShortVideoKit */ = { + E277B4121503FCFF273E5AA8F9B13265 /* Frameworks */ = { isa = PBXGroup; children = ( - F0EBA6A9C4CC2529564133C8AB83A648 /* ex-libMuseProcessor */, - 63931BDF741A0CF6226BB1752332D745 /* libMuseProcessor */, - 023B2EF8DB9D5107BB136CDFF1C4209D /* Pod */, + E756431FF16568A7DBD52F67E17B3B89 /* PLShortVideoKit.framework */, ); - name = PLShortVideoKit; - path = ../..; + name = Frameworks; sourceTree = ""; }; - F064143FD0A060ACAFCCD86224C201D2 /* Frameworks */ = { + E288F74ED75F903F8B3B882F16CD27EC /* Pod */ = { isa = PBXGroup; children = ( - 82F6A9B14C326E2504B27122A838E69E /* Fabric.framework */, + 60D0924A874DD8CE78FBFC0212F67369 /* PLShortVideoKit.podspec */, ); - name = Frameworks; + name = Pod; sourceTree = ""; }; - F0EBA6A9C4CC2529564133C8AB83A648 /* ex-libMuseProcessor */ = { + E8C7C813C198B3700DC12F5108DEB535 /* ex-libMuseProcessor */ = { isa = PBXGroup; children = ( - B71EE3AC0DFAA31F12CE2DE64E8C3E31 /* Frameworks */, + E277B4121503FCFF273E5AA8F9B13265 /* Frameworks */, ); name = "ex-libMuseProcessor"; sourceTree = ""; }; + F064143FD0A060ACAFCCD86224C201D2 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 82F6A9B14C326E2504B27122A838E69E /* Fabric.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ diff --git a/Example_TuTu/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.debug.xcconfig b/Example_TuTu/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.debug.xcconfig index 29ad35df..3287d17e 100644 --- a/Example_TuTu/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.debug.xcconfig +++ b/Example_TuTu/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.debug.xcconfig @@ -1,7 +1,7 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/../../Pod/Library" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/../../Pod/Library/Profession" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Crashlytics" "${PODS_ROOT}/Headers/Public/FLAnimatedImage" "${PODS_ROOT}/Headers/Public/Fabric" "${PODS_ROOT}/Headers/Public/HappyDNS" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/PLShortVideoKit" "${PODS_ROOT}/Headers/Public/Qiniu" -LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/HappyDNS" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/Qiniu" "${PODS_ROOT}/../../Pod/Library" +LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/HappyDNS" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/Qiniu" "${PODS_ROOT}/../../Pod/Library/Profession" OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Crashlytics" -isystem "${PODS_ROOT}/Headers/Public/FLAnimatedImage" -isystem "${PODS_ROOT}/Headers/Public/Fabric" -isystem "${PODS_ROOT}/Headers/Public/HappyDNS" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/PLShortVideoKit" -isystem "${PODS_ROOT}/Headers/Public/Qiniu" OTHER_LDFLAGS = $(inherited) -ObjC -l"FLAnimatedImage" -l"HappyDNS" -l"Masonry" -l"MuseProcessor" -l"Qiniu" -l"c++" -l"resolv" -l"z" -framework "CoreGraphics" -framework "Crashlytics" -framework "Fabric" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "PLShortVideoKit" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" PODS_BUILD_DIR = ${BUILD_DIR} diff --git a/Example_TuTu/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.release.xcconfig b/Example_TuTu/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.release.xcconfig index 29ad35df..3287d17e 100644 --- a/Example_TuTu/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.release.xcconfig +++ b/Example_TuTu/Pods/Target Support Files/Pods-PLShortVideoKitDemo/Pods-PLShortVideoKitDemo.release.xcconfig @@ -1,7 +1,7 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/../../Pod/Library" +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS" "${PODS_ROOT}/../../Pod/Library/Profession" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Crashlytics" "${PODS_ROOT}/Headers/Public/FLAnimatedImage" "${PODS_ROOT}/Headers/Public/Fabric" "${PODS_ROOT}/Headers/Public/HappyDNS" "${PODS_ROOT}/Headers/Public/Masonry" "${PODS_ROOT}/Headers/Public/PLShortVideoKit" "${PODS_ROOT}/Headers/Public/Qiniu" -LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/HappyDNS" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/Qiniu" "${PODS_ROOT}/../../Pod/Library" +LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/FLAnimatedImage" "${PODS_CONFIGURATION_BUILD_DIR}/HappyDNS" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_CONFIGURATION_BUILD_DIR}/Qiniu" "${PODS_ROOT}/../../Pod/Library/Profession" OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Crashlytics" -isystem "${PODS_ROOT}/Headers/Public/FLAnimatedImage" -isystem "${PODS_ROOT}/Headers/Public/Fabric" -isystem "${PODS_ROOT}/Headers/Public/HappyDNS" -isystem "${PODS_ROOT}/Headers/Public/Masonry" -isystem "${PODS_ROOT}/Headers/Public/PLShortVideoKit" -isystem "${PODS_ROOT}/Headers/Public/Qiniu" OTHER_LDFLAGS = $(inherited) -ObjC -l"FLAnimatedImage" -l"HappyDNS" -l"Masonry" -l"MuseProcessor" -l"Qiniu" -l"c++" -l"resolv" -l"z" -framework "CoreGraphics" -framework "Crashlytics" -framework "Fabric" -framework "Foundation" -framework "ImageIO" -framework "MobileCoreServices" -framework "PLShortVideoKit" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" PODS_BUILD_DIR = ${BUILD_DIR} diff --git a/PLShortVideoKit-Advanced.podspec b/PLShortVideoKit-Advanced.podspec new file mode 100644 index 00000000..0be6810e --- /dev/null +++ b/PLShortVideoKit-Advanced.podspec @@ -0,0 +1,35 @@ +# +# Be sure to run `pod spec lint PLShortVideoKit.podspec' to ensure this is a +# valid spec and to remove all comments including this before submitting the spec. +# +# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html +# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ +# + +Pod::Spec.new do |s| + + s.name = "PLShortVideoKit" + s.version = "2.0.0" + s.summary = "PILI iOS short video record SDK" + s.homepage = "https://github.com/pili-engineering/PLShortVideoKit" + s.license = "Apache License 2.0" + s.author = { "pili" => "pili@qiniu.com" } + s.source = { :http => "https://sdk-release.qnsdk.com/PLShortVideoKit-advanced-v2.0.0.zip"} + s.platform = :ios + s.requires_arc = true + + s.ios.deployment_target = "8.0" + + s.dependency 'Qiniu', '7.2.5' + + + s.subspec "ex-libMuseProcessor" do |ss1| + ss1.vendored_framework = "Pod/Library/Advanced/PLShortVideoKit.framework" + end + + + s.subspec "libMuseProcessor" do |ss2| + ss2.vendored_libraries = 'Pod/Library/Advanced/*.a' + end + +end diff --git a/PLShortVideoKit-Basic.podspec b/PLShortVideoKit-Basic.podspec new file mode 100644 index 00000000..10f06ef5 --- /dev/null +++ b/PLShortVideoKit-Basic.podspec @@ -0,0 +1,35 @@ +# +# Be sure to run `pod spec lint PLShortVideoKit.podspec' to ensure this is a +# valid spec and to remove all comments including this before submitting the spec. +# +# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html +# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ +# + +Pod::Spec.new do |s| + + s.name = "PLShortVideoKit" + s.version = "2.0.0" + s.summary = "PILI iOS short video record SDK" + s.homepage = "https://github.com/pili-engineering/PLShortVideoKit" + s.license = "Apache License 2.0" + s.author = { "pili" => "pili@qiniu.com" } + s.source = { :http => "https://sdk-release.qnsdk.com/PLShortVideoKit-basic-v2.0.0.zip"} + s.platform = :ios + s.requires_arc = true + + s.ios.deployment_target = "8.0" + + s.dependency 'Qiniu', '7.2.5' + + + s.subspec "ex-libMuseProcessor" do |ss1| + ss1.vendored_framework = "Pod/Library/Basic/PLShortVideoKit.framework" + end + + + s.subspec "libMuseProcessor" do |ss2| + ss2.vendored_libraries = 'Pod/Library/Basic/*.a' + end + +end diff --git a/PLShortVideoKit.podspec b/PLShortVideoKit.podspec index 3ba50cdc..e8fa7d95 100644 --- a/PLShortVideoKit.podspec +++ b/PLShortVideoKit.podspec @@ -9,12 +9,12 @@ Pod::Spec.new do |s| s.name = "PLShortVideoKit" - s.version = "1.16.1" + s.version = "2.0.0" s.summary = "PILI iOS short video record SDK" s.homepage = "https://github.com/pili-engineering/PLShortVideoKit" s.license = "Apache License 2.0" s.author = { "pili" => "pili@qiniu.com" } - s.source = { :http => "https://sdk-release.qnsdk.com/PLShortVideoKit-v1.16.1.zip"} + s.source = { :http => "https://sdk-release.qnsdk.com/PLShortVideoKit-profession-v2.0.0.zip"} s.platform = :ios s.requires_arc = true @@ -24,12 +24,12 @@ Pod::Spec.new do |s| s.subspec "ex-libMuseProcessor" do |ss1| - ss1.vendored_framework = "Pod/Library/PLShortVideoKit.framework" + ss1.vendored_framework = "Pod/Library/Profession/PLShortVideoKit.framework" end s.subspec "libMuseProcessor" do |ss2| - ss2.vendored_libraries = 'Pod/Library/*.a' + ss2.vendored_libraries = 'Pod/Library/Profession/*.a' end end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h similarity index 74% rename from Pod/Library/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h index 03b4ffad..4690bb3c 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h @@ -8,51 +8,64 @@ #import +/*! + @category AVAsset (PLSExtendProperty) + @brief AVAsset 常用属性获取的类别 + + @since v1.11.0 + */ @interface AVAsset (PLSExtendProperty) -/** - @brief 视频的真实分辨率 +/*! + @property pls_videoSize + @brief 视频的真实分辨率,即就是视频播放的时候,显示的分辨率 @since v1.11.0 */ @property (assign, nonatomic, readonly) CGSize pls_videoSize; -/** +/*! + @property pls_portrait @brief 视频是否为竖屏视频 @since v1.11.0 */ @property (assign, nonatomic, readonly) BOOL pls_portrait; -/** +/*! + @property pls_squareVideo @brief 视频是否为正方形视频 @since v1.11.0 */ @property (assign, nonatomic, readonly) BOOL pls_squareVideo; -/** +/*! + @property pls_bitrate @brief 视频的码率 @since v1.11.0 */ @property (assign, nonatomic, readonly) float pls_bitrate; -/** +/*! + @property pls_normalFrameRate @brief 视频的帧率 @since v1.15.0 */ @property (assign, nonatomic, readonly) float pls_normalFrameRate; -/** +/*! + @property pls_channel @brief 如果 AVAsset 包含音频通道,则返回第一个音频通道的声道数 @since v1.16.1 */ @property (assign, nonatomic, readonly) UInt32 pls_channel; -/** +/*! + @property pls_sampleRate @brief 如果 AVAsset 包含音频通道,则返回第一个音频通道的采样率 @since v1.16.1 diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h new file mode 100644 index 00000000..d9b97b1b --- /dev/null +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h @@ -0,0 +1,250 @@ +// +// PLSAVAssetExportSession.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/7/11. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import "PLSTypeDefines.h" + + +@class PLSAVAssetExportSession; + +/*! + @protocol PLSAVAssetExportSessionDelegate + @abstract 视频导出协议 + + @since v1.1.0 + */ +@protocol PLSAVAssetExportSessionDelegate + +@optional + +/*! + @method assetExportSession:didOutputPixelBuffer: + @abstract 输出视频文件的视频数据,用来做滤镜处理 + + @param assetExportSession PLSAVAssetExportSession 实例 + @param pixelBuffer 视频帧 + + @since v1.1.0 + */ +- (CVPixelBufferRef __nonnull)assetExportSession:(PLSAVAssetExportSession *__nonnull)assetExportSession didOutputPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer __deprecated_msg("Method deprecated in v1.9.0. Use `assetExportSession: didOutputPixelBuffer: timestamp:`"); + +/*! + @method assetExportSession:didOutputPixelBuffer:timestamp: + @abstract 输出视频文件的视频数据,用来做滤镜处理 + + @param assetExportSession PLSAVAssetExportSession 实例 + @param pixelBuffer 视频帧 + @param timestamp 视频帧的时间戳 + + @since v1.9.0 + */ +- (CVPixelBufferRef __nonnull)assetExportSession:(PLSAVAssetExportSession *__nonnull)assetExportSession didOutputPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer timestamp:(CMTime)timestamp; + +@end + +/*! + @class PLSAVAssetExportSession + @brief 短视频导出核心类 + */ +@interface PLSAVAssetExportSession : NSObject + +/*! + @property delegate + @abstract 操作视频段的代理 + + @since v1.1.0 + */ +@property (weak, nonatomic) __nullable id delegate; + +/*! + @property delegateQueue + @abstract 触发代理对象回调时所在的任务队列。 + + @discussion 默认情况下该值为 nil,此时代理方法都会通过 main queue 异步执行回调。如果你期望可以所有的回调在自己创建或者其他非主线程调用, + 可以设置改 delegateQueue 属性。 + + @see PLSAVAssetExportSessionDelegate + @see delegate + + @since v1.1.0 + */ +@property (strong, nonatomic) dispatch_queue_t __nullable delegateQueue; + + +/*! + @method initWithAsset: + @brief 实例初始化方法 + + @param asset AVAsset 实例 + + @return PLSAVAssetExportSession 实例 + @since v1.1.0 + */ +- (instancetype _Nullable )initWithAsset:(AVAsset *_Nullable)asset; + +/*! + @property isExportMovieToPhotosAlbum + @brief 将视频导出到相册,默认为 NO + + @since v1.4.0 + */ +@property (assign, nonatomic) BOOL isExportMovieToPhotosAlbum; + +/*! + @property outputFileType + @brief 视频导出的文件类型,默认为 PLSFileTypeMPEG4(.mp4) + + @since v1.1.0 + */ +@property (assign, nonatomic) PLSFileType outputFileType; + +/*! + @property outputURL + @brief 视频导出的路径 + + @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 + + @since v1.1.0 + */ +@property (strong, nonatomic) NSURL * _Nullable outputURL; + +/*! + @property bitrate + @brief 视频的码率,默认为原视频的码率 + + @since v1.11.0 + */ +@property (assign, nonatomic) float bitrate; + +/*! + @property videoLayerOrientation + @brief 视频旋转,默认为 PLSPreviewOrientationPortrait 视频的原始方向 + + @since v1.7.0 + */ +@property (assign, nonatomic) PLSPreviewOrientation videoLayerOrientation; + +/*! + @property outputVideoSize + @brief 视频导出的分辨率 + + @since v1.5.0 + */ +@property (assign, nonatomic) CGSize outputVideoSize; + +/*! + @property outputVideoFrameRate + @brief 视频的帧率 + + @discussion 默认为原视频的帧率. 如果设置的帧率大于原视频的帧率,将会使用原视频的帧率作为导出视频的帧率,没有特别的需求不建议使用此属性.使用此属性的场景举例:在编辑阶段对帧率为 60 FPS 的视频进行 “极速“ 处理,然后使用 PLSAVAssetExportSession 导出这个极速处理的视频,如果不加帧率限制,导出的将会是 120 FPS 的视频,iPhone 设备播放 120 FPS 的视频会存在问题。此时可以使用此属性将导出视频的帧率限制在 60 FPS 以内。 + + @since v1.15.0 + */ +@property (assign, nonatomic) float outputVideoFrameRate; + +/*! + @property audioBitrate + @brief 导出视频的音频码率,默认:PLSAudioBitRate_128Kbps + + @discussion 音频的码率设置应该根据音频采样率和声道数来设置,如果设置的码率值和标准值相差太大,可能引起音频编码失败,导致导出视频文件失败。推荐的码率设置请查看 PLSAudioSampleRate 和 PLSAudioBitRate + @see PLSAudioSampleRate + @see PLSAudioBitRate + + @since v1.16.0 + */ +@property (assign, nonatomic) PLSAudioBitRate audioBitrate; + +/*! + @property audioChannel + @brief 导出视频的音频声道数。 + @discussion 目前支持单声道和双声道(即 1 个声道数和 2 个声道数). 如果不设置,将按照如下规则处理: + 如果原视频是单声道,则导出视频将使用单声道. 如果原视频声道数不小于 2,则导出视频声道数为 2 + + @since v1.16.0 + */ +@property (assign, nonatomic) UInt32 audioChannel; + +/*! + @property shouldOptimizeForNetworkUse + @brief 是否设置便于网络环境下的传输,默认为 YES + + @since v1.1.0 + */ +@property (assign, nonatomic) BOOL shouldOptimizeForNetworkUse; + +/*! + @property outputSettings + @brief 视频导出的设置信息 + + @since v1.1.0 + */ +@property (strong, nonatomic) NSDictionary * _Nullable outputSettings; + +/*! + @property progress + @brief 视频导出的进度 + + @since v1.1.0 + */ +@property (nonatomic, readonly) float progress; + +/*! + @property completionBlock + @abstract 视频导出完成的 block + + @since v1.1.0 + */ +@property (copy, nonatomic) void(^ _Nullable completionBlock)(NSURL * _Nullable url); + +/*! + @property failureBlock + @abstract 视频导出失败的 block + + @since v1.1.0 + */ +@property (copy, nonatomic) void(^ _Nullable failureBlock)(NSError* _Nullable error); + +/*! + @property processingBlock + @abstract 视频导出进度的 block,可在该 block 中刷新导出进度条 UI + + @since v1.1.0 + */ +@property (copy, nonatomic) void(^ _Nullable processingBlock)(float progress); + +/*! + @method exportAsynchronously + @brief 异步进行视频导出 + + @since v1.1.0 + */ +- (void)exportAsynchronously; + +/*! + @method cancelExport + @brief 取消视频导出 + + @since v1.1.0 + */ +- (void)cancelExport; + +/*! + @method addFilter: + @brief 添加滤镜效果 + + @param colorImagePath 当前使用的滤镜的颜色表图的路径 + + @since v1.5.0 + */ +- (void)addFilter:(NSString *_Nullable)colorImagePath; + +@end + + diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h similarity index 81% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h index aa6f51b8..7be7540a 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h @@ -10,9 +10,16 @@ #import #import "PLSTypeDefines.h" +/*! + @class PLSAudioConfiguration + @brief 采集和录制文件编码音频参数配置类 + + @since v1.0.0 + */ @interface PLSAudioConfiguration : NSObject -/** +/*! + @property numberOfChannels @brief 采集音频数据的声道数,默认为 1 @warning 并非所有采集设备都支持多声道数据的采集 @@ -21,14 +28,16 @@ */ @property (assign, nonatomic) NSUInteger numberOfChannels; -/** +/*! + @property sampleRate @brief 音频采样率 sampleRate 默认为 PLSAudioSampleRate_44100Hz @since v1.0.0 */ @property (assign, nonatomic) PLSAudioSampleRate sampleRate; -/** +/*! + @property bitRate @brief 音频编码码率 bitRate 默认为 PLSAudioBitRate_128Kbps @since v1.0.0 @@ -36,7 +45,8 @@ @property (assign, nonatomic) PLSAudioBitRate bitRate; -/** +/*! + @method defaultConfiguration @brief 创建一个默认配置的 PLSAudioConfiguration 实例. @return 创建的默认 PLSAudioConfiguration 对象 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSEditPlayer.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSEditPlayer.h similarity index 63% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSEditPlayer.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSEditPlayer.h index 1441f116..3961c0b6 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSEditPlayer.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSEditPlayer.h @@ -14,31 +14,48 @@ @class PLSEditPlayer; +/*! + @protocol PLSEditPlayerDelegate + @brief 视频编辑播放器协议 + + @since v1.1.0 + */ @protocol PLSEditPlayerDelegate @optional -/** +/*! + @method player:didGetOriginPixelBuffer: @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + @param player PLSEditPlayer 实例 + @param pixelBuffer CVPixelBufferRef 视频帧 + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef @since v1.1.0 */ - (CVPixelBufferRef __nonnull)player:(PLSEditPlayer *__nonnull)player didGetOriginPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer __deprecated_msg("Method deprecated in v1.9.0. Use `player: didGetOriginPixelBuffer: timestamp:`"); -/** +/*! + @method player:didGetOriginPixelBuffer:timestamp: @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param player PLSEditPlayer 实例 + @param pixelBuffer CVPixelBufferRef 视频帧 @param timestamp 视频帧的时间戳 - + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef @since v1.9.0 */ - (CVPixelBufferRef __nonnull)player:(PLSEditPlayer *__nonnull)player didGetOriginPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer timestamp:(CMTime)timestamp; -/** +/*! + @method player:didReadyToPlayForItem:timeRange @brief 当前视频的播放时刻达到了视频开头 + + @param player PLSEditPlayer 实例 @param item 当前视频 @param timeRange 当前视频的有效视频区域,对应 PLSEditPlayer 的属性 @property (assign, nonatomic) CMTimeRange timeRange @@ -46,8 +63,11 @@ */ - (void)player:(PLSEditPlayer *__nonnull)player didReadyToPlayForItem:(AVPlayerItem *__nonnull)item timeRange:(CMTimeRange)timeRange; -/** +/*! + @method player:didReachEndForItem:timeRange @brief 当前视频的播放时刻达到了视频结尾 + + @param player PLSEditPlayer 实例 @param item 当前视频 @param timeRange 当前视频的有效视频区域,对应 PLSEditPlayer 的属性 @property (assign, nonatomic) CMTimeRange timeRange @@ -57,210 +77,225 @@ @end - +/*! + @class PLSEditPlayer + @brief 视频编辑播放器类 + + @since v1.1.0 + */ @interface PLSEditPlayer : AVPlayer -/** - @brief delegate +/*! + @property delegate + @brief id 类型代理 @since v1.1.0 */ @property (weak, nonatomic) __nullable id delegate; -/** +/*! + @property loopEnabled @brief 循环播放。设置为 YE,表示单曲循环。默认为 NO @since v1.1.0 */ @property (assign, nonatomic) BOOL loopEnabled; -/** +/*! + @property isPlaying @brief 播放器是否在播放状态 @since v1.1.0 */ @property (readonly, nonatomic) BOOL isPlaying; -/** +/*! + @property preview @brief 播放器的预览视图 @since v1.1.0 */ @property (strong, nonatomic) UIView *__nullable preview; -/** +/*! + @property fillMode @brief 播放器预览视图的填充方式 @since v1.1.0 */ @property (assign, nonatomic) PLSVideoFillModeType fillMode; -/** +/*! + @property volume @brief 播放器的音量 @since v1.1.0 */ @property (assign, nonatomic) float volume; -/** +/*! + @property timeRange @brief 播放器播放文件的 timeRange 范围内 [start, duration] 片段 @since v1.1.0 */ @property (assign, nonatomic) CMTimeRange timeRange; -/** +/*! + @property videoSize @brief 播放器播放视频的分辨率 @since v1.5.0 */ @property (assign, nonatomic) CGSize videoSize; -/** +/*! + @method audioPlayer @brief 初始化音频播放器 + @return 音频播放器 @since v1.3.0 */ + (PLSEditPlayer *_Nullable)audioPlayer; -/** +/*! + @method setItemByStringPath: @brief 通过 stringPath 加载 AVPlayerItem + @param stringPath 文件存放地址 + @since v1.1.0 */ - (void)setItemByStringPath:(NSString *__nullable)stringPath; -/** +/*! + @method setItemByUrl: @brief 通过 url 加载 AVPlayerItem + @param url 文件存放地址 + @since v1.1.0 */ - (void)setItemByUrl:(NSURL *__nullable)url; -/** +/*! + @method setItemByAsset: @brief 通过 asset 加载 AVPlayerItem + @param asset AVAsset 对象 + @since v1.1.0 */ - (void)setItemByAsset:(AVAsset *__nullable)asset; -/** +/*! + @method setItem: @brief 接收 item 去播放 + @param item AVPlayerItem 对象 + @since v1.1.0 */ - (void)setItem:(AVPlayerItem *__nullable)item; -/** +/*! + @method play @brief 播放 @since v1.1.0 */ - (void)play; -/** +/*! + @method pause @brief 暂停 @since v1.1.0 */ - (void)pause; -/** - * 开启水印 - * - * @param waterMarkImage 水印的图片 - * @param position 水印的位置 +/*! + @method setWaterMarkWithImage:position: + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 @since v1.1.0 */ - (void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position; -/** - * 开启水印 - * - * @param waterMarkImage 水印的图片 - * @param position 水印的位置 - * @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 +/*! + @method setWaterMarkWithImage:position:size: + @brief开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 @since v1.14.0 */ - (void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position size:(CGSize)size; -/** - * 开启水印 - * - * @param waterMarkImage 水印的图片 - * @param position 水印的位置 - * @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 - * @param type 水印的类型 - * @param alpha 水印的透明度 (0 ~ 1) - * @param degree 水印旋转角度 (单位:度) +/*! + @method setWaterMarkWithImage:position:size:waterMarkType:alpha:rotateDegree: + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + @param type 水印的类型 + @param alpha 水印的透明度 (0 ~ 1) + @param degree 水印旋转角度 (单位:度) @since v1.15.0 */ - (void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position size:(CGSize)size waterMarkType:(PLSWaterMarkType)type alpha:(CGFloat)alpha rotateDegree:(CGFloat)degree; -/** - * 开启水印,此方法只能设置 gif 水印 - * - * @param gifData gif 图片数据 - * @param position 水印的位置 - * @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 - * @param alpha 水印的透明度 (0 ~ 1) - * @param degree 水印旋转角度 (单位:度) +/*! + @method setGifWaterMarkWithData:position:size:alpha:rotateDegree: + @brief 开启水印,此方法只能设置 gif 水印 + + @param gifData gif 图片数据 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + @param alpha 水印的透明度 (0 ~ 1) + @param degree 水印旋转角度 (单位:度) @since v1.15.0 */ - (void)setGifWaterMarkWithData:(NSData *)gifData position:(CGPoint)position size:(CGSize)size alpha:(CGFloat)alpha rotateDegree:(CGFloat)degree; -/** - * 移除水印 +/*! + @method clearWaterMark + @brief 移除水印 @since v1.1.0 */ - (void)clearWaterMark; -/** - * 添加滤镜效果 - * - * @param colorImagePath 当前使用的滤镜的颜色表图的路径 +/*! + @method addFilter: + @brief 添加滤镜效果 - @since v1.5.0 - */ -- (void)addFilter:(NSString *_Nullable)colorImagePath; - -/** - * 添加 MV 图层方法 1, 相当于 addMVLayerWithColor:colorURL alpha:alphaURL timeRange:kCMTimeRangeZero loopEnable:NO - * - * @param colorURL 彩色层视频的地址 - * @param alphaURL 被彩色层当作透明层的视频的地址 + @param colorImagePath 当前使用的滤镜的颜色表图的路径 @since v1.5.0 */ -- (void)addMVLayerWithColor:(NSURL *_Nullable)colorURL alpha:(NSURL *_Nullable)alphaURL; - -/** - * 添加 MV 图层方法 2 - * - * @param colorURL 彩色层视频的地址 - * @param alphaURL 被彩色层当作透明层的视频的地址 - * @param timeRange 选取 MV 文件的时间段, 如果选取整个 MV,直接传入 kCMTimeRangeZero 即可 - * @param loopEnable 当 MV 时长(timeRange.duration)小于视频时长时,是否循环播放 MV - - @since v1.14.0 - */ -- (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL timeRange:(CMTimeRange)timeRange loopEnable:(BOOL)loopEnable; +- (void)addFilter:(NSString *_Nullable)colorImagePath; -/** +/*! + @method rotateVideoLayer @brief 旋转视频的方向,能将竖屏视频旋转为横屏视频,横屏视频旋转为竖屏视频 - * - * return PLSPreviewOrientation 当前视频的方向 + + @return PLSPreviewOrientation 当前视频的方向 @since v1.7.0 */ - (PLSPreviewOrientation)rotateVideoLayer; -/** +/*! + @method resetVideoLayerOrientation @brief 重置视频的旋转方向,视频的方向被置为视频的原始方向 @since v1.7.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSEditSettings.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSEditSettings.h similarity index 100% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSEditSettings.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSEditSettings.h diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h similarity index 76% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h index b1ff6a6a..e53db792 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h @@ -8,16 +8,24 @@ #import "PLSTransition.h" +/*! + @class PLSFadeTranstion + @brief 渐隐渐现动画类 + + @since v1.10.0 + */ @interface PLSFadeTranstion : PLSTransition -/** +/*! + @property fromOpacity @brief 起始透明度 @since v1.10.0 */ @property (nonatomic, assign) CGFloat fromOpacity; -/** +/*! + @property toOpacity @brief 结束透明度 @since v1.10.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSFilter.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSFilter.h similarity index 67% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSFilter.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSFilter.h index f69fea81..c277cead 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSFilter.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSFilter.h @@ -9,32 +9,44 @@ #import #import +/*! + @class PLSFilter + @brief 滤镜处理类 + + @since v1.3.0 + */ @interface PLSFilter : NSObject -/** +/*! + @property colorImagePath @abstract 色彩图片的路径 @since v1.3.0 */ @property (strong, nonatomic) NSString *colorImagePath; -/** +/*! + @method init @abstract 初始化滤镜实例 + @return PLSFilter 实例 @since v1.3.0 */ - (instancetype)init; -/** +/*! + @method initWithColorImagePath: @abstract 使用色彩图片初始化滤镜实例 @param colorImagePath 色彩图片的路径 + @return PLSFilter 实例 @since v1.1.0 */ - (instancetype)initWithColorImagePath:(NSString *)colorImagePath __deprecated; -/** +/*! + @method process: @abstract 处理图像,加滤镜效果 @param pixelBuffer 源图像数据 @@ -45,6 +57,17 @@ */ - (CVPixelBufferRef)process:(CVPixelBufferRef)pixelBuffer; +/*! + @method applyFilter:colorImagePath: + @abstract 处理图像,加滤镜效果 + + @param inputImage 待处理图片 + @param colorImagePath 滤镜资源文件路径 + + @return 处理之后的 UIImage 滤镜图像 + + @since v1.1.0 + */ + (UIImage *)applyFilter:(UIImage *)inputImage colorImagePath:(NSString *)colorImagePath; @end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSGifComposer.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSGifComposer.h similarity index 59% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSGifComposer.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSGifComposer.h index 76055c6a..0ab06a4d 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSGifComposer.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSGifComposer.h @@ -10,84 +10,92 @@ #import #import +/*! + @class PLSGifComposer + @brief 图片生成 GIF 类 + */ @interface PLSGifComposer : NSObject -/** +/*! + @property gifName @abstract Gif 的名称,可以为 nil。当为 nil 时,内部会自动生成一个唯一的名称 @since v1.3.0 */ @property (strong, nonatomic) NSString *gifName; -/** +/*! + @property completionBlock @abstract Gif 合成完成的 block。url 为 Gif 文件的地址 @since v1.3.0 */ @property (copy, nonatomic) void(^completionBlock)(NSURL *url); -/** +/*! + @property failureBlock @abstract Gif 合成失败的 block @since v1.3.0 */ @property (copy, nonatomic) void(^failureBlock)(NSError* error); -/** +/*! + @property interval @abstract Gif 动图每帧间隔设置,默认 0.1f,若需自定义,请在调用 composeGif 合成前,设置该属性 @since v1.4.0 */ @property (assign, nonatomic) CGFloat interval; -/** +/*! + @method initWithImagesArray: @brief 实例初始化方法 + @param imagesArray 图片数据 + @since v1.3.0 */ - (instancetype)initWithImagesArray:(NSArray *)imagesArray; -/** +/*! + @method composeGif @brief 将视频帧/图片数组合成为 Gif 动图,合成结果的回调见 completionBlock,failureBlock @since v1.3.0 */ - (void)composeGif; -/** +/*! + @method cancelComposeGif @brief 取消合成 Gif 动图 @since v1.4.0 */ - (void)cancelComposeGif; -/** +/*! + @method loadGifWithFrame:superView:repeatCount: @brief UIImageView 加载 Gif 图 - * - * @param frame UIImageView的frame - * - * @param superView UIImageView的父视图 - * - * @param repeatCount gif播放重复次数,0 为无限循环 + + @param frame UIImageView的frame + @param superView UIImageView的父视图 + @param repeatCount gif播放重复次数,0 为无限循环 @since v1.3.0 */ - (void)loadGifWithFrame:(CGRect)frame superView:(UIView *)superView repeatCount:(NSInteger)repeatCount; -/** +/*! + @method getImagesWithVideoURL:startTime:endTime:imageCount:imageSize:completionBlock: @brief 从视频中获取多张图片 - * - * @param videoURL 原视频的地址 - * - * @param startTime 从视频中获取图片的起始时间点 - * - * @param endTime 从视频中获取图片的结束时间点,如果设置为 0,则将使用视频总时长作为结束时间 - * - * @param imageCount 从视频中获取的图片总数 - * - * @param imageSize 获取图片的宽高 - * - * @param completionBlock 获取图片完成的回调 block. 如果发生错误,错误信息将通过 block 返回 + + @param videoURL 原视频的地址 + @param startTime 从视频中获取图片的起始时间点 + @param endTime 从视频中获取图片的结束时间点,如果设置为 0,则将使用视频总时长作为结束时间 + @param imageCount 从视频中获取的图片总数 + @param imageSize 获取图片的宽高 + @param completionBlock 获取图片完成的回调 block. 如果发生错误,错误信息将通过 block 返回 @since v1.16.0 */ @@ -98,20 +106,16 @@ imageSize:(CGSize)imageSize completionBlock:(void (^)(NSError *error, NSArray *images))completionBlock; -/** +/*! + @method getImagesWithAsset:startTime:endTime:imageCount:imageSize:completionBlock: @brief 从视频中获取多张图片 - * - * @param asset 视频 AVAsset 对象 - * - * @param startTime 从视频中获取图片的起始时间点 - * - * @param endTime 从视频中获取图片的结束时间点,如果设置为 0,则将使用视频总时长作为结束时间 - * - * @param imageCount 从视频中获取的图片总数 - * - * @param imageSize 获取图片的宽高 - * - * @param completionBlock 获取图片完成的回调 block. 如果发生错误,错误信息将通过 block 返回 + + @param asset 视频 AVAsset 对象 + @param startTime 从视频中获取图片的起始时间点 + @param endTime 从视频中获取图片的结束时间点,如果设置为 0,则将使用视频总时长作为结束时间 + @param imageCount 从视频中获取的图片总数 + @param imageSize 获取图片的宽高 + @param completionBlock 获取图片完成的回调 block. 如果发生错误,错误信息将通过 block 返回 @since v1.16.0 */ diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h similarity index 77% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h index d655c9d2..6d5d6af7 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h @@ -14,37 +14,54 @@ #import "PLSTypeDefines.h" @class PLSImageRotateRecorder; + +/*! + @protocol PLSImageRotateRecorderDelegate + @brief 图片旋转录制协议 + */ @protocol PLSImageRotateRecorderDelegate @optional #pragma mark -- 音视频采集数据的回调 -/** +/*! + @method imageRotateRecorder:didGetRotatePixelBuffer: @abstract 获取到旋转动画原数据时的回调, 便于开发者做滤镜等处理,需要注意的是这个是在视频采集的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 + @param recorder PLSImageRotateRecorder 实例 + @param pixelBuffer 视频帧数据 + @since v1.0.0 */ - (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didGetRotatePixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer; -/** +/*! + @method imageRotateRecorder:didGetMicrophoneSampleBuffer: @abstract 获取到麦克风原数据时的回调,需要注意的是这个回调在麦克风数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题 + @param recorder PLSImageRotateRecorder 实例 + @param sampleBuffer 音频帧数据 + @since v1.0.1 */ - (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didGetMicrophoneSampleBuffer:(CMSampleBufferRef __nonnull)sampleBuffer; #pragma mark -- 录制状态回调回调 -/** +/*! + @method imageRotateRecorder:didStartRecording: @abstract 录制开始回调(由于启动录制是一个耗时的过程,因此放在一个单独的线程中,调用 startRecording:只是通知启动录制,真正的开始录制由此回调告知) + @param recorder PLSImageRotateRecorder 实例 @param fileURL 录制文件保存的地址 @since v1.11.0 */ - (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didStartRecording:(NSURL *__nonnull)fileURL; -/** +/*! + @method imageRotateRecorder:didRecordingToOutputFileAtURL:fileDuration:totalDuration:currentAngle: @abstract 录制时长回调,录制过程中,这个方法会不断的回调 + @param recorder PLSImageRotateRecorder 实例 @param fileURL 当前正在录制的文件 @param fileDuration 当前正在录制的文件已录制时长 @param totalDuration 所有已经录制文件的总时长 @@ -54,9 +71,11 @@ */ - (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CMTime)fileDuration totalDuration:(CMTime)totalDuration currentAngle:(float)currentAngle; -/** +/*! + @method imageRotateRecorder:didFinishRecording:fileDuration:totalDuration:currentAngle: @abstract 录制结束回调(调用stopRecording,为了让所有音视频数据都写入到文件,会有一定的延时,因此这个回调是真正结束录制的通知) + @param recorder PLSImageRotateRecorder 实例 @param fileURL 录制文件保存的地址 @param fileDuration 当前录制完成文件的时长 @param totalDuration 已经录制完成的所有文件总时长 @@ -66,9 +85,11 @@ */ - (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didFinishRecording:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration currentAngle:(float)currentAngle; -/** +/*! + @method imageRotateRecorder:didDeleteFileAtURL:fileDuration:totalDuration:currentAngle: @abstract 删除一段视频之后的回调 + @param recorder PLSImageRotateRecorder 实例 @param fileURL 删除文件的地址 @param fileDuration 删除文件的时长 @param totalDuration 剩余文件的总时长 @@ -78,9 +99,11 @@ */ - (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didDeleteFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration currentAngle:(float)currentAngle; -/** +/*! + @method imageRotateRecorder:errorOccur: @abstract 录制过程中发生错误回调 + @param recorder PLSImageRotateRecorder 实例 @param error 错误信息 @since v1.11.0 @@ -90,14 +113,16 @@ @end -/** - * @abstract 图片旋转动画录制类,将图片动画和麦克风采集音频录制为视频文件 - * - * @discussion PLSImageRotateRecorder 内部包含了旋转动画图片的获取、渲染 和 麦克风音频数据的采集 +/*! + @class PLSImageRotateRecorder + @abstract 图片旋转动画录制类,将图片动画和麦克风采集音频录制为视频文件 + + @discussion PLSImageRotateRecorder 内部包含了旋转动画图片的获取、渲染 和 麦克风音频数据的采集 */ @interface PLSImageRotateRecorder : NSObject -/** +/*! + @method initWithVideoConfiguration:audioConfiguration: @abstract 初始化方法 @param videoConfiguration 视频参数设置。必须设置,不能为 nil, 否则初始化返回 nil @@ -107,70 +132,80 @@ - (nullable instancetype)initWithVideoConfiguration:(PLSVideoConfiguration *__nonnull)videoConfiguration audioConfiguration:(PLSAudioConfiguration *__nullable)audioConfiguration; -/** +/*! + @property delegate @brief 代理 @since v1.11.0 */ @property (nonatomic, weak) id __nullable delegate; -/** +/*! + @property callbackQueue @brief 触发代理对象回调时所在的任务队列。default main_queue @since v1.11.0 */ @property (nonatomic, assign) dispatch_queue_t __nullable callbackQueue; -/** +/*! + @property previewView @brief 预览 view @since v1.11.0 */ @property (nonatomic, readonly) UIView *__nonnull previewView; -/** +/*! + @property backgroundImage @brief 背景图片,必须设置 @since v1.11.0 */ @property (nonatomic, strong) UIImage * __nonnull backgroundImage; -/** +/*! + @property rotateImage @brief 旋转图片,必须设置 @since v1.11.0 */ @property (nonatomic, strong) UIImage *__nonnull rotateImage; -/** +/*! + @property rotateFrame @brief 设置旋转图片在视频中的大小和位置,必须设置。正在录制的时候不可设置, 相对于初始化 videoConfiguration.videoSize, 视频左上角为 {0,0} @since v1.11.0 */ @property (nonatomic, assign) CGRect rotateFrame; -/** +/*! + @property rotateSpeed @brief 旋转速度,多少秒转动一圈,正值为顺时针旋转、负值为逆时针旋转。建议设置范围: 5s ~ 20s. default: 10s @since v1.11.0 */ @property (nonatomic, assign) float rotateSpeed; -/** +/*! + @property fileType @brief 录制文件的类型。PLSFileTypeMPEG4(.mp4) 或者 PLSFileTypeQuickTimeMovie(.mov). default: PLSFileTypeMPEG4 @since v1.11.0 */ @property (nonatomic, assign) PLSFileType fileType; -/** +/*! + @property isRecording @brief 是否处于录制状态 @since v1.11.0 */ @property (nonatomic, readonly) BOOL isRecording; -/** +/*! + @method resetRotateToAngle: @abstract 重置录制角度。 stopRecording 之后,当前的角度会保持,下一次录制开始的时候, 角度接着上一次 stopRecording 时的角度。调用此方法,可以将角度重置为指定角度 @@ -180,35 +215,42 @@ */ - (void)resetRotateToAngle:(float)angle; -/** +/*! + @method getAllRecordingFiles @abstract 获取所有已经录制完成的视频地址 + @return 返回已经录制完成的所有视频段 @since v1.11.0 */ - (NSArray *__nullable)getAllRecordingFiles; -/** - @brief 返回代表当前所有录制视频段文件的 asset +/*! + @method assetRepresentingAllFiles + @brief 获取代表当前所有录制视频段文件的 asset + @return 返回代表当前所有录制视频段文件的 asset @since v1.11.0 */ - (AVAsset *__nullable)assetRepresentingAllFiles; -/** +/*! + @method deleteLastRecordingFile @abstract 删除最后一次录制完成的文件 @since v1.11.0 */ - (void)deleteLastRecordingFile; -/** +/*! + @method deleteAllRecordingFiles @abstract 删除所有已经录制完成的视频地址 @since v1.11.0 */ - (void)deleteAllRecordingFiles; -/** +/*! + @method startRecording: @abstract 开始录制 @param outURL 录制文件的保存位置。如果为 nil,则 SDK 内部会创建一个 @@ -216,14 +258,16 @@ */ - (void)startRecording:(NSURL *__nullable)outURL; -/** +/*! + @method stopRecording: @abstract 停止录制。如果当前处理录制状态,调用之后,已经录制的文件通过回调 (imageRotateRecorder:didFinishRecording:)返回 @since v1.11.0 */ - (void)stopRecording; -/** +/*! + @method cancelRecording @abstract 取消录制会停止视频录制并删除录制的视频段文件 @since v1.11.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSImageSetting.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSImageSetting.h similarity index 81% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSImageSetting.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSImageSetting.h index 7cfffe25..e315e72a 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSImageSetting.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSImageSetting.h @@ -8,30 +8,40 @@ #import +/*! + @class PLSImageSetting + @brief 转场动画图片设置 + + @since v1.10.0 + */ @interface PLSImageSetting : NSObject -/** +/*! + @property image @brief 图片实例 @since v1.10.0 */ @property (nonatomic, strong) UIImage *image; -/** +/*! + @property imageSize @brief 图片所占区域大小 @since v1.10.0 */ @property (nonatomic, assign) CGSize imageSize; -/** +/*! + @property startX @brief 图片所占区域的起始x位置,相对于PLSVideoSetting中设置的width的偏移像素 @since v1.10.0 */ @property (nonatomic, assign) CGFloat startX; -/** +/*! + @property startY @brief 图片所占区域的起始Y位置,相对于PLSVideoSetting中设置的height的偏移像素 @since v1.10.0 diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h new file mode 100644 index 00000000..268e8359 --- /dev/null +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h @@ -0,0 +1,139 @@ +// +// PLSImageToMovieComposer.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/11/18. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLSImageToMovieComposer + @abstract 图片合成视频类 + + @since v1.7.0 + */ +@interface PLSImageToMovieComposer : NSObject + +/*! + @property completionBlock + @abstract 图片合成视频完成的 block + + @since v1.7.0 + */ +@property (copy, nonatomic) void(^completionBlock)(NSURL *url); + +/*! + @property failureBlock + @abstract 图片合成视频失败的 block + + @since v1.7.0 + */ +@property (copy, nonatomic) void(^failureBlock)(NSError* error); + +/*! + @property processingBlock + @abstract 图片合成视频进度的 block,可在该 block 中刷新进度条 UI + + @since v1.7.0 + */ +@property (copy, nonatomic) void(^processingBlock)(float progress); + +/*! + @property videoSize + @abstract 视频文件的分辨率,默认为 544x960 + + @since v1.7.0 + */ +@property (assign, nonatomic) CGSize videoSize; + +/*! + @property videoFramerate + @abstract 视频文件的帧率, 默认为 30 帧 + + @since v1.7.0 + */ +@property (assign, nonatomic) NSUInteger videoFramerate; + +/*! + @property bitrate + @abstract 视频文件的码率,默认为 1024*1000 bps + + @since v1.7.0 + */ +@property (assign, nonatomic) CGFloat bitrate; + +/*! + @property transitionType + @abstract 转场动画类型,默认为渐入渐出 + + @since v1.7.0 + */ +@property (assign, nonatomic) PLSTransitionType transitionType; + +/*! + @property transitionDuration + @abstract 转场动画持续的时长,默认为1.0,即1秒 + + @since v1.8.0 + */ +@property (assign, nonatomic) CGFloat transitionDuration; + +/*! + @property imageDuration + @abstract 每张图片持续的时长,默认为2.0,即2秒 + + @since v1.8.0 + */ +@property (assign, nonatomic) CGFloat imageDuration; + +/*! + @property outputFileType + @brief 视频的文件类型,默认为 PLSFileTypeMPEG4(.mp4) + + @since v1.7.0 + */ +@property (assign, nonatomic) PLSFileType outputFileType; + +/*! + @method initWithImages: + @brief 初始化 + + @param images 用于生成视频文件的图片数组 + + @return PLSImageToMovieComposer 实例 + @since v1.7.0 + */ +- (instancetype)initWithImages:(NSArray *)images; + +/*! + @method initWithImageURLs: + @brief 初始化 + + @param urls 图片保存的路径数组 + + @return PLSImageToMovieComposer 实例 + @since v1.14.0 + */ +- (instancetype)initWithImageURLs:(NSArray *)urls; + +/*! + @method startComposing + @brief 执行图片合成视频 + + @since v1.7.0 + */ +- (void)startComposing; + +/*! + @method stopComposing + @brief 停止图片合成视频 + + @since v1.7.0 + */ +- (void)stopComposing; + +@end diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSMovieComposer.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSMovieComposer.h new file mode 100644 index 00000000..be2e7fc6 --- /dev/null +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSMovieComposer.h @@ -0,0 +1,132 @@ +// +// PLSMovieComposer.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/8/23. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLSMovieComposer + @abstract 多个视频拼接类 + + @since v1.4.0 + */ +@interface PLSMovieComposer : NSObject + +/*! + @property completionBlock + @abstract 视频拼接完成的 block + + @since v1.4.0 + */ +@property (copy, nonatomic) void(^completionBlock)(NSURL *url); + +/*! + @property failureBlock + @abstract 视频拼接失败的 block + + @since v1.4.0 + */ +@property (copy, nonatomic) void(^failureBlock)(NSError* error); + +/*! + @property processingBlock + @abstract 视频拼接进度的 block,可在该 block 中刷新进度条 UI + + @since v1.4.0 + */ +@property (copy, nonatomic) void(^processingBlock)(float progress); + +/*! + @property isExportMovieToPhotosAlbum + @brief 将视频导出到相册,默认为 NO + + @since v1.4.0 + */ +@property (assign, nonatomic) BOOL isExportMovieToPhotosAlbum; + +/*! + @property outputFileType + @abstract 拼接后视频的格式,默认为 PLSFileTypeMPEG4(.mp4) + + @since v1.6.0 + */ +@property (assign, nonatomic) PLSFileType outputFileType; + +/*! + @property videoSize + @abstract 拼接后视频的分辨率,默认为第1个视频的分辨率 + + @since v1.4.0 + */ +@property (assign, nonatomic) CGSize videoSize; + +/*! + @property videoFrameRate + @abstract 拼接后视频数据的帧率,默认为 25 + + @since v1.6.0 + */ +@property (assign, nonatomic) int videoFrameRate; + +/*! + @property bitrate + @abstract 拼接后视频的码率,默认码率为 1024*1000 bps + + @since v1.6.0 + */ +@property (assign, nonatomic) float bitrate; + +/*! + @property composerPriorityType + @abstract 拼接策略,默认:PLSComposerPriorityTypeSync + + @since v1.14.0 + */ +@property (assign, nonatomic) PLSComposerPriorityType composerPriorityType; + +/*! + @method initWithAssets: + @brief 初始化 + + @param assets 待合并的视频 AVAsset 资源 + + @return PLSMovieComposer 实例 + @since v1.4.0 + */ +- (instancetype)initWithAssets:(NSArray *)assets; + +/*! + @method initWithUrls: + @brief 初始化 + + @param urls 待合并的视频存放地址 + + @return PLSMovieComposer 实例 + @since v1.4.0 + */ +- (instancetype)initWithUrls:(NSArray *)urls; + +/*! + @method startComposing + @brief 执行视频拼接 + + @since v1.4.0 + */ +- (void)startComposing; + +/*! + @method stopComposing + @brief 停止视频拼接s + + @since v1.4.0 + */ +- (void)stopComposing; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSPositionTransition.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSPositionTransition.h similarity index 80% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSPositionTransition.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSPositionTransition.h index 046319c3..aadbe7be 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSPositionTransition.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSPositionTransition.h @@ -8,16 +8,24 @@ #import "PLSTransition.h" +/*! + @class PLSPositionTransition + @brief 位置变化动画类 + + @since v1.10.0 + */ @interface PLSPositionTransition : PLSTransition -/** +/*! + @property fromPoint @brief 起始位置,相对于PLSVideoSetting中设置的width、height的偏移像素 @since v1.10.0 */ @property (nonatomic, assign) CGPoint fromPoint; -/** +/*! + @property toPoint @brief 结束位置, 相对于PLSVideoSetting中设置的width、height的偏移像素 @since v1.10.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSRotateTransition.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSRotateTransition.h similarity index 78% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSRotateTransition.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSRotateTransition.h index 3cbe56bb..a3f713b5 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSRotateTransition.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSRotateTransition.h @@ -8,9 +8,16 @@ #import "PLSTransition.h" +/*! + @class PLSRotateTransition + @brief 旋转动画类 + + @since v1.10.0 + */ @interface PLSRotateTransition : PLSTransition -/** +/*! + @property fromAngle @brief 旋转起始角度(-2*M_PI ~ 2*M_PI) @since v1.10.0 @@ -18,7 +25,8 @@ @property (nonatomic, assign) CGFloat fromAngle; -/** +/*! + @property toAngle @brief 旋转结束角度(-2*M_PI ~ 2*M_PI) @since v1.10.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSScaleTransition.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSScaleTransition.h similarity index 78% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSScaleTransition.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSScaleTransition.h index fbffa408..0bb9a2d5 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSScaleTransition.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSScaleTransition.h @@ -8,16 +8,24 @@ #import "PLSTransition.h" +/*! + @class PLSScaleTransition + @brief 缩放动画类 + + @since v1.10.0 + */ @interface PLSScaleTransition : PLSTransition -/** +/*! + @property fromScale @brief 放大或者缩小的起始值 @since v1.10.0 */ @property (nonatomic, assign) CGFloat fromScale; -/** +/*! + @property toScale @brief 放大或者缩小的结束值 @since v1.10.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSTextSetting.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTextSetting.h similarity index 81% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSTextSetting.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTextSetting.h index ad599838..b72a9854 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSTextSetting.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTextSetting.h @@ -8,44 +8,56 @@ #import +/*! + @class PLSTextSetting + @brief 转场动画文字设置 + + @since v1.10.0 + */ @interface PLSTextSetting : NSObject -/** +/*! + @property text @brief 内容 @since v1.10.0 */ @property (nonatomic, copy) NSString *text; -/** +/*! + @property textFont @brief 文字字体 @since v1.10.0 */ @property (nonatomic, strong) UIFont *textFont; -/** +/*! + @property textColor @brief 文字颜色 @since v1.10.0 */ @property (nonatomic, strong) UIColor *textColor; -/** +/*! + @property textSize @brief 内容所占区域大小 @since v1.10.0 */ @property (nonatomic, assign) CGSize textSize; -/** +/*! + @property startX @brief 文字所占区域的起始x位置,相对于PLSVideoSetting中设置的width的偏移像素 @since v1.10.0 */ @property (nonatomic, assign) CGFloat startX; -/** +/*! + @property startY @brief 文字所占区域的起始Y位置,相对于PLSVideoSetting中设置的height的偏移像素 @since v1.10.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSTransition.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTransition.h similarity index 83% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSTransition.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTransition.h index e9b53eee..12ed3684 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSTransition.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTransition.h @@ -8,27 +8,37 @@ #import +/*! + @class PLSTransition + @brief 转场动画类 + + @since v1.10.0 + */ @interface PLSTransition : NSObject -/** +/*! + @property durationInMs @brief 动画时长,毫秒 @since v1.10.0 */ @property (nonatomic, assign) double durationInMs; -/** +/*! + @property startTimeInMs @brief 动画开始时间,毫秒 @since v1.10.0 */ @property (nonatomic, assign) double startTimeInMs; -/** +/*! + @method animationWithScale: @abstract 根据配置的参数,返回一个CAAnimation对象,预览view的尺寸和导出视频的尺寸不一样的时候,为了能让预览效果达到和导出视频一样效果,需要对动画的位置等做比例缩放 @param scale 如果CAAnimation用于预览,sacel = 预览view的width / 导出视频的width 如果CAAnimation用于生产最终视频,scale = 背景视频的width / 导出视频的width + @return CAAnimation 实例 @since v1.10.0 */ - (CAAnimation *)animationWithScale:(CGFloat)scale; diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTransitionAssetExport.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTransitionAssetExport.h new file mode 100644 index 00000000..206a63f3 --- /dev/null +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTransitionAssetExport.h @@ -0,0 +1,42 @@ +// +// PLSTransitionAssetExport.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/1/23. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTransition.h" +#import "PLSImageSetting.h" +#import "PLSTextSetting.h" + +/*! + @class PLSTransitionAssetExport + @brief 转场动画导出类 + */ +@interface PLSTransitionAssetExport : NSObject + +/*! + @property scale + @brief 设置背景视频和生成的视频的大小比例,用来调整文字或者图片在背景视屏中的相对位置和大小 + */ +@property (nonatomic, assign) CGFloat scale; + +- (void)addText:(PLSTextSetting *)textSetting transition:(NSArray *)transitions; + +- (void)addImage:(PLSImageSetting *)imageSetting transition:(NSArray *)transitions; + +- (void)startWithAsset:(AVAsset *)asset + outURL:(NSURL *)outURL + outPixelSize:(CGSize)outSize + totalDuration:(float)duration + frameRate:(float)frameRate + backgroundColor:(UIColor *)backgroundColor + progress:(void(^)(float progress))progressBlock + complete:(void(^)(bool isSucceed, NSError *error))completeBlock; + +- (void)cancelExport; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h similarity index 78% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h index e5d269e6..a9aff670 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h @@ -14,29 +14,45 @@ #define INVALID_RESOURCEID (0) @class PLSTransitionMaker; + +/*! + @protocol PLSTransitionMakerDelegate + @brief 转场动画制作协议 + + @since v1.10.0 + */ @protocol PLSTransitionMakerDelegate < NSObject > @optional -/** +/*! + @method transitionMakerPreviewEnd: @abstract 预览结束会回调 + @param transitionMaker PLSTransitionMaker 实例 + @since v1.10.0 */ - (void)transitionMakerPreviewEnd:(PLSTransitionMaker *)transitionMaker; -/** +/*! + @method transitionMaker:exportMediaSucceed: @abstract 文字转视频成功回调, + + @param transitionMaker PLSTransitionMaker 实例 @param outURL 存放导出视频的url @since v1.10.0 */ - (void)transitionMaker:(PLSTransitionMaker *)transitionMaker exportMediaSucceed:(NSURL *)outURL; -/** +/*! + @method transitionMaker:exportMediaFailed: @abstract 文字转视频失败回调 + + @param transitionMaker PLSTransitionMaker 实例 @param error 导出视频错误信息 @since v1.10.0 @@ -46,74 +62,90 @@ NSObject @end - +/*! + @class PLSTransitionMaker + @brief 转场动画制作类 + + @since v1.10.0 + */ @interface PLSTransitionMaker : NSObject -/** +/*! + @property outPixelSize @brief 生成视频的宽高,建议和背景视频宽高比例保持一致. must set @since v1.10.0 */ @property (nonatomic, assign) CGSize outPixelSize; -/** +/*! + @property outFrameRate @brief 生成视频的帧率,= 0时,将使用背景视频的frameRate @since v1.10.0 */ @property (nonatomic, assign) float outFrameRate; -/** +/*! + @property backgroundColor @brief 生成视频底色, default: nil @since v1.10.0 */ @property (nonatomic, strong) UIColor *backgroundColor; -/** +/*! + @property totalDuration @brief 视频总时长, default: 2.5s @since v1.10.0 */ @property (nonatomic, assign) double totalDuration; -/** +/*! + @property delegate @brief 代理 @since v1.10.0 */ @property (nonatomic, weak) id delegate; -/** +/*! + @property exportProgressBlock @brief 生成视频进度 block 回调 @since v1.10.0 */ @property (copy, nonatomic) void(^exportProgressBlock)(CGFloat progress); -/** +/*! + @property preview @brief 预览view @since v1.10.0 */ @property (nonatomic, readonly) UIView *preview; -/** +/*! + @property backgroundVideoURL @brief 背景视频的URL(提供一个纯白或纯黑的视频作为文字的背景) @since v1.10.0 */ @property (nonatomic, strong) NSURL *backgroundVideoURL; -/** +/*! + @property outputVideoURL @brief 最终生成的视频的存放URL @since v1.10.0 */ @property (nonatomic, strong) NSURL *outputVideoURL; -/** +/*! + @method addText: @abstract 添加PLSTextSetting + @param textSetting 要添加的实例 @return 返回唯一的resourceID编号,后面更新此textSetting的时候,带上返回的编号 @@ -121,8 +153,10 @@ NSObject */ - (NSInteger)addText:(PLSTextSetting *)textSetting; -/** +/*! + @method addImage: @abstract 添加PLSImageSetting + @param imageSetting 要添加的实例 @return 返回唯一的resourceID编号,后面更新此imageSetting的时候,带上返回的编号 @@ -130,8 +164,10 @@ NSObject */ - (NSInteger)addImage:(PLSImageSetting *)imageSetting; -/** +/*! + @method addTransition:resourceID: @abstract 添加PLSTransition到知道资源 + @param transition 要添加的动画 @param resourceID 动画作用的资源编号 @@ -139,8 +175,10 @@ NSObject */ - (void)addTransition:(PLSTransition *)transition resourceID:(NSInteger)resourceID; -/** +/*! + @method updateTextWithResourceID:newTextSetting: @abstract 更新textsetting + @param resourceID 更新的PLSTextSetting编号 @param textSetting 新的PLSTextSetting实例,如果为nil,则执行删除resourceID操作 @@ -148,8 +186,10 @@ NSObject */ - (void)updateTextWithResourceID:(NSInteger)resourceID newTextSetting:(PLSTextSetting *)textSetting; -/** +/*! + @method updateImageWithResourceID:newImageSetting: @abstract 更新imageSetting + @param resourceID 更新的PLSImageSetting编号 @param imageSetting 新的PLSImageSetting实例,如果为nil,则执行删除resourceID操作 @@ -157,35 +197,40 @@ NSObject */ - (void)updateImageWithResourceID:(NSInteger)resourceID newImageSetting:(PLSImageSetting *)imageSetting; -/** +/*! + @method removeAllResource @abstract 删除所有文字和图片 @since v1.10.0 */ - (void)removeAllResource; -/** +/*! + @method play @abstract 播放 @since v1.10.0 */ - (void)play; -/** +/*! + @method stop @abstract 停止播放 @since v1.10.0 */ - (void)stop; -/** +/*! + @method startMaking @abstract 开始制作视频 @since v1.10.0 */ - (void)startMaking; -/** +/*! + @method cancelMaking @abstract 取消视频制作 @since v1.10.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSTypeDefines.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTypeDefines.h similarity index 66% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSTypeDefines.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTypeDefines.h index 9cd824b3..fffd7a69 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSTypeDefines.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSTypeDefines.h @@ -26,13 +26,13 @@ extern NSString *PLSMicrophoneAuthorizationStatusDidGetNotificaiton; extern NSString *PLSCameraDidStartRunningNotificaiton; extern NSString *PLSMicrophoneDidStartRunningNotificaiton; -/** +/*! @typedef PLSAuthorizationStatus @abstract 设备授权状态。 @since v1.0.0 */ -typedef NS_ENUM(NSUInteger, PLSAuthorizationStatus) { +typedef enum { /// 还没有确定是否授权 PLSAuthorizationStatusNotDetermined = 0, /// 设备受限,一般在家长模式下设备会受限 @@ -41,51 +41,45 @@ typedef NS_ENUM(NSUInteger, PLSAuthorizationStatus) { PLSAuthorizationStatusDenied, /// 已授权 PLSAuthorizationStatusAuthorized -}; +} PLSAuthorizationStatus; -/** +/*! @typedef PLSVideoFillModeType @abstract 视频预览填充模式。 @since v1.0.0 */ typedef enum { - /** - @brief Stretch to fill the full view, which may distort the image outside of its normal aspect ratio - */ + /// Stretch to fill the full view, which may distort the image outside of its normal aspect ratio PLSVideoFillModeStretch, - /** - @brief Maintains the aspect ratio of the source image, adding bars of the specified background color - */ + /// Maintains the aspect ratio of the source image, adding bars of the specified background color PLSVideoFillModePreserveAspectRatio, - /** - @brief Maintains the aspect ratio of the source image, zooming in on its center to fill the view - */ + /// Maintains the aspect ratio of the source image, zooming in on its center to fill the view PLSVideoFillModePreserveAspectRatioAndFill } PLSVideoFillModeType; -/** +/*! @typedef PLSPreviewOrientation @abstract 预览视图的方向。 @since v1.3.0 */ -typedef NS_ENUM(NSInteger, PLSPreviewOrientation) { +typedef enum { PLSPreviewOrientationPortrait = 0, PLSPreviewOrientationPortraitUpsideDown = 1, PLSPreviewOrientationLandscapeRight = 2, PLSPreviewOrientationLandscapeLeft = 3, -}; +} PLSPreviewOrientation; -/** +/*! @typedef PLSVideoRecoderRateType @abstract 视频拍摄速率。 @since v1.4.0 */ -typedef NS_ENUM(NSInteger, PLSVideoRecoderRateType) { +typedef enum { /** @brief Maintains the video recoder rate normal, 1x */ @@ -110,33 +104,36 @@ typedef NS_ENUM(NSInteger, PLSVideoRecoderRateType) { @brief Maintains the video recoder rate very fast, 2x */ PLSVideoRecoderRateTopFast -}; + +} PLSVideoRecoderRateType; #pragma mark - Audio SampleRate -/** +/*! @typedef PLSAudioSampleRate - @abstract 音频编码采样率。音频编码采样率 和 音频编码的码率直接相关。下表为码率推荐表: - |================================================================| - | 采样率 Hz | 推荐码率(单声道)bps | 推荐码率 (双声道) bps | - |================================================================| - | 48000 | 64*1000 | 128*1000 | - |----------------------------------------------------------------| - | 44100 | 64*1000 | 128*1000 | - |----------------------------------------------------------------| - | 22050 | 32*1000 | 64*1000 | - |----------------------------------------------------------------| - | 16000 | 32*1000 | 64*1000 | - |----------------------------------------------------------------| - | 11025 | 32*1000 | 32*1000 | - |----------------------------------------------------------------| + @abstract 音频编码采样率。 - 更多详细的码率设置,可以参考如下网页: - http://wiki.hydrogenaud.io/index.php?title=Fraunhofer_FDK_AAC#Bitrate_Modes + @discussion 音频编码采样率 和 音频编码的码率直接相关。下表为码率推荐表: + + |================================================================|
+ | 采样率 Hz | 推荐码率(单声道)bps | 推荐码率 (双声道) bps |
+ |================================================================|
+ | 48000 | 64*1000 | 128*1000 |
+ |----------------------------------------------------------------|
+ | 44100 | 64*1000 | 128*1000 |
+ |----------------------------------------------------------------|
+ | 22050 | 32*1000 | 64*1000 |
+ |----------------------------------------------------------------|
+ | 16000 | 32*1000 | 64*1000 |
+ |----------------------------------------------------------------|
+ | 11025 | 32*1000 | 32*1000 |
+ |----------------------------------------------------------------|
+ 更多详细的码率设置,可以参考如下网页: + http://wiki.hydrogenaud.io/index.php?title=Fraunhofer_FDK_AAC#Bitrate_Modes @since v1.0.0 */ -typedef NS_ENUM(NSUInteger, PLSAudioSampleRate) { +typedef enum { /** @brief PLSAudioSampleRate_48000Hz 48000Hz 音频编码采样率 */ @@ -163,11 +160,12 @@ typedef NS_ENUM(NSUInteger, PLSAudioSampleRate) { @brief PLSAudioSampleRate_11025Hz 11025Hz 音频编码采样率 */ PLSAudioSampleRate_11025Hz = 11025, -}; + +} PLSAudioSampleRate; #pragma mark - Audio BitRate -/** +/*! @typedef PLSAudioBitRate @abstract 音频编码码率。 @@ -213,25 +211,29 @@ typedef enum { #pragma mark - Video File Type -/** +/*! + @typedef PLSFileType + @abstract 视频格式 @since v1.0.5 */ -typedef NS_ENUM(NSUInteger, PLSFileType) { +typedef enum { PLSFileTypeMPEG4, // .mp4 PLSFileTypeQuickTimeMovie, // .mov PLSFileTypeM4A, // .m4a -}; +} PLSFileType; #pragma mark - Video File Preset -/** +/*! + @typedef PLSFilePreset + @abstract 视频分辨率 @since v1.0.5 */ -typedef NS_ENUM(NSUInteger, PLSFilePreset) { +typedef enum { PLSFilePresetLowQuality, PLSFilePresetMediumQuality, PLSFilePresetHighestQuality, @@ -239,96 +241,94 @@ typedef NS_ENUM(NSUInteger, PLSFilePreset) { PLSFilePreset960x540, PLSFilePreset1280x720, PLSFilePreset1920x1080, -}; +} PLSFilePreset; #pragma mark - Video File Transition Animation -/** +/*! + @typedef PLSTransitionType + @abstract 视频转场动画效果 @since v1.7.0 */ -typedef NS_ENUM(NSUInteger, PLSTransitionType) { +typedef enum { PLSTransitionTypeFade = 0, // 淡入淡出 -}; +} PLSTransitionType; + +/*! + @typedef PLSComposerPriorityType -/** @abstract 多个视频拼接的时候,采用的拼接策略: 由于视频文件的音频通道和视频通道时长不一定相等(其实总是不相等,只是相差时间很短), - 在多个视频拼接为一个视频的时候,音视频通道的总时长相差会变大,这可能不是开发者想要的结果。因此提供两种模式供开发者选择 + 在多个视频拼接为一个视频的时候,音视频通道的总时长相差会变大,这可能不是开发者想要的结果。因此提供几种模式供开发者选择 @since v1.14.0 */ -typedef NS_ENUM(NSUInteger, PLSComposerPriorityType) { +typedef enum { /** - @brief 以拼接之后,单个视频时间段内音视频同步优先,这是默认模式:这种模式的好处是无论拼接多少个文件,总是能保证拼接后的文件音视频是同步的, - 不好之处是拼接处可能会有音频的卡顿 + @brief 以拼接之后,单个视频时间段内音视频同步优先,这是默认模式:这种模式的好处是无论拼接多少个文件,总是能保证拼 + 接后的文件音视频是同步的,不好之处是拼接处可能会有音频的卡顿 */ PLSComposerPriorityTypeSync = 0, /** @brief 以拼接之后,音视频播放连续性优先:这种模式的好处是无论拼接多少个文件,总是能保证拼接后的文件播放是流畅的, - 不好之处是可能引起音视频不同步 + 不好之处是可能引起音视频不同步 */ PLSComposerPriorityTypeSmooth, /** - @brief 以拼接的文件视频通道长度为准,当参与拼接文件的音频通道时长比视频通道时长长的时候,将多出的音频数据丢弃掉。当视音频通道时长比视频通道 - 时长短的视频,则将音频通道补齐和视频通道一样长。当一段视频中,音频数据和视频数据时长相差较大(超过 0.1 秒)时,不建议使用这种模式 + @brief 以拼接的文件视频通道长度为准,当参与拼接文件的音频通道时长比视频通道时长长的时候,将多出的音频数据丢弃掉。 + 当视音频通道时长比视频通道时长短的视频,则将音频通道补齐和视频通道一样长。当一段视频中,音频数据和视频数据时长相 + 差较大(超过 0.1 秒)时,不建议使用这种模式 @since v1.16.0 */ PLSComposerPriorityTypeVideo, /** - @brief 以拼接的文件音频通道长度为准,当参与拼接文件的视频通道时长比音频通道时长长的时候,将多出的视频数据丢弃掉。当视频通道时长比音频通道 - 时长短的视频,则将视频通道补齐和音频通道一样长。当一段视频中,音频数据和视频数据时长相差较大(超过 0.1 秒)时,不建议使用这种模式 + @brief 以拼接的文件音频通道长度为准,当参与拼接文件的视频通道时长比音频通道时长长的时候,将多出的视频数据丢弃掉。 + 当视频通道时长比音频通道时长短的视频,则将视频通道补齐和音频通道一样长。当一段视频中,音频数据和视频数据时长相差 + 较大(超过 0.1 秒)时,不建议使用这种模式 @since v1.16.0 */ PLSComposerPriorityTypeAudio, -}; +} PLSComposerPriorityType; -/** +/*! + @typedef PLSWaterMarkType + @abstract 水印的类型 @since v1.15.0 */ -typedef NS_ENUM(NSUInteger, PLSWaterMarkType) { +typedef enum { - /** - @brief 静态水印,比如:PNG、JPG 等静态图片 - */ + // 静态水印,比如:PNG、JPG 等静态图片 PLSWaterMarkTypeStatic = 0, - /** - @brief GIF 水印 - */ + // GIF 水印 PLSWaterMarkTypeGif, -}; +} PLSWaterMarkType; -/** +/*! + @typedef PLSMediaType + @abstract 媒体类型 @since v1.16.0 */ -typedef NS_ENUM(NSUInteger, PLSMediaType) { +typedef enum { - /** - @brief 图片 - */ + // 图片 PLSMediaTypeImage = 0, - - /** - @brief 视频 - */ + // 视频 PLSMediaTypeVideo, - - /** - @brief GIF - */ + // GIF PLSMediaTypeGIF, -}; +} PLSMediaType; /*! @@ -336,7 +336,7 @@ typedef NS_ENUM(NSUInteger, PLSMediaType) { @abstract 短视频日志级别。 @since v2.1.0 */ -typedef NS_ENUM(NSUInteger, PLShortVideoLogLevel){ +typedef enum { // No logs PLShortVideoLogLevelOff = 0, // Error logs only @@ -349,7 +349,7 @@ typedef NS_ENUM(NSUInteger, PLShortVideoLogLevel){ PLShortVideoLogLevelDebug, // Error, warning, info, debug and verbose logs PLShortVideoLogLevelVerbose, -}; +} PLShortVideoLogLevel; /*! @@ -357,14 +357,14 @@ typedef NS_ENUM(NSUInteger, PLShortVideoLogLevel){ @abstract SDK 授权状态查询。 @since v1.16.1 */ -typedef NS_ENUM(NSUInteger, PLSAuthenticationResult) { +typedef enum { // 还没有确定是否授权 PLSAuthenticationResultNotDetermined = 0, // 未授权 PLSAuthenticationResultDenied, // 已成功 PLSAuthenticationResultAuthorized -}; +} PLSAuthenticationResult; #endif diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h similarity index 75% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h index d04b80b7..7ecb4a55 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h @@ -8,30 +8,38 @@ #import +/*! + @class PLSUploaderConfiguration + @brief 上传的参数配置类 + */ @interface PLSUploaderConfiguration : NSObject -/** +/*! + @property token @brief 上传视频空间 token @since v1.0.4 */ @property (nonatomic, strong)NSString * _Nonnull token; -/** +/*! + @property videoKey @brief 上传视频空间设置的 key,默认为当前上传视频文件的 hash 值 @since v1.0.4 */ @property (nonatomic, strong)NSString * _Nullable videoKey; -/** +/*! + @property https @brief 上传视频空间是否需要设置为 https 上传, YES 为 https 上传,NO 为 http 上传,默认为 YES @since v1.0.4 */ @property (nonatomic, assign, getter=isHttps)BOOL https; -/** +/*! + @property recorder @brief 断点续传文件记录 @discussion 默认为 Documents 下 PLShortVideoUploaderRecorder, 即:Documents/PLShortVideoUploaderRecorder @warning 断点续上传要求:1 文件本身内容不发生变化 @@ -42,35 +50,55 @@ */ @property (nonatomic, strong)NSString * _Nullable recorder; -/** +/*! + @property params @brief 上传视频空间设置的 key,默认为当前上传视频文件的 hash 值 @since v1.0.4 */ @property (nonatomic, strong)NSDictionary * _Nullable params; -/** +/*! + @method initWithToken:videoKeyhttps:recorder @abstract PLSUploaderConfiguration 初始化方法 @warning token 必填,不能为空 + @param token 上传的 token 值 + @param videoKey 上传的 key 值 + @param https 是否使用 https 上传 + @param recorder 断点记录 + + @return PLSUploaderConfiguration 实例 @since v1.0.4 */ - (instancetype _Nullable)initWithToken:(NSString * _Nonnull)token videoKey:(NSString * _Nullable)videoKey https:(BOOL)https recorder:(NSString * _Nullable)recorder; -/** +/*! + @method defaultWithToken: @abstract 使用默认配置生成一个 PLSUploaderConfiguration 对象 @discussion 调用此方法,除 token 之外,其他值均为默认值 + @param token 上传的 token 值 + + @return PLSUploaderConfiguration 实例 @since v1.0.4 */ + (instancetype _Nullable)defaultWithToken:(NSString * _Nonnull)token; -/** +/*! + @method initWithToken:videoKey:https:recorder:params @abstract PLSUploaderConfiguration 初始化方法 @warning token 必填,不能为空 + @param token 上传的 token 值 + @param videoKey 上传的 key 值 + @param https 是否使用 https 上传 + @param recorder 断点记录 + @param params 上传参数 + + @return PLSUploaderConfiguration 实例 @since v1.0.4 */ - (instancetype _Nullable)initWithToken:(NSString * _Nonnull)token diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h similarity index 67% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h index 5d958da0..7e5c69fe 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h @@ -7,81 +7,100 @@ // #import - +/*! + @class PLSUploaderResponseInfo + @brief 上传完成的反馈信息 + */ @interface PLSUploaderResponseInfo : NSObject -/** - * 状态码 +/*! + @property statusCode + @brief 状态码 */ @property (readonly) int statusCode; -/** - * 七牛服务器生成的请求ID,用来跟踪请求信息,如果使用过程中出现问题,请反馈此ID +/*! + @property reqId + @brief 七牛服务器生成的请求ID,用来跟踪请求信息,如果使用过程中出现问题,请反馈此ID */ @property (nonatomic, copy, readonly) NSString * _Nullable reqId; -/** - * 七牛服务器内部跟踪记录 +/*! + @property xlog + @brief 七牛服务器内部跟踪记录 */ @property (nonatomic, copy, readonly) NSString * _Nullable xlog; -/** - * cdn服务器内部跟踪记录 +/*! + @property xvia + @brief cdn服务器内部跟踪记录 */ @property (nonatomic, copy, readonly) NSString * _Nullable xvia; -/** - * 错误信息,出错时请反馈此记录 +/*! + @property error + @brief 错误信息,出错时请反馈此记录 */ @property (nonatomic, copy, readonly) NSError * _Nullable error; -/** - * 服务器域名 +/*! + @property host + @brief 服务器域名 */ @property (nonatomic, copy, readonly) NSString * _Nullable host; -/** - * 请求消耗的时间,单位 秒 +/*! + @property duration + @brief 请求消耗的时间,单位 秒 */ @property (nonatomic, readonly) double duration; -/** - * 服务器IP +/*! + @property serverIp + @brief 服务器IP */ @property (nonatomic, readonly) NSString * _Nullable serverIp; -/** - * 客户端id +/*! + @property id + @brief 客户端id */ @property (nonatomic, readonly) NSString * _Nullable id; -/** - * 时间戳 +/*! + @property timeStamp + @brief 时间戳 */ @property (readonly) UInt64 timeStamp; -/** - * 是否取消 +/*! + @property canceled + @brief 是否取消 */ @property (nonatomic, readonly, getter=isCancelled) BOOL canceled; -/** - * 成功的请求 +/*! + @property ok + @brief 成功的请求 */ @property (nonatomic, readonly, getter=isOK) BOOL ok; -/** - * 是否网络错误 +/*! + @property broken + @brief 是否网络错误 */ @property (nonatomic, readonly, getter=isConnectionBroken) BOOL broken; -/** - * 是否为 七牛响应 +/*! + @property notQiniu + @brief 是否为 七牛响应 */ @property (nonatomic, readonly, getter=isNotQiniu) BOOL notQiniu; -/** +/*! + @method initWithStatusCode:reqId:xlog:xvia:error:host:duration:serverIp:id:timeStamp:canceled:ok:broken:notQiniu: @abstract PLSUploaderResponInfo 初始化方法 + @return PLSUploaderResponseInfo 实例 @since v1.0.4 */ diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h similarity index 86% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h index 02ff8624..93bf371a 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h @@ -10,65 +10,79 @@ #import #import +/*! + @class PLSVideoConfiguration + @brief 采集和录制文件编码视频参数配置类 + + @since v1.0.0 + */ @interface PLSVideoConfiguration : NSObject -/** +/*! + @property videoFrameRate @brief 采集的视频数据的帧率,默认为 25 @since v1.0.0 */ @property (assign, nonatomic) NSUInteger videoFrameRate; -/** +/*! + @property sessionPreset @brief 采集的视频的 sessionPreset,默认为 AVCaptureSessionPreset1280x720 @since v1.0.0 */ @property (strong, nonatomic) NSString *sessionPreset; -/** +/*! + @property previewMirrorFrontFacing @brief 前置预览是否开启镜像,默认为 YES @since v1.0.0 */ @property (assign, nonatomic) BOOL previewMirrorFrontFacing; -/** +/*! + @property previewMirrorRearFacing @brief 后置预览是否开启镜像,默认为 NO @since v1.0.0 */ @property (assign, nonatomic) BOOL previewMirrorRearFacing; -/** - * 前置摄像头,录制的流是否开启镜像,默认 NO +/*! + @property streamMirrorFrontFacing + @brief 前置摄像头,录制的流是否开启镜像,默认 NO @since v1.0.0 */ @property (assign, nonatomic) BOOL streamMirrorFrontFacing; -/** +/*! + @property streamMirrorRearFacing @brief 后置摄像头,录制的流是否开启镜像,默认 NO @since v1.0.0 */ @property (assign, nonatomic) BOOL streamMirrorRearFacing; -/** +/*! + @property position @brief 开启 camera 时的采集摄像头位置,默认为 AVCaptureDevicePositionBack @since v1.0.0 */ @property (assign, nonatomic) AVCaptureDevicePosition position; -/** +/*! + @property videoOrientation @brief 开启 camera 时的采集摄像头的旋转方向,默认为 AVCaptureVideoOrientationPortrait @since v1.0.0 */ @property (assign, nonatomic) AVCaptureVideoOrientation videoOrientation; -/** +/*! @property videoSize @abstract 编码时的视频分辨率,默认 (480, 854) @@ -79,7 +93,7 @@ */ @property (assign, nonatomic) CGSize videoSize; -/** +/*! @property averageVideoBitRate @abstract 平均视频编码码率。默认为 1024*1000 @@ -111,7 +125,8 @@ */ @property (nonatomic, copy) NSString *videoProfileLevel; -/** +/*! + @method defaultConfiguration @brief 创建一个默认配置的 PLSVideoConfiguration 实例. @return 创建的默认 PLSVideoConfiguration 对象 diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h new file mode 100644 index 00000000..fb75125a --- /dev/null +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h @@ -0,0 +1,93 @@ +// +// PLShortVideoAsset.h +// PLShortVideoKit +// +// Created by 冯文秀 on 2017/9/26. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLShortVideoAsset + @brief PLShortVideoAsset 是一个处理 AVAsset 倍速播放的类 + + @since v1.6.0 + */ +@interface PLShortVideoAsset : NSObject + +/*! + @method initWithURL: + @brief 实例初始化方法 + + @param url 视频存放地址 + + @return PLShortVideoAsset 实例 + @since v1.6.0 + */ +- (instancetype _Nullable )initWithURL:(NSURL *_Nullable)url; + +/*! + @method initWithAsset: + @brief 实例初始化方法 + + @param asset 视频的 AVAsset 实例 + + @return PLShortVideoAsset 实例 + @since v1.6.0 + */ +- (instancetype _Nullable )initWithAsset:(AVAsset *_Nullable)asset; + +/*! + @method scaleTimeRange:toRateType: + @brief 返回倍速处理后的视频 + + @param timeRange 倍速处理时间段 + @param rateType 倍速处理的类型 + + @return 倍速处理后的 AVAsset 实例 + @since v1.8.0 + */ +- (AVAsset *_Nonnull)scaleTimeRange:(CMTimeRange)timeRange toRateType:(PLSVideoRecoderRateType)rateType; + +/*! + @method scaleAsset:timeRange:rateType: + @brief 返回倍速处理后的视频 + + @param sourceAsset 需要倍速处理的视频,为 nil 时,默认使用 PLShortVideoAsset 初始化传入的视频数据 + @param timeRange 倍速处理时间段 + @param rateType 倍速处理的类型 + + @return 倍速处理后的 AVAsset 实例 + @since v1.6.0 + */ +- (AVAsset *_Nonnull)scaleAsset:(AVAsset *_Nullable)sourceAsset timeRange:(CMTimeRange)timeRange rateType:(PLSVideoRecoderRateType)rateType __deprecated_msg("Method deprecated in v1.8.0. Use `scaleTimeRange: toRateType:`"); + +/*! + @method scaleTimeRanges:toRateTypes: + @brief 返回倍速处理后的视频. + + @discussion 将 timeRangeArray 第 n 个元素的 timeRange 按照 rateTypeArray 第 n 个元素的 rateType 进行变速, timeRangeArray 没有包含到的时间段按照原速处理, 两个数组的元素必须相等并且数组不能为空数组 + + @param timeRangeArray 倍速处理时间段数组,包含 NSValue(CMTimeRange) 元素的数组,时间段不能重复且单调递增 + @param rateTypeArray 倍速处理的类型数组,包含 NSNumber(PLSVideoRecoderRateType) 元素的数组 + + @return 倍速处理后的 AVAsset 实例 + @since v1.15.0 + */ +- (AVAsset *_Nonnull)scaleTimeRanges:(NSArray *)timeRangeArray toRateTypes:(NSArray *)rateTypeArray; + +/*! + @method appendAssetArray: + @brief 返回拼接好的视频 + + @param assetArray AVAsset 数组 + + @return 拼接之后的 AVAsset 实例 + @since v1.6.0 + */ +- (AVAsset *_Nonnull)appendAssetArray:(NSArray *_Nonnull)assetArray; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h similarity index 54% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h index 6b0a09b4..b0b1083e 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h @@ -12,22 +12,30 @@ #import "PLSEditPlayer.h" @class PLShortVideoEditor; - +/*! + @protocol PLShortVideoEditorDelegate + @brief 视频编辑协议 + */ @protocol PLShortVideoEditorDelegate @optional -/** +/*! + @method shortVideoEditor:didGetOriginPixelBuffer: @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + @param editor PLShortVideoEditor 实例 @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef @since v1.5.0 */ - (CVPixelBufferRef)shortVideoEditor:(PLShortVideoEditor *)editor didGetOriginPixelBuffer:(CVPixelBufferRef)pixelBuffer __deprecated_msg("Method deprecated in v1.9.0. Use `shortVideoEditor: didGetOriginPixelBuffer: timestamp:`"); -/** +/*! + @method shortVideoEditor:didGetOriginPixelBuffer:timestamp @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param editor PLShortVideoEditor 实例 @param timestamp 视频帧的时间戳 @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef @@ -36,8 +44,11 @@ */ - (CVPixelBufferRef)shortVideoEditor:(PLShortVideoEditor *)editor didGetOriginPixelBuffer:(CVPixelBufferRef)pixelBuffer timestamp:(CMTime)timestamp; -/** +/*! + @method shortVideoEditor:didReadyToPlayForAsset:timeRange @brief 当前视频的播放时刻达到了视频开头 + + @param editor PLShortVideoEditor 实例 @param asset 当前视频 @param timeRange 当前视频的有效视频区域,对应 PLShortVideoEditor 的属性 @property (assign, nonatomic) CMTimeRange timeRange @@ -45,8 +56,11 @@ */ - (void)shortVideoEditor:(PLShortVideoEditor *)editor didReadyToPlayForAsset:(AVAsset *)asset timeRange:(CMTimeRange)timeRange; -/** +/*! + @method shortVideoEditor:didReachEndForAsset:timeRange @brief 当前视频的播放时刻达到了视频结尾 + + @param editor PLShortVideoEditor 实例 @param asset 当前视频 @param timeRange 当前视频的有效视频区域,对应 PLShortVideoEditor 的属性 @property (assign, nonatomic) CMTimeRange timeRange @@ -56,80 +70,96 @@ @end - +/*! + @class PLShortVideoEditor + @brief 视频编辑类 + + @since v1.1.0 + */ @interface PLShortVideoEditor : NSObject -/** +/*! + @property completionBlock @brief 编辑完成时的 block 回调 @since v1.1.0 */ @property (copy, nonatomic) void(^completionBlock)(NSURL *url); -/** - @brief delegate +/*! + @property delegate + @brief 类型的代理 @since v1.5.0 */ @property (weak, nonatomic) id delegate; -/** +/*! + @property previewView @brief 编辑时的预览视图 @since v1.5.0 */ @property (strong, nonatomic, readonly) UIView *previewView; -/** +/*! + @property fillMode @brief 预览视图的填充方式 @since v1.1.0 */ @property (assign, nonatomic) PLSVideoFillModeType fillMode; -/** - @brief 循环播放。设置为 YE,表示单曲循环。默认为 NO +/*! + @property loopEnabled + @brief 循环播放。设置为 YES,表示单曲循环。默认为 NO @since v1.5.0 */ @property (assign, nonatomic) BOOL loopEnabled; -/** +/*! + @property isEditing @brief 处于编辑状态时为 YES @since v1.9.0 */ @property (assign, nonatomic, readonly) BOOL isEditing; -/** +/*! + @property timeRange @brief 播放文件的 timeRange 范围内 [start, duration] 片段 @since v1.5.0 */ @property (assign, nonatomic) CMTimeRange timeRange; -/** +/*! + @property videoSize @brief 通过该参数可以设置视频的预览分辨率 @since v1.5.0 */ @property (assign, nonatomic) CGSize videoSize; -/** +/*! + @property volume @brief 原视频的音量 @since v1.5.0 */ @property (assign, nonatomic, readwrite) CGFloat volume; -/** +/*! + @property musicVolume @brief 背景音乐的音量 @since v1.5.0 */ @property (nonatomic, readonly) CGFloat musicVolume; -/** +/*! + @property delayTimeForMusicToPlay @brief 延迟背景音乐的播放,单位为毫秒,默认值为 0 建议使用 视频帧间隔*(视频帧率/2) * 1000 毫秒 比如:视频帧率为30帧/秒,延迟时间为 (1.0/30)*(30/2)*1000 = 500毫秒, @@ -139,230 +169,218 @@ */ @property (assign, nonatomic) CGFloat delayTimeForMusicToPlay; -/** +/*! + @method initWithURL: @brief 使用 NSURL 初始化编辑实例 + @return PLShortVideoEditor 实例 @since v1.1.0 */ - (instancetype)initWithURL:(NSURL *)url; -/** +/*! + @method initWithAsset: @brief 使用 AVAsset 初始化编辑实例 + @return PLShortVideoEditor 实例 @since v1.1.0 */ - (instancetype)initWithAsset:(AVAsset *)asset; -/** +/*! + @method initWithAsset:videoSize @brief 使用 AVAsset 初始化编辑实例 - * - * @param asset 原视频,即被编辑的视频素材 - * @param videoSize 编辑时的预览分辨率,当取值为 CGSizeZero 时,预览分辨率为原视频的分辨率,当取值为(width, height)时,预览分辨率为(width, height) + + @param asset 原视频,即被编辑的视频素材 + @param videoSize 编辑时的预览分辨率,当取值为 CGSizeZero 时,预览分辨率为原视频的分辨率,当取值为(width, height)时,预览分辨率为(width, height) + @return PLShortVideoEditor 实例 @since v1.5.0 */ - (instancetype)initWithAsset:(AVAsset *)asset videoSize:(CGSize)videoSize; -/** +/*! + @method initWithPlayerItem:videoSize @brief 使用 AVPlayerItem 初始化编辑实例 - * - * @param playerItem 原视频,即被编辑的视频素材 - * @param videoSize 编辑时的预览分辨率,当取值为 CGSizeZero 时,预览分辨率为原视频的分辨率,当取值为(width, height)时,预览分辨率为(width, height) + @param playerItem 原视频,即被编辑的视频素材 + @param videoSize 编辑时的预览分辨率,当取值为 CGSizeZero 时,预览分辨率为原视频的分辨率,当取值为(width, height)时,预览分辨率为(width, height) + + @return PLShortVideoEditor 实例 @since v1.11.0 */ - (instancetype)initWithPlayerItem:(AVPlayerItem *)playerItem videoSize:(CGSize)videoSize; -/** +/*! + @method startEditing @brief 加载编辑信息,实时预览编辑效果 @since v1.1.0 */ - (void)startEditing; -/** +/*! + @method stopEditing @brief 停止实时预览编辑效果 @since v1.1.0 */ - (void)stopEditing; -/** +/*! + @method replaceCurrentAssetWithAsset: @brief 替换当前的 AVAsset 对象 + @param asset 原视频,即被编辑的视频素材 + @since v1.5.0 */ - (void)replaceCurrentAssetWithAsset:(AVAsset *)asset; -/** - @brief 当前播放时刻 +/*! + @method currentTime + @brief 获取当前播放时刻 + @return 当前播放的时刻 @since v1.9.0 */ - (CMTime)currentTime; -/** +/*! + @method seekToTime:completionHandler @brief seek 到视频的 time 时刻 + @param time seek 的时间点 + @param completionHandler seek 操作完成的回调 + @since v1.9.0 */ - (void)seekToTime:(CMTime)time completionHandler:(void (^)(BOOL finished))completionHandler; -/** - * 添加滤镜效果 - * - * @param colorImagePath 当前使用的滤镜的颜色表图的路径 - * 当 colorImagePath 为 nil 时,表示移除滤镜。 +/*! + @method addFilter: + @brief 添加滤镜效果 + + @param colorImagePath 当前使用的滤镜的颜色表图的路径,当 colorImagePath 为 nil 时,表示移除滤镜。 @since v1.5.0 */ - (void)addFilter:(NSString *)colorImagePath; -/** - * 添加 MV 图层方法 1, 相当于 addMVLayerWithColor:colorURL alpha:alphaURL timeRange:kCMTimeRangeZero loopEnable:NO - * - * @param colorURL 彩色层视频的地址 - * @param alphaURL 被彩色层当作透明层的视频的地址 - * 目前支持添加一层 MV 图层。当 colorURL = nil 和 alphaURL = nil 时,表示移除 MV 图层。 +/*! + @method addMusic:timeRange:volume + @brief 添加背景音乐 1 - @since v1.5.0 - */ -- (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL; - -/** - * 添加 MV 图层方法 2 - * - * @param colorURL 彩色层视频的地址 - * @param alphaURL 被彩色层当作透明层的视频的地址 - * @param timeRange 选取 MV 文件的时间段, 如果选取整个 MV,直接传入 kCMTimeRangeZero 即可 - * @param loopEnable 当 MV 时长(timeRange.duration)小于视频时长时,是否循环播放 MV + @param musicURL 当前使用的背景音乐的地址 + @param timeRange 当前使用的背景音乐的有效时间区域(start, duration),如果想使用整段音乐,可以将其设置为 kCMTimeRangeZero 或者 (kCMTimeZero, duration) + @param volume 当前使用的背景音乐的音量 - @since v1.14.0 - */ -- (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL timeRange:(CMTimeRange)timeRange loopEnable:(BOOL)loopEnable; - -/** - * 添加背景音乐 - * - * @param musicURL 当前使用的背景音乐的地址 - * @param timeRange 当前使用的背景音乐的有效时间区域(start, duration),如果想使用整段音乐,可以将其设置为 kCMTimeRangeZero 或者 (kCMTimeZero, duration) - * @param volume 当前使用的背景音乐的音量 - * warning: 默认循环播放当前背景音乐 + @warning 默认循环播放当前背景音乐 @since v1.5.0 */ - (void)addMusic:(NSURL *)musicURL timeRange:(CMTimeRange)timeRange volume:(NSNumber *)volume; -/** - * 添加背景音乐 - * - * @param musicURL 当前使用的背景音乐的地址 - * @param timeRange 当前使用的背景音乐的有效时间区域(start, duration),如果想使用整段音乐,可以将其设置为 kCMTimeRangeZero 或者 (kCMTimeZero, duration) - * @param volume 当前使用的背景音乐的音量 - * @param loopEnable 当前使用的背景音乐是否循环播放 +/*! + @method addMusic:timeRange:volume:loopEnable + @brief 添加背景音乐 2 + + @param musicURL 当前使用的背景音乐的地址 + @param timeRange 当前使用的背景音乐的有效时间区域(start, duration),如果想使用整段音乐,可以将其设置为 kCMTimeRangeZero 或者 (kCMTimeZero, duration) + @param volume 当前使用的背景音乐的音量 + @param loopEnable 当前使用的背景音乐是否循环播放 @since v1.11.0 */ - (void)addMusic:(NSURL *)musicURL timeRange:(CMTimeRange)timeRange volume:(NSNumber *)volume loopEnable:(BOOL)loopEnable; -/** - * 更新背景音乐 - * - * @param timeRange 使用 kCMTimeRangeZero 时,表示不更新背景音乐的播放时间区域 - * @param volume 使用 nil 时,表示不更新背景音乐的音量 - * 只更新 timeRange 时,[xxxObj updateMusic:timeRange volume:nil] - * 只更新 volume 时,[xxxObj updateMusic:kCMTimeRangeZero volume:volume] +/*! + @method updateMusic:volume + @brief 更新背景音乐 + + @param timeRange 使用 kCMTimeRangeZero 时,表示不更新背景音乐的播放时间区域 + @param volume 使用 nil 时,表示不更新背景音乐的音量 + + @discussion + 1. 只更新 timeRange 时,[xxxObj updateMusic:timeRange volume:nil] + 2. 只更新 volume 时,[xxxObj updateMusic:kCMTimeRangeZero volume:volume] @since v1.5.0 */ - (void)updateMusic:(CMTimeRange)timeRange volume:(NSNumber *)volume; -/** - * 更新多个背景音效,相当于 updateMultiMusics:multiMusicsSettings keepMoviePlayerStatus:NO - * - * @param multiMusicsSettings 多个背景音效的设置信息。每个元素都为字典,信息由 PLSAudioSettingsKey 配置 - - @since v1.11.0 - */ -- (void)updateMultiMusics:(NSArray *)multiMusicsSettings; - -/** - * 更新多个背景音效 2 - * - * @param multiMusicsSettings 多个背景音效的设置信息。每个元素都为字典,信息由 PLSAudioSettingsKey 配置 - * - * @param keepStatus 添加多个背景音乐之后视频播放器是否保持当前状态,如果传 YES,视频播放器将不做任何处理。如果传入 NO, - 视频播放器将重新开始播放 +/*! + @method setWaterMarkWithImage:position + @brief 开启水印 - @since v1.16.0 - */ -- (void)updateMultiMusics:(NSArray *)multiMusicsSettings keepMoviePlayerStatus:(BOOL)keepStatus; - -/** - * 开启水印 - * - * @param waterMarkImage 水印的图片 - * @param position 水印的位置 + @param waterMarkImage 水印的图片 + @param position 水印的位置 @since v1.5.0 */ - (void)setWaterMarkWithImage:(UIImage *)waterMarkImage position:(CGPoint)position; -/** - * 开启水印 - * - * @param waterMarkImage 水印的图片 - * @param position 水印的位置 - * @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 +/*! + @method setWaterMarkWithImage:position:size + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 @since v1.14.0 */ - (void)setWaterMarkWithImage:(UIImage *)waterMarkImage position:(CGPoint)position size:(CGSize)size; -/** - * 开启水印 - * - * @param waterMarkImage 水印的图片 - * @param position 水印的位置 - * @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 - * @param type 水印的类型 - * @param alpha 水印的透明度 (0 ~ 1) - * @param degree 水印旋转角度 (单位:度) +/*! + @method setWaterMarkWithImage:position:size:waterMarkType:alpha:rotateDegree + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + @param type 水印的类型 + @param alpha 水印的透明度 (0 ~ 1) + @param degree 水印旋转角度 (单位:度) @since v1.15.0 */ - (void)setWaterMarkWithImage:(UIImage *)waterMarkImage position:(CGPoint)position size:(CGSize)size waterMarkType:(PLSWaterMarkType)type alpha:(CGFloat)alpha rotateDegree:(CGFloat)degree; -/** - * 开启水印,此方法只能设置 gif 水印 - * - * @param gifData gif 图片数据 - * @param position 水印的位置 - * @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 - * @param alpha 水印的透明度 (0 ~ 1) - * @param degree 水印旋转角度 (单位:度) +/*! + @method setGifWaterMarkWithData:position:size:alpha:rotateDegree + @brief 开启水印,此方法只能设置 gif 水印 + + @param gifData gif 图片数据 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + @param alpha 水印的透明度 (0 ~ 1) + @param degree 水印旋转角度 (单位:度) @since v1.15.0 */ - (void)setGifWaterMarkWithData:(NSData *)gifData position:(CGPoint)position size:(CGSize)size alpha:(CGFloat)alpha rotateDegree:(CGFloat)degree; -/** - * 移除水印 +/*! + @method clearWaterMark + @brief 移除水印 @since v1.5.0 */ - (void)clearWaterMark; -/** +/*! + @method rotateVideoLayer @brief 旋转视频的方向,能将竖屏视频旋转为横屏视频,横屏视频旋转为竖屏视频 - * - * return PLSPreviewOrientation 当前视频的方向 + + @return PLSPreviewOrientation 当前视频的方向 @since v1.7.0 */ - (PLSPreviewOrientation)rotateVideoLayer; -/** +/*! + @method resetVideoLayerOrientation @brief 重置视频的旋转方向,视频的方向被置为视频的原始方向 @since v1.7.0 diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoKit.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoKit.h new file mode 100644 index 00000000..266c2948 --- /dev/null +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoKit.h @@ -0,0 +1,54 @@ +// +// PLShortVideoKit.h +// PLShortVideoKit +// +// Created by hxiongan on 2019/3/15. +// Copyright © 2019年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import + +//! Project version number for PLShortVideoKit. +FOUNDATION_EXPORT double PLShortVideoKitVersionNumber; + +//! Project version string for PLShortVideoKit. +FOUNDATION_EXPORT const unsigned char PLShortVideoKitVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + +#import + +#import +#import +#import + +#import +#import +#import +#import +#import +#import +#import + +#import +#import +#import + +#import +#import +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import + +#import + +#import diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h similarity index 67% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h index 4dbbe519..8b734ecf 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h @@ -10,16 +10,22 @@ #import #import "PLSTypeDefines.h" +/*! + @class PLShortVideoKitEnv + @brief 初始化 ShortVideoKit 运行环境 + */ @interface PLShortVideoKitEnv : NSObject -/** - @brief 初始化 StreamingSession 的运行环境,需要在 -application:didFinishLaunchingWithOptions: 方法下调用该方法, +/*! + @method initEnv + @brief 初始化 ShortVideoKit 的运行环境,需要在 -application:didFinishLaunchingWithOptions: 方法下调用该方法, @warning 不调用该方法将导致 PLShortVideoKitEnv 对象无法初始化 */ +(void)initEnv; -/** +/*! + @method isInited @brief 判断当前环境是否已经初始化 @return 已初始化返回 YES,否则为 NO @@ -36,15 +42,27 @@ /*! @method setLogLevel: - @abstract 设置SDK内部输出日志的级别,默认为 PLShortVideoLogLevelWarning 级别。 - 该方法设置的输出级别会分别同步到控制台与文件日志中。 + @abstract 设置SDK内部输出日志的级别,默认为 PLShortVideoLogLevelWarning 级别。该方法设置的输出级别会分别同步到控制台与文件日志中。 @warning 请确保不要在线上产品开启 PLShortVideoLogLevelVerbose 级别输出,这将影响产品性能。 */ + (void)setLogLevel:(PLShortVideoLogLevel)logLevel; +/*! + @method deviceID + @brief 获取设备 ID. 默认为 UUID + + @return 返回当前设备 ID + */ + (NSString *)deviceID; +/*! + @method setDeviceID: + @brief 设置设备 ID + + @param deviceID 设备 ID + + */ + (void)setDeviceID:(NSString *)deviceID; @end diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h new file mode 100644 index 00000000..9726dbca --- /dev/null +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h @@ -0,0 +1,855 @@ +// +// PLShortVideoRecorder.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/1. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import "PLSVideoConfiguration.h" +#import "PLSAudioConfiguration.h" +#import "PLSTypeDefines.h" + +@class PLShortVideoRecorder; + +/*! + @protocol PLShortVideoRecorderDelegate + @brief 短视频录制协议 + + @since v1.0.0 + */ +@protocol PLShortVideoRecorderDelegate + +@optional +#pragma mark -- 摄像头/麦克风权限变化的回调 +/*! + @method shortVideoRecorder:didGetCameraAuthorizationStatus: + @abstract 摄像头授权状态发生变化的回调 + + @param recorder PLShortVideoRecorder 实例 + @param status 相机授权状态 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didGetCameraAuthorizationStatus:(PLSAuthorizationStatus)status; + +/*! + @method shortVideoRecorder:didGetMicrophoneAuthorizationStatus: + @abstract 麦克风授权状态发生变化的回调 + + @param recorder PLShortVideoRecorder 实例 + @param status 麦克风授权状态 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didGetMicrophoneAuthorizationStatus:(PLSAuthorizationStatus)status; + +#pragma mark -- 摄像头对焦位置的回调 +/*! + @method shortVideoRecorderDidFocusAtPoint: + @abstract 摄像头对焦位置的回调 + + @param point 相机当前焦点 + + @since v1.6.0 + */ +- (void)shortVideoRecorderDidFocusAtPoint:(CGPoint)point __deprecated_msg("Method deprecated in v1.9.0. Use `shortVideoRecorder: didFocusAtPoint:`");; + +/*! + @method shortVideoRecorder:didFocusAtPoint: + @abstract 摄像头对焦位置的回调 + + @param recorder PLShortVideoRecorder 实例 + @param point 相机当前焦点 + + @since v1.9.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didFocusAtPoint:(CGPoint)point; + +#pragma mark -- 摄像头/麦克风采集数据的回调 +/*! + @method shortVideoRecorder:pixelBuffer: + @abstract 获取到摄像头原数据时的回调, 便于开发者做滤镜等处理,需要注意的是这个回调在 camera 数据的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 + + @param recorder PLShortVideoRecorder 实例 + @param pixelBuffer 视频帧数据 + + @since v1.0.0 + */ +- (CVPixelBufferRef __nonnull)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder cameraSourceDidGetPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer; + +/*! + @method shortVideoRecorder:microphoneSourceDidGetSampleBuffer: + @abstract 获取到麦克风原数据时的回调,需要注意的是这个回调在 microphone 数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题 + + @param recorder PLShortVideoRecorder 实例 + @param sampleBuffer 音频帧数据 + + @since v1.0.1 + */ +- (CMSampleBufferRef __nonnull)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder microphoneSourceDidGetSampleBuffer:(CMSampleBufferRef __nonnull)sampleBuffer; + +#pragma mark -- 视频录制动作的回调 +/*! + @method shortVideoRecorder:didStartRecordingToOutputFileAtURL: + @abstract 开始录制一段视频时 + + @param recorder PLShortVideoRecorder 实例 + @param fileURL 录制文件的存放地址 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didStartRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL; + +/*! + @method shortVideoRecorder:didRecordingToOutputFileAtURL:fileDuration:totalDuration: + @abstract 正在录制的过程中。在完成该段视频录制前会一直回调,可用来更新所有视频段加起来的总时长 totalDuration UI。 + + @param recorder PLShortVideoRecorder 实例 + @param fileURL 当前正在录制的文件存放地址 + @param fileDuration 当前正在录制的文件时长 + @param totalDuration 所有录制文件的总时长 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; + +/*! + @method shortVideoRecorder:didDeleteFileAtURL:fileDuration:totalDuration: + @abstract 删除了某一段视频 + + @param recorder PLShortVideoRecorder 实例 + @param fileURL 当前删除的文件存放地址 + @param fileDuration 当前删除的文件时长 + @param totalDuration 删除当前文件之后剩余录制文件的总时长 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didDeleteFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; + +/*! + @method shortVideoRecorder:didFinishRecordingToOutputFileAtURL:fileDuration:totalDuration: + @abstract 完成一段视频的录制时 + + @param recorder PLShortVideoRecorder 实例 + @param fileURL 当前录制完成的文件存放地址 + @param fileDuration 当前录制完成的文件时长 + @param totalDuration 所有录制文件的总时长 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didFinishRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; + +/*! + @method shortVideoRecorder:didFinishRecordingMaxDuration: + @abstract 在达到指定的视频录制时间 maxDuration 后,如果再调用 [PLShortVideoRecorder startRecording],那么会立即执行该回调。该回调功能是用于页面跳转 + + @param recorder PLShortVideoRecorder 实例 + @param maxDuration 设置的最大录制时长 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didFinishRecordingMaxDuration:(CGFloat)maxDuration; + +@end + +#pragma mark - basic + +/*! + @class PLShortVideoRecorder + @abstract 短视频录制的核心类。 + + @discussion 一个 PLShortVideoRecorder 实例会包含了对视频源、音频源的控制,并且对流的操作及流状态的返回都是通过它来完成的。 + */ +@interface PLShortVideoRecorder : NSObject + +/*! + @method assetRepresentingAllFiles + @brief 获取代表当前会话的所有视频段文件的 asset + + @return 返回代表当前会话的所有视频段文件的 asset + @since v1.0.0 + */ +- (AVAsset *__nonnull)assetRepresentingAllFiles; + +/*! + @property maxDuration + @brief 视频录制的最大时长,单位为秒。默认为10秒 + + @since v1.0.0 + */ +@property (assign, nonatomic) CGFloat maxDuration; + +/*! + @property minDuration + @brief 视频录制的最短时间,单位为秒。默认为2秒 + + @since v1.0.0 + */ +@property (assign, nonatomic) CGFloat minDuration; + +/*! + @property videoConfiguration + @brief 视频配置,只读 + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) PLSVideoConfiguration *__nonnull videoConfiguration; + +/*! + @property audioConfiguration + @brief 音频配置,只读 + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) PLSAudioConfiguration *__nonnull audioConfiguration; + +/*! + @property previewView + @brief 摄像头的预览视图 + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) UIView *__nullable previewView; + +/*! + @property adaptationRecording + @brief 根据设备的方向自动确定竖屏、横屏拍摄。默认为 NO,不启用自动确定 + + @since v1.3.0 + */ +@property (assign, nonatomic) BOOL adaptationRecording; + +/*! + @property deviceOrientation + @brief 获取当前设备的旋转方向 + + @discussion 当 adaptationRecording 为YES时,获取设备方向的回调 deviceOrientationBlock 才有效。 + 拍摄时可根据 deviceOrientation 做 UI 效果来标明当前拍摄的方向是竖屏还是横屏。 + PLSPreviewOrientationPortrait 竖屏拍摄 + PLSPreviewOrientationPortraitUpsideDown 倒立拍摄 + PLSPreviewOrientationLandscapeRight 右横屏拍摄 + PLSPreviewOrientationLandscapeLeft 左横屏拍摄 + + @since v1.3.0 + */ +@property (copy, nonatomic) void(^ _Nullable deviceOrientationBlock)(PLSPreviewOrientation deviceOrientation); + +/*! + @property delegate + @brief 代理对象 + + @since v1.0.0 + */ +@property (weak, nonatomic) id __nullable delegate; + +/*! + @property delegateQueue + @abstract 触发代理对象回调时所在的任务队列。 + + @discussion 默认情况下该值为 nil,此时代理方法都会通过 main queue 异步执行回调。如果你期望可以所有的回调在自己创建或者其他非主线程调用, + 可以设置改 delegateQueue 属性。 + + @see PLShortVideoRecorderDelegate + @see delegate + + @since v1.0.0 + */ +@property (strong, nonatomic) dispatch_queue_t __nullable delegateQueue; + +/*! + @property fillMode + @brief previewView 中视频的填充方式,默认使用 PLVideoFillModePreserveAspectRatioAndFill + + @since v1.0.0 + */ +@property (readwrite, nonatomic) PLSVideoFillModeType fillMode; + +/*! + @property isRecording + @brief PLShortVideoRecorder 处于录制状态时为 true + + @since v1.0.0 + */ +@property (readonly, nonatomic) BOOL isRecording; + +/*! + @property captureEnabled + @brief 是否开启音视频采集 + + @since v1.2.0 + */ +@property (assign, nonatomic, readonly) BOOL captureEnabled; + +/*! + @property recoderRate + @brief 视频拍摄速率值,默认使用 PLSVideoRecoderRateNormal,isRecording 为 YES 时,设置该值无效 + + @since v1.4.0 + */ +@property (readwrite, nonatomic) PLSVideoRecoderRateType recoderRate; + +/*! + @property outputFileType + @brief 视频的文件类型,默认为 PLSFileTypeMPEG4(.mp4) + + @since v1.6.0 + */ +@property (assign, nonatomic) PLSFileType outputFileType; + +/*! + @method initWithVideoConfiguration:audioConfiguration: + @abstract 初始化方法 + + @discussion videoConfiguration 设置为 nil 时,不采集视频。 + audioConfiguration 设置为 nil 时,不采集音频。 + + @param videoConfiguration 视频采集和编码参数 + @param audioConfiguration 音频采集和编码参数 + + @since v1.0.0 + @return 返回 PLShortVideoRecorder 实例 + */ +- (nonnull instancetype)initWithVideoConfiguration:(PLSVideoConfiguration *_Nullable)videoConfiguration audioConfiguration:(PLSAudioConfiguration *_Nullable)audioConfiguration; + +/*! + @method writePixelBuffer:timeStamp + @abstract 写入视频数据,当 captureEnabled 为 NO 时,可通过该接口导入视频数据 + + @param pixelBuffer kCVPixelFormatType_32BGRA 格式的 CVPixelBufferRef + @param timeStamp pixelBuffer 对应的时间戳 + + @warning 目前仅支持 kCVPixelFormatType_32BGRA 格式的 pixelBuffer + + @since v1.2.0 + */ +- (void)writePixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer timeStamp:(CMTime)timeStamp; + +/*! + @method writeSampleBuffer: + @abstract 写入音频数据,当 captureEnabled 为 NO 时,可通过该接口导入音频数据 + + @param sampleBuffer 音频数据帧 + + @since v1.2.0 + */ +- (void)writeSampleBuffer:(CMSampleBufferRef _Nonnull)sampleBuffer; + +/*! + @method insertVideo: + @abstract 插入视频,支持任意位置,通过该接口传入,成为 PLShortVideoRecorder 当前视频数组的下一个视频段 + + @param videoURL 插入的视频存放地址 + + @warning PLShortVideoRecorder 初始化后调用,当视频时长加上视频数组中的所有视频段时长,超过视频设置的最大时长 maxDuration 时,则传值无效 + + @since v1.7.0 + */ +- (void)insertVideo:(NSURL *_Nonnull)videoURL; + +/*! + @method startRecording + @brief 开始录制视频,录制的视频的存放地址由 SDK 内部自动生成 + + @warning 获取所有录制的视频段的地址,可以使用 - (NSArray *__nullable)getAllFilesURL + + @since v1.0.0 + */ +- (void)startRecording; + +/*! + @method startRecording: + @brief 开始录制视频 + + @param fileURL 录制的视频的存放地址,该参数可以在外部设置,录制的视频会保存到该位置 + + @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 + 获取所有录制的视频段的地址,可以使用 - (NSArray *__nullable)getAllFilesURL + + @since v1.8.0 + */ +- (void)startRecording:(NSURL *_Nonnull)fileURL; + +/*! + @method stopRecording + @brief 停止录制视频 + + @since v1.0.0 + */ +- (void)stopRecording; + +/*! + @method cancelRecording + @brief 取消录制会停止视频录制并删除已经录制的视频段文件 + + @since v1.0.0 +*/ +- (void)cancelRecording; + +/*! + @method deleteLastFile + @brief 删除上一个录制的视频段 + + @since v1.0.0 + */ +- (void)deleteLastFile; + +/*! + @method deleteAllFiles + @brief 删除所有录制的视频段 + + @since v1.0.0 + */ +- (void)deleteAllFiles; + +/*! + @method getAllFilesURL + @brief 获取所有录制的视频段的地址 + + @return 返回当前录制完成的所有视频段地址 + @since v1.0.0 + */ +- (NSArray *__nullable)getAllFilesURL; + +/*! + @method getFilesCount + @brief 获取录制的视频段的总数目 + + @return 返回当前录制完成的是视频段总数 + @since v1.0.0 + */ +- (NSInteger)getFilesCount; + +/*! + @method getTotalDuration + @brief 获取所有录制的视频段加起来的总时长 + + @return 返回所有录制的视频段加起来的总时长 + @since v1.0.0 + */ +- (CGFloat)getTotalDuration; + +/*! + @method getScreenShotWithCompletionHandler: + @brief 实时截图, 异步返回截图结果 image. 在 handler 内部调用 self,请使用 __weak typeof(self) weakSelf = self, 避免循环引用, 因为 SDK 内部对 handle 执行了 copy 操作 + + @param handler 截图完成的回调 + + @since v1.9.0 + */ +- (void)getScreenShotWithCompletionHandler:(void(^_Nullable)(UIImage * _Nullable image))handler; + +@end + +#pragma mark - PLShortVideoRecorder (backgroundMonitor) + +/*! + @category PLShortVideoRecorder (backgroundMonitor) + @brief 退后台的操作 + */ +@interface PLShortVideoRecorder (backgroundMonitor) + +/*! + @property backgroundMonitorEnable + @abstract 默认为 YES,即 SDK 内部根据监听到的 Application 前后台状态自动停止和开始录制视频 + + @warning 设置为 YES 时,即 Application 进入后台,若当前为拍摄视频状态,SDK 内部会自动停止视频的录制,恢复到前台,SDK 内部自动启动视频的录制; + 设置为 NO 时,即 Application 进入后台,若当前为拍摄视频状态,SDK 内部会停止视频的录制,恢复到前台,SDK 内部不会自动启动视频的录制。 + 为什么设置为 NO,SDK 内部仍然要在 Application 进入后台时停止视频录制呢?原因是,开发者将该属性设置为 NO 后,可能在应用层忘记处理 + Application 进入后台时要调用 stopRecording 来停止视频的录制,进而出现 crash。所以,不管该属性是 YES 还是 NO,当 Application + 进入后台,SDK 内部都会调用 stopRecording 自动停止视频的录制。 + + @since v1.11.0 + */ +@property (assign, nonatomic) BOOL backgroundMonitorEnable; + +@end + +#pragma mark -- PLShortVideoRecorder (mixAudio) + +/*! + @category PLShortVideoRecorder (mixAudio) + @brief 添加背景音乐操作 + */ +@interface PLShortVideoRecorder (mixAudio) + +/*! + @method mixAudio: + @abstract 设置录制时的背景音乐 + + @param audioURL 音乐文件存放地址 + + @warning PLShortVideoRecorder 初始化后调用,audioURL 为音频 URL + + @since v1.7.0 + */ +- (void)mixAudio:(NSURL *_Nullable)audioURL; + +/*! + @method mixAudio:playEnable: + @abstract 设置录制时的背景音乐 + + @warning PLShortVideoRecorder 初始化后调用,audioURL 为音频 URL + + @param audioURL 音频 URL + @param playEnable 音频添加后是否立即播放 + + @since v1.11.0 + */ +- (void)mixAudio:(NSURL *_Nullable)audioURL playEnable:(BOOL)playEnable; + +/*! + @method mixAudio:startTime:volume:playEnable: + @abstract 设置录制时的背景音乐 + + @warning PLShortVideoRecorder 初始化后调用,audioURL 为音频 URL + + @param audioURL 音频 URL + @param startTime 音频开始播放的位置 + @param volume 音频的音量 + @param playEnable 音频添加后是否立即播放 + + @since v1.11.0 + */ +- (void)mixAudio:(NSURL *_Nullable)audioURL startTime:(NSTimeInterval)startTime volume:(CGFloat)volume playEnable:(BOOL)playEnable; + +/*! + @method mixWithMusicVolume:videoVolume:completionHandler: + @brief 获取添加背景音乐录制完成后的 audioMix + + @warning 设置背景音乐后有效 + + @param musicVolume 背景音乐音量,范围 0 ~ 1 + @param videoVolume 原视频音量,范围 0 ~ 1 + @param completionHandler 获取 composition 及 audioMix + + @since v1.7.0 + */ +- (void)mixWithMusicVolume:(float)musicVolume videoVolume:(float)videoVolume completionHandler:(void (^_Nonnull)(AVMutableComposition * _Nullable composition, AVAudioMix * _Nullable audioMix, NSError * _Nullable error))completionHandler; +@end + +#pragma mark - Category (Info) + +/*! + @category PLShortVideoRecorder (Info) + @abstract SDK 信息相关 + + @since v1.0.0 + */ +@interface PLShortVideoRecorder (Info) + +/*! + @method versionInfo + @abstract PLShortVideoRecorder 的 SDK 版本。 + + @return 返回 SDK 版本信息 + @since v1.0.0 + */ ++ (NSString *__nonnull)versionInfo; + +/*! + @method checkAuthentication: + @abstract SDK 授权状态查询 + + @param resultBlock 授权状态查询完成之后的回调 + + @since v1.16.1 + */ ++ (void)checkAuthentication:(void(^ __nonnull)(PLSAuthenticationResult result))resultBlock;; + +@end + +#pragma mark - Category (Dubber) + +/*! + @category PLShortVideoRecorder (Dubber) + @abstract 视频配音 + + @since v1.6.0 + */ +@interface PLShortVideoRecorder (Dubber) + +/*! + @method mixAsset:timeRange: + @brief 纯音频录制时,将录制的纯音频 AVAsset *audio = [self.recorder assetRepresentingAllFiles] 与 asset 混合。 + + @param asset AVAsset 对象文件 + @param timeRange asset 的截取时间段 + + @since v1.6.0 + */ +- (AVAsset *_Nullable)mixAsset:(AVAsset *_Nullable)asset timeRange:(CMTimeRange)timeRange; + +@end + +#pragma mark - Category (CameraSource) + +/*! + @category PLShortVideoRecorder(CameraSource) + @discussion 与摄像头相关的接口 + + @since v1.0.0 + */ +@interface PLShortVideoRecorder (CameraSource) + +/*! + @property captureSession + @brief 只读变量,给有特殊需求的开发者使用 + + @since v1.15.0 + */ +@property (readonly, nonatomic) AVCaptureSession *_Nullable captureSession; + +/*! + @property captureDeviceInput + @brief 视频采集输入源,只读变量,给有特殊需求的开发者使用 + + @since v1.11.1 + */ +@property (readonly, nonatomic) AVCaptureDeviceInput *_Nullable captureDeviceInput; + +/*! + @property captureDevicePosition + @brief default as AVCaptureDevicePositionBack + + @since v1.0.0 + */ +@property (assign, nonatomic) AVCaptureDevicePosition captureDevicePosition; + +/*! + @property videoOrientation + @brief 开启 camera 时的采集摄像头的旋转方向,默认为 AVCaptureVideoOrientationPortrait + + @since v1.0.0 + */ +@property (assign, nonatomic) AVCaptureVideoOrientation videoOrientation; + +/*! + @property torchOn + @abstract default as NO. + + @since v1.0.0 +*/ +@property (assign, nonatomic, getter=isTorchOn) BOOL torchOn; + +/*! + @property continuousAutofocusEnable + @abstract 手动对焦的视图动画。该属性默认开启。 + + @since v1.6.0 + */ +@property (assign, nonatomic) BOOL innerFocusViewShowEnable; + +/*! + @property continuousAutofocusEnable + @abstract 连续自动对焦。该属性默认开启。 + + @since v1.0.0 + */ +@property (assign, nonatomic, getter=isContinuousAutofocusEnable) BOOL continuousAutofocusEnable; + +/*! + @property touchToFocusEnable + @abstract 手动点击屏幕进行对焦。该属性默认开启。 + + @since v1.0.0 + */ +@property (assign, nonatomic, getter=isTouchToFocusEnable) BOOL touchToFocusEnable; + +/*! + @property smoothAutoFocusEnabled + @abstract 该属性适用于视频拍摄过程中用来减缓因自动对焦产生的镜头伸缩,使画面不因快速的对焦而产生抖动感。该属性默认开启。 + */ +@property (assign, nonatomic, getter=isSmoothAutoFocusEnabled) BOOL smoothAutoFocusEnabled; + +/*! + @property focusPointOfInterest + @abstract default as (0.5, 0.5), (0,0) is top-left, (1,1) is bottom-right. + + @since v1.0.0 + */ +@property (assign, nonatomic) CGPoint focusPointOfInterest; + +/*! + @property videoZoomFactor + @abstract 默认为 1.0,设置的数值需要小于等于 videoActiveForat.videoMaxZoomFactor,如果大于会设置失败 + + @since v1.0.0 + */ +@property (assign, nonatomic) CGFloat videoZoomFactor; + +/*! + @property videoFormats + @brief videoFormats + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) NSArray *__nonnull videoFormats; + +/*! + @property videoActiveFormat + @brief videoActiveFormat + + @since v1.0.0 + */ +@property (strong, nonatomic) AVCaptureDeviceFormat *__nonnull videoActiveFormat; + +/*! + @property sessionPreset + @brief 采集的视频的 sessionPreset,默认为 AVCaptureSessionPreset1280x720 + + @since v1.0.0 + */ +@property (strong, nonatomic) NSString *__nonnull sessionPreset; + +/*! + @property videoFrameRate + @brief 采集的视频数据的帧率,默认为 25 + + @since v1.0.0 + */ +@property (assign, nonatomic) NSUInteger videoFrameRate; + +/*! + @property previewMirrorFrontFacing + @brief 前置预览是否开启镜像,默认为 YES + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL previewMirrorFrontFacing; + +/*! + @property previewMirrorRearFacing + @brief 后置预览是否开启镜像,默认为 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL previewMirrorRearFacing; + +/*! + @property streamMirrorFrontFacing + @brief 前置摄像头,编码写入文件时是否开启镜像,默认 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL streamMirrorFrontFacing; + +/*! + @property streamMirrorRearFacing + @brief 后置摄像头,编码写入文件时是否开启镜像,默认 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL streamMirrorRearFacing; + +/*! + @property renderQueue + @brief 预览的渲染队列 + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) dispatch_queue_t __nonnull renderQueue; + +/*! + @property renderContext + @brief 预览的渲染 OpenGL context + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) EAGLContext *__nonnull renderContext; + +/*! + @method toggleCamera + @brief 切换前置/后置摄像头 + */ +- (void)toggleCamera; + +/*! + @method startCaptureSession + @brief 开启音视频采集 + + @since v1.0.0 + */ +- (void)startCaptureSession; + +/*! + @method stopCaptureSession + @brief 停止音视频采集 + + @since v1.0.0 + */ +- (void)stopCaptureSession; + +/*! + @method setBeautifyModeOn: + @brief 是否开启美颜 + + @param beautifyModeOn 美颜开关 + + @since v1.0.0 + */ +-(void)setBeautifyModeOn:(BOOL)beautifyModeOn; + +/*! + @method setBeautify: + @brief 设置对应 Beauty 的程度参数. + + @param beautify 范围从 0 ~ 1,0 为不美颜 + + @since v1.0.0 + */ +-(void)setBeautify:(CGFloat)beautify; + +/*! + @method setWhiten: + @brief 设置美白程度(注意:如果美颜不开启,设置美白程度参数无效) + + @param whiten 范围是从 0 ~ 1,0 为不美白 + + @since v1.0.0 + */ +-(void)setWhiten:(CGFloat)whiten; + +/*! + @method setRedden: + @brief 设置红润的程度参数.(注意:如果美颜不开启,设置美白程度参数无效) + + @param redden 范围是从 0 ~ 1,0 为不红润 + + @since v1.0.0 + */ + +-(void)setRedden:(CGFloat)redden; + +/*! + @method setWaterMarkWithImage:position: + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + + @since v1.0.0 + */ +-(void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position; + +/*! + @method clearWaterMark + @brief 移除水印 + + @since v1.0.0 + */ +-(void)clearWaterMark; + +/*! + @method reloadvideoConfiguration: + @brief 重新配置视频的参数 + + @since v1.0.0 + */ +- (void)reloadvideoConfiguration:(PLSVideoConfiguration *__nonnull)videoConfiguration; + +@end + diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h new file mode 100644 index 00000000..2526fe2b --- /dev/null +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h @@ -0,0 +1,197 @@ +// +// PLShortVideoTranscoder.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/6/21. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLShortVideoTranscoder + @abstract 视频转码 + + @discussion 对视频进行转码处理 + */ +@interface PLShortVideoTranscoder : NSObject + +/*! + @property isExportMovieToPhotosAlbum + @brief 将视频导出到相册,默认为 NO + + @since v1.4.0 + */ +@property (assign, nonatomic) BOOL isExportMovieToPhotosAlbum; + +/*! + @property outputURL + @abstract 视频转码后的地址 + + @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 + + @since v1.0.5 + */ +@property (strong, nonatomic) NSURL *outputURL; + +/*! + @property outputFileType + @abstract 视频转码后的格式,默认为 PLSFileTypeMPEG4(.mp4) + + @since v1.0.5 + */ +@property (assign, nonatomic) PLSFileType outputFileType; + +/*! + @property outputFilePreset + @abstract 转码后视频的质量,默认为 PLSFilePresetHighestQuality + + @since v1.0.5 + */ +@property (assign, nonatomic) PLSFilePreset outputFilePreset; + +/*! + @property bitrate + @abstract 转码后视频的码率,默认为 6000 * 1000 bps,对应 PLSFilePresetHighestQuality + + @warning 只设置 outputFilePreset,不设置 bitrate,内部 bitrate 默认值如下: + PLSFilePresetLowQuality, 默认对应 700 * 1000 bps + PLSFilePresetMediumQuality, 默认对应 3000 * 1000 bps + PLSFilePresetHighestQuality, 默认对应 6000 * 1000 bps + PLSFilePreset640x480, 默认对应 2000 * 1000 bps + PLSFilePreset960x540, 默认对应 3000 * 1000 bps + PLSFilePreset1280x720, 默认对应 4000 * 1000 bps + PLSFilePreset1920x1080, 默认对应 6000 * 1000 bps + 如果 bitrate 的值大于原始视频的视频码率,则重置 bitrate 的值为原始视频的视频码率。 + + @since v1.11.0 + */ +@property (assign, nonatomic) float bitrate; + +/*! + @property progress + @abstract 转码的进度 + + @since v1.0.5 + */ +@property (assign, nonatomic, readonly) float progress; + +/*! + @property timeRange + @abstract 设置需要转码的视频时间段,默认为视频的总时长 + + @since v1.0.5 + */ +@property (assign, nonatomic) CMTimeRange timeRange; + +/*! + @property isAdjustVideoOrientation + @abstract 调整视频方向,默认为 NO。设置为 YES,可调整视频方向,生成的视频不需要通过视频角度信息和分辨率来获取实际分辨率。 + 比如 iPhone 相机拍摄的视频 (1920x1080, 90度, 纵向),播放器播放预览分辨率为 1080x1920。 + + @since v1.1.1 + */ +@property (assign, nonatomic) BOOL isAdjustVideoOrientation; + +/*! + @property rotateOrientation + @abstract 视频旋转方向,默认为 PLSPreviewOrientationPortrait。 + PLSPreviewOrientationPortrait = 0, 正立 0度 + PLSPreviewOrientationPortraitUpsideDown = 1, 180度 + PLSPreviewOrientationLandscapeRight = 2, 270度 + PLSPreviewOrientationLandscapeLeft = 3, 90度 + + @since v1.8.0 + */ +@property (assign, nonatomic) PLSPreviewOrientation rotateOrientation; + +/*! + @property videoFrameRate + @abstract 导出视频的帧率,默认 0,有效范围 [0 ~ 原视频帧率],当为 0 的时候,导出视频帧率等于原视频帧率, + 当设置的帧率大于原视频帧率时,会被自动调整为原视频帧率 + + @since v1.13.0 + */ +@property (assign, nonatomic) float videoFrameRate; + +/*! + @property completionBlock + @abstract 视频转码完成的 block + + @since v1.0.5 + */ +@property (copy, nonatomic) void(^completionBlock)(NSURL *url); + +/*! + @property failureBlock + @abstract 视频转码失败的 block + + @since v1.0.5 + */ +@property (copy, nonatomic) void(^failureBlock)(NSError* error); + +/*! + @property processingBlock + @abstract 视频转码进度的 block,可在该 block 中刷新转码进度条 UI + + @since v1.0.5 + */ +@property (copy, nonatomic) void(^processingBlock)(float progress); + +/*! + @method initWithAsset: + @brief 使用 AVAsset 初始化转码对象 + + @param asset 送去转码的视频 + + @return PLShortVideoTranscoder 实例 + @since v1.0.5 + */ +- (id)initWithAsset:(AVAsset *)asset; + +/*! + @method initWithURL: + @brief 使用 NSURL 初始化转码对象 + + @param url 送去转码的视频 + + @return PLShortVideoTranscoder 实例 + @since v1.0.5 + */ +- (id)initWithURL:(NSURL *)url; + +/*! + @method startTranscoding + @brief 在初始化转码对象 PLShortVideoTranscoder 并设置好转码参数后,执行该方法启动转码流程 + + @since v1.0.5 + */ +- (void)startTranscoding; + +/*! + @method cancelTranscoding + @brief 取消转码流程 + + @since v1.0.5 + */ +- (void)cancelTranscoding; + +/*! + @method videoDisplay:bounds:rotate: + @brief 返回 AVAsset 在 bounds 大小的 view 中播放,有视频部分的 frame + + @param asset AVAsset 实例 + @param bounds 预览 view 的大小 + @param previewOrientation 预览的方法 + + @since v1.13.0 + */ ++ (CGRect)videoDisplay:(AVAsset *)asset bounds:(CGRect)bounds rotate:(PLSPreviewOrientation)previewOrientation; + +@end + + diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h similarity index 64% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h rename to Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h index 40ed0d2b..60b02214 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h @@ -15,49 +15,70 @@ @class ALAsset; @class PHAsset; +/*! + @protocol PLShortVideoUploaderDelegate + @brief 文件上传协议 + + @since v1.0.4 + */ @protocol PLShortVideoUploaderDelegate @optional -/** +/*! + @method shortVideoUploader:uploadKeyuploadPercent: @abstract 上传进度回调 - @discussion 一个 PLShortVideoUploader 实例实现段视频上传功能。 + @discussion 一个 PLShortVideoUploader 实例实现视频上传功能。 + + @param uploader PLShortVideoUploader 实例 + @param uploadKey 上传的 key 值 + @param uploadPercent 上传进度 @since v1.0.4 */ - (void)shortVideoUploader:(PLShortVideoUploader * _Nonnull)uploader uploadKey:(NSString * _Nullable)uploadKey uploadPercent:(float)uploadPercent; -/** +/*! + @method shortVideoUploader:completeInfo:uploadKey:resp: @abstract 上传结果回调 + @param uploader PLShortVideoUploader 实例 + @param info 上传完成信息 + @param uploadKey 上传的 key 值 + @param resp 上传完成的返回信息 + @since v1.0.4 */ - (void)shortVideoUploader:(PLShortVideoUploader * _Nonnull)uploader completeInfo:(PLSUploaderResponseInfo * _Nonnull)info uploadKey:(NSString * _Nonnull)uploadKey resp:(NSDictionary * _Nullable)resp; @end -/** - * @abstract 短视频录制的上传功能核心类。 - * - * @discussion 一个 PLShortVideoUploader 实例实现段视频上传功能。 +/*! + @class PLShortVideoUploader + @abstract 短视频录制的上传功能核心类。 + + @discussion 一个 PLShortVideoUploader 实例实现段视频上传功能。 */ @interface PLShortVideoUploader : NSObject -/** +/*! + @property cancelUpload @brief 取消/继续上传,YES 为取消上传,NO 为继续上传,默认为 NO @since v1.0.4 */ @property (nonatomic, assign, readonly, getter=isCancelUpload)BOOL cancelUpload; -/** +/*! + @property uploadPercent @brief 上传进度 @since v1.0.4 */ @property (nonatomic, assign, readonly)float uploadPercent; -/** +/*! + @property uploadConfig @brief 上传配置参数 @see PLSUploaderConfiguration类 @@ -65,49 +86,66 @@ */ @property (nonatomic, strong, readonly)PLSUploaderConfiguration * _Nonnull uploadConfig; -/** - 代理对象,用于告知上传状态改变或其他行为,对象需实现 PLSUploadDelegate 协议 +/*! + @property delegate + @brief 代理对象,用于告知上传状态改变或其他行为,对象需实现 PLSUploadDelegate 协议 @since v1.0.4 */ @property (nonatomic, weak, nullable) id delegate; -/** +/*! + @method sharedUploader: @abstract 创建 PLShortVideoUploader 单例对象 + @return PLShortVideoUploader 实例 + @since v1.0.4 */ + (instancetype _Nullable)sharedUploader:(PLSUploaderConfiguration * _Nonnull)config; -/** +/*! + @method initWithConfiguration: @abstract 初始化 PLShortVideoUploader + @return PLShortVideoUploader 实例 + @since v1.0.4 */ - (instancetype _Nullable)initWithConfiguration:(PLSUploaderConfiguration * _Nonnull)config; -/** +/*! + @method uploadVideoFile: @abstract 上传视频文件 + @param videoPath 上传的视频文件存放地址 + @since v1.0.4 */ - (void)uploadVideoFile:(NSString * _Nonnull)videoPath; -/** +/*! + @method uploadVideoALAsset: @abstract 上传 ALAsset 类视频资源文件 + @param asset 上传的 ALAsset 视频文件 + @since v1.0.5 */ - (void)uploadVideoALAsset:(ALAsset * _Nonnull)asset; -/** +/*! + @method uploadVideoPHAsset: @abstract 上传 PHAsset 类视频资源文件 + @param asset 上传的 PHAsset 视频文件 + @since v1.0.5 */ - (void)uploadVideoPHAsset:(PHAsset * _Nonnull)asset; -/** +/*! + @method cancelUploadVidoFile @abstract 取消上传视频 @since v1.0.4 diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/Info.plist b/Pod/Library/Advanced/PLShortVideoKit.framework/Info.plist new file mode 100644 index 00000000..2a89d1fc Binary files /dev/null and b/Pod/Library/Advanced/PLShortVideoKit.framework/Info.plist differ diff --git a/Pod/Library/PLShortVideoKit.framework/Modules/module.modulemap b/Pod/Library/Advanced/PLShortVideoKit.framework/Modules/module.modulemap similarity index 100% rename from Pod/Library/PLShortVideoKit.framework/Modules/module.modulemap rename to Pod/Library/Advanced/PLShortVideoKit.framework/Modules/module.modulemap diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/PLShortVideoKit b/Pod/Library/Advanced/PLShortVideoKit.framework/PLShortVideoKit new file mode 100644 index 00000000..155f77b4 Binary files /dev/null and b/Pod/Library/Advanced/PLShortVideoKit.framework/PLShortVideoKit differ diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeDirectory b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeDirectory new file mode 100644 index 00000000..41e61bfc Binary files /dev/null and b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeDirectory differ diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeRequirements b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeRequirements new file mode 100644 index 00000000..b43781e0 Binary files /dev/null and b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeRequirements differ diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeRequirements-1 b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeRequirements-1 new file mode 100644 index 00000000..803f3a58 Binary files /dev/null and b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeRequirements-1 differ diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeResources b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeResources new file mode 100644 index 00000000..8757b829 --- /dev/null +++ b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeResources @@ -0,0 +1,586 @@ + + + + + files + + Headers/AVAsset+PLSExtendProperty.h + + SWRl2gOO0iYX4V7JptJkIxTzeEE= + + Headers/PLSAVAssetExportSession.h + + 9ot5Mkc6EXASC0kmoAZTdWtEd3Q= + + Headers/PLSAudioConfiguration.h + + 2Bb0sf/wC9dJ+Qfkysn3as/woNY= + + Headers/PLSEditPlayer.h + + CMCE9jCENNzRcNG73zDPfKZdZqI= + + Headers/PLSEditSettings.h + + /vHTTsPKNhiWupmCF7MwwWY1ayc= + + Headers/PLSFadeTranstion.h + + P0R2X1qA6JzWdw/qR8W2HcSz2CY= + + Headers/PLSFilter.h + + Ee2XD6Z5U6tES2yn1bHEwGwwLUQ= + + Headers/PLSGifComposer.h + + d/aV5YXPfmKhkRYXKhK2EjySJa8= + + Headers/PLSImageRotateRecorder.h + + iQf4qzin0K7vGk0UHlHeNG4kfaM= + + Headers/PLSImageSetting.h + + 5T7NO+wYFi7SA4O6EnbNQvhdK3M= + + Headers/PLSImageToMovieComposer.h + + zlQny/jdjvLLEDaeB8uyDBJElWE= + + Headers/PLSMovieComposer.h + + dI6zTrkvL9cHeVQk7QK7yzHaMdI= + + Headers/PLSPositionTransition.h + + LDIgAdjm+1V1YEvJMtSrbTkX7vA= + + Headers/PLSRotateTransition.h + + bws3dagqYayaNeY1vdgx/dE/8bA= + + Headers/PLSScaleTransition.h + + i61v03HRkFZFmMNPkOUqtzcxi5o= + + Headers/PLSTextSetting.h + + oLlIT6Gd00+wT+n2sPCJybv8BMs= + + Headers/PLSTransition.h + + hrhiJjhd08Om3KmhpZv8/L+ICMM= + + Headers/PLSTransitionAssetExport.h + + 3uh6hSgIkeVjA7ycL/q1TmJAjo8= + + Headers/PLSTransitionMaker.h + + W2eSmNpC57c3V4kLZS6fysKr/tA= + + Headers/PLSTypeDefines.h + + GyZvMlO5kQUDrJV/g/6YaoHBToU= + + Headers/PLSUploaderConfiguration.h + + cQayQ/rAx8WsCM9wUwfx1A96Yr8= + + Headers/PLSUploaderResponseInfo.h + + 8c6O/9F1IJBt0ofw4yXEQUtrwPM= + + Headers/PLSVideoConfiguration.h + + VW9JUbmxCpXkklRVBBO/jc+Dfyw= + + Headers/PLShortVideoAsset.h + + HNqGXY4l2E29xNonu4HgoSZTjv8= + + Headers/PLShortVideoEditor.h + + 84vPJf5rZ0ej00+/FZ6HNtJJ8pw= + + Headers/PLShortVideoKit.h + + eU3guFEZzSnd1TTTjuGdtVugNSA= + + Headers/PLShortVideoKitEnv.h + + qlw9lqQd2bYzY99QtlTEW4Cn4X8= + + Headers/PLShortVideoRecorder.h + + rpSI/C95ynrlDz2CeuRJsXEBb6U= + + Headers/PLShortVideoTranscoder.h + + rUXI88JO8HfrtyM0x/1kSJC0Zog= + + Headers/PLShortVideoUploader.h + + EnmjKfkvfilweaFWgUAaM8dyIoQ= + + Info.plist + + QzCbnFJgvu3rV9lOfLeru/LhcFg= + + Modules/module.modulemap + + +pa9k0pqKWlbwK9Mjk4UbUk5dRY= + + + files2 + + Headers/AVAsset+PLSExtendProperty.h + + hash + + SWRl2gOO0iYX4V7JptJkIxTzeEE= + + hash2 + + K7tvrUxowuShZk2JjHhoRsY6JuglIcaavRfUTyFGhHg= + + + Headers/PLSAVAssetExportSession.h + + hash + + 9ot5Mkc6EXASC0kmoAZTdWtEd3Q= + + hash2 + + P0Sot7eZCCro6RY7ScQ79dfw/Tv8ppJB2a/1QCz2Th0= + + + Headers/PLSAudioConfiguration.h + + hash + + 2Bb0sf/wC9dJ+Qfkysn3as/woNY= + + hash2 + + pe8YPDmhYhtChXZMjmL/j+zyBRF682tMShb2Sua+wiA= + + + Headers/PLSEditPlayer.h + + hash + + CMCE9jCENNzRcNG73zDPfKZdZqI= + + hash2 + + E/geIB03yFM69VzS2eBhOO8bjqA5cNep0YJ0tEFwV+g= + + + Headers/PLSEditSettings.h + + hash + + /vHTTsPKNhiWupmCF7MwwWY1ayc= + + hash2 + + ISlZDXiGdbCzS9fMbs53aTTcu9zXefFIQKUjO8Qlczs= + + + Headers/PLSFadeTranstion.h + + hash + + P0R2X1qA6JzWdw/qR8W2HcSz2CY= + + hash2 + + FS4gkUzjHPqdUTsWyhuNsmlyACQseRyNAblPRsbSX9o= + + + Headers/PLSFilter.h + + hash + + Ee2XD6Z5U6tES2yn1bHEwGwwLUQ= + + hash2 + + 1+LjfiELKeMsqEzNwvF2OgnyRvD7G5FNtCLWR4kSziA= + + + Headers/PLSGifComposer.h + + hash + + d/aV5YXPfmKhkRYXKhK2EjySJa8= + + hash2 + + JFk6fqAMwIFRMCGi9PwtexNTIJIi9XeWvssnwF9dS7I= + + + Headers/PLSImageRotateRecorder.h + + hash + + iQf4qzin0K7vGk0UHlHeNG4kfaM= + + hash2 + + D4RvWFGD1Imw8SgdsNkikA4qZLIjqTmQjJaPgxzkcUg= + + + Headers/PLSImageSetting.h + + hash + + 5T7NO+wYFi7SA4O6EnbNQvhdK3M= + + hash2 + + V5LYFlGCwdGbbcitPGMTFiTsZjZ1CZOcGdOiCCx896Q= + + + Headers/PLSImageToMovieComposer.h + + hash + + zlQny/jdjvLLEDaeB8uyDBJElWE= + + hash2 + + 91AYTZgFZe/b9HAxzaZqhDj5ek1qyfeON0oq8Go4udI= + + + Headers/PLSMovieComposer.h + + hash + + dI6zTrkvL9cHeVQk7QK7yzHaMdI= + + hash2 + + T5KnkL7yyQYO9S0niX5ohKSC/V0Hr+K1dm6Cu4ch+K8= + + + Headers/PLSPositionTransition.h + + hash + + LDIgAdjm+1V1YEvJMtSrbTkX7vA= + + hash2 + + CYas5o6qS5K44NiKdLGpKVjohm7y7klG/AYxFMfyPVE= + + + Headers/PLSRotateTransition.h + + hash + + bws3dagqYayaNeY1vdgx/dE/8bA= + + hash2 + + 5llOKVtKZWzLT+CK0fUoxdxi664/33G46AOS9GUZIG4= + + + Headers/PLSScaleTransition.h + + hash + + i61v03HRkFZFmMNPkOUqtzcxi5o= + + hash2 + + 4FbVYUkZRkCZDj0LPQG/nA4lrWrUMU2LP1n0IzOOQpU= + + + Headers/PLSTextSetting.h + + hash + + oLlIT6Gd00+wT+n2sPCJybv8BMs= + + hash2 + + vLsStQxJKRqov/S5tttOQdqOaufVvV+PvarBKKmwPIo= + + + Headers/PLSTransition.h + + hash + + hrhiJjhd08Om3KmhpZv8/L+ICMM= + + hash2 + + Vf4DjCogSFbrn/ipBQFoHQvFCxe6t47C0Ag+g3PoDpY= + + + Headers/PLSTransitionAssetExport.h + + hash + + 3uh6hSgIkeVjA7ycL/q1TmJAjo8= + + hash2 + + o9FIJbcMo9GFxWku3N6USe+2YvLBf9346RDB3UCjEak= + + + Headers/PLSTransitionMaker.h + + hash + + W2eSmNpC57c3V4kLZS6fysKr/tA= + + hash2 + + 3S7a5e74znz/0wrmcW0AtcTKapIr3V/z1EaYtwkmDZ0= + + + Headers/PLSTypeDefines.h + + hash + + GyZvMlO5kQUDrJV/g/6YaoHBToU= + + hash2 + + XPkmrHwOvglhgLt8JOgalbpe+kwuNjfNTIHaP+5HH7Q= + + + Headers/PLSUploaderConfiguration.h + + hash + + cQayQ/rAx8WsCM9wUwfx1A96Yr8= + + hash2 + + T7r6RH12isCfcKYFErE2/WQE/zkfdpxvGs5o62vy9jw= + + + Headers/PLSUploaderResponseInfo.h + + hash + + 8c6O/9F1IJBt0ofw4yXEQUtrwPM= + + hash2 + + ttc1D03XnTd+LcJGKZMiCrocm9OkyiYMf+1/rPx/GaY= + + + Headers/PLSVideoConfiguration.h + + hash + + VW9JUbmxCpXkklRVBBO/jc+Dfyw= + + hash2 + + M+DL7sHWoV2ssA7zTmeE8jYJdyDn7/RYmik/IWeCNBs= + + + Headers/PLShortVideoAsset.h + + hash + + HNqGXY4l2E29xNonu4HgoSZTjv8= + + hash2 + + AkSrTx1b1p05/kZNJEnKXgdAQNNoyW2Wvad9wXF7bjM= + + + Headers/PLShortVideoEditor.h + + hash + + 84vPJf5rZ0ej00+/FZ6HNtJJ8pw= + + hash2 + + X4U/IyChkbCCoqJG6/Q9C3oeCMkiHAh84fEaqppBq+s= + + + Headers/PLShortVideoKit.h + + hash + + eU3guFEZzSnd1TTTjuGdtVugNSA= + + hash2 + + A5TvCBgVCg2yVdK/gamuRnUCdN5lfFYJ1V/Go2elzzE= + + + Headers/PLShortVideoKitEnv.h + + hash + + qlw9lqQd2bYzY99QtlTEW4Cn4X8= + + hash2 + + 2HhROV5zwTFWfozCrLEt21DZOGUEMvUGFwXLzk+KPt4= + + + Headers/PLShortVideoRecorder.h + + hash + + rpSI/C95ynrlDz2CeuRJsXEBb6U= + + hash2 + + xPLi7utvhswAqIL7yViSgH9vTMmE+ODucyF+Bv8l6IM= + + + Headers/PLShortVideoTranscoder.h + + hash + + rUXI88JO8HfrtyM0x/1kSJC0Zog= + + hash2 + + Cf8EuCb/di1iN8u4V7V4nRhflsOKWd9Xgej8toWpeOQ= + + + Headers/PLShortVideoUploader.h + + hash + + EnmjKfkvfilweaFWgUAaM8dyIoQ= + + hash2 + + LrTK8wZVo2KzqQIJzcpWzeCCjwbgkxAbJjtTfe4IC9Q= + + + Modules/module.modulemap + + hash + + +pa9k0pqKWlbwK9Mjk4UbUk5dRY= + + hash2 + + xoarXq2A9ptaDfat5G5iJgV0awRKFOAUT5CybLzv/EI= + + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeSignature b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeSignature new file mode 100644 index 00000000..b990b5cb Binary files /dev/null and b/Pod/Library/Advanced/PLShortVideoKit.framework/_CodeSignature/CodeSignature differ diff --git a/Pod/Library/libMuseProcessor.a b/Pod/Library/Advanced/libMuseProcessor.a similarity index 100% rename from Pod/Library/libMuseProcessor.a rename to Pod/Library/Advanced/libMuseProcessor.a diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h new file mode 100644 index 00000000..4690bb3c --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h @@ -0,0 +1,75 @@ +// +// AVAsset+PLSExtendProperty.h +// PLShortVideoKit +// +// Created by suntongmian on 2018/3/28. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import + +/*! + @category AVAsset (PLSExtendProperty) + @brief AVAsset 常用属性获取的类别 + + @since v1.11.0 + */ +@interface AVAsset (PLSExtendProperty) + +/*! + @property pls_videoSize + @brief 视频的真实分辨率,即就是视频播放的时候,显示的分辨率 + + @since v1.11.0 + */ +@property (assign, nonatomic, readonly) CGSize pls_videoSize; + +/*! + @property pls_portrait + @brief 视频是否为竖屏视频 + + @since v1.11.0 + */ +@property (assign, nonatomic, readonly) BOOL pls_portrait; + +/*! + @property pls_squareVideo + @brief 视频是否为正方形视频 + + @since v1.11.0 + */ +@property (assign, nonatomic, readonly) BOOL pls_squareVideo; + +/*! + @property pls_bitrate + @brief 视频的码率 + + @since v1.11.0 + */ +@property (assign, nonatomic, readonly) float pls_bitrate; + +/*! + @property pls_normalFrameRate + @brief 视频的帧率 + + @since v1.15.0 + */ +@property (assign, nonatomic, readonly) float pls_normalFrameRate; + +/*! + @property pls_channel + @brief 如果 AVAsset 包含音频通道,则返回第一个音频通道的声道数 + + @since v1.16.1 + */ +@property (assign, nonatomic, readonly) UInt32 pls_channel; + +/*! + @property pls_sampleRate + @brief 如果 AVAsset 包含音频通道,则返回第一个音频通道的采样率 + + @since v1.16.1 + */ +@property (assign, nonatomic, readonly) Float64 pls_sampleRate; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h similarity index 63% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h rename to Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h index e92340fd..d5a3a068 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h @@ -12,22 +12,34 @@ #import "PLSTypeDefines.h" -@class PLSEditAudio; @class PLSAVAssetExportSession; +/*! + @protocol PLSAVAssetExportSessionDelegate + @abstract 视频导出协议 + + @since v1.1.0 + */ @protocol PLSAVAssetExportSessionDelegate @optional -/** +/*! + @method assetExportSession:didOutputPixelBuffer: @abstract 输出视频文件的视频数据,用来做滤镜处理 + @param assetExportSession PLSAVAssetExportSession 实例 + @param pixelBuffer 视频帧 + @since v1.1.0 */ - (CVPixelBufferRef __nonnull)assetExportSession:(PLSAVAssetExportSession *__nonnull)assetExportSession didOutputPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer __deprecated_msg("Method deprecated in v1.9.0. Use `assetExportSession: didOutputPixelBuffer: timestamp:`"); -/** +/*! + @method assetExportSession:didOutputPixelBuffer:timestamp: @abstract 输出视频文件的视频数据,用来做滤镜处理 + + @param assetExportSession PLSAVAssetExportSession 实例 @param pixelBuffer 视频帧 @param timestamp 视频帧的时间戳 @@ -37,16 +49,21 @@ @end +/*! + @class PLSAVAssetExportSession + @brief 短视频导出核心类 + */ @interface PLSAVAssetExportSession : NSObject -/** +/*! + @property delegate @abstract 操作视频段的代理 @since v1.1.0 */ @property (weak, nonatomic) __nullable id delegate; -/** +/*! @property delegateQueue @abstract 触发代理对象回调时所在的任务队列。 @@ -61,28 +78,35 @@ @property (strong, nonatomic) dispatch_queue_t __nullable delegateQueue; -/** +/*! + @method initWithAsset: @brief 实例初始化方法 + @param asset AVAsset 实例 + + @return PLSAVAssetExportSession 实例 @since v1.1.0 */ - (instancetype _Nullable )initWithAsset:(AVAsset *_Nullable)asset; -/** +/*! + @property isExportMovieToPhotosAlbum @brief 将视频导出到相册,默认为 NO @since v1.4.0 */ @property (assign, nonatomic) BOOL isExportMovieToPhotosAlbum; -/** +/*! + @property outputFileType @brief 视频导出的文件类型,默认为 PLSFileTypeMPEG4(.mp4) @since v1.1.0 */ @property (assign, nonatomic) PLSFileType outputFileType; -/** +/*! + @property outputURL @brief 视频导出的路径 @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 @@ -91,142 +115,118 @@ */ @property (strong, nonatomic) NSURL * _Nullable outputURL; -/** +/*! + @property bitrate @brief 视频的码率,默认为原视频的码率 @since v1.11.0 */ @property (assign, nonatomic) float bitrate; -/** - @brief 视频旋转,默认为 PLSPreviewOrientationPortrait 视频的原始方向 - - @since v1.7.0 - */ -@property (assign, nonatomic) PLSPreviewOrientation videoLayerOrientation; - -/** +/*! + @property outputVideoSize @brief 视频导出的分辨率 @since v1.5.0 */ @property (assign, nonatomic) CGSize outputVideoSize; -/** - @brief 视频的帧率,默认为原视频的帧率. 如果设置的帧率大于原视频的帧率,将会使用原视频的帧率作为导出视频的帧率, - 没有特别的需求不建议使用此属性. +/*! + @property outputVideoFrameRate + @brief 视频的帧率 - 使用此属性的场景举例:在编辑阶段对帧率为 60 FPS 的视频进行 “极速“ 处理,然后使用 PLSAVAssetExportSession - 导出这个极速处理的视频,如果不加帧率限制,导出的将会是 120 FPS 的视频,iPhone 设备播放 120 FPS 的视频会存在 - 问题。此时可以使用此属性将导出视频的帧率限制在 60 FPS 以内。 + @discussion 默认为原视频的帧率. 如果设置的帧率大于原视频的帧率,将会使用原视频的帧率作为导出视频的帧率,没有特别的需求不建议使用此属性.使用此属性的场景举例:在编辑阶段对帧率为 60 FPS 的视频进行 “极速“ 处理,然后使用 PLSAVAssetExportSession 导出这个极速处理的视频,如果不加帧率限制,导出的将会是 120 FPS 的视频,iPhone 设备播放 120 FPS 的视频会存在问题。此时可以使用此属性将导出视频的帧率限制在 60 FPS 以内。 @since v1.15.0 */ @property (assign, nonatomic) float outputVideoFrameRate; -/** +/*! + @property audioBitrate @brief 导出视频的音频码率,默认:PLSAudioBitRate_128Kbps + @discussion 音频的码率设置应该根据音频采样率和声道数来设置,如果设置的码率值和标准值相差太大,可能引起音频编码失败,导致导出视频文件失败。推荐的码率设置请查看 PLSAudioSampleRate 和 PLSAudioBitRate + @see PLSAudioSampleRate + @see PLSAudioBitRate + @since v1.16.0 */ @property (assign, nonatomic) PLSAudioBitRate audioBitrate; -/** - @brief 导出视频的音频声道数,目前支持单声道和双声道(即 1 个声道数和 2 个声道数). 如果不设置,将按照如下规则处理: - 如果原视频是单声道,则导出视频将使用单声道. 如果原视频声道数不小于 2,则导出视频声道数为 2 +/*! + @property audioChannel + @brief 导出视频的音频声道数。 + @discussion 目前支持单声道和双声道(即 1 个声道数和 2 个声道数). 如果不设置,将按照如下规则处理: + 如果原视频是单声道,则导出视频将使用单声道. 如果原视频声道数不小于 2,则导出视频声道数为 2 @since v1.16.0 */ -@property (assign, nonatomic) NSInteger audioChannel; +@property (assign, nonatomic) UInt32 audioChannel; -/** +/*! + @property shouldOptimizeForNetworkUse @brief 是否设置便于网络环境下的传输,默认为 YES @since v1.1.0 */ @property (assign, nonatomic) BOOL shouldOptimizeForNetworkUse; -/** +/*! + @property outputSettings @brief 视频导出的设置信息 @since v1.1.0 */ @property (strong, nonatomic) NSDictionary * _Nullable outputSettings; -/** +/*! + @property progress @brief 视频导出的进度 @since v1.1.0 */ @property (nonatomic, readonly) float progress; -/** +/*! + @property completionBlock @abstract 视频导出完成的 block @since v1.1.0 */ @property (copy, nonatomic) void(^ _Nullable completionBlock)(NSURL * _Nullable url); -/** +/*! + @property failureBlock @abstract 视频导出失败的 block @since v1.1.0 */ @property (copy, nonatomic) void(^ _Nullable failureBlock)(NSError* _Nullable error); -/** +/*! + @property processingBlock @abstract 视频导出进度的 block,可在该 block 中刷新导出进度条 UI @since v1.1.0 */ @property (copy, nonatomic) void(^ _Nullable processingBlock)(float progress); -/** +/*! + @method exportAsynchronously @brief 异步进行视频导出 @since v1.1.0 */ - (void)exportAsynchronously; -/** +/*! + @method cancelExport @brief 取消视频导出 @since v1.1.0 */ - (void)cancelExport; -/** - * 添加滤镜效果 - * - * @param colorImagePath 当前使用的滤镜的颜色表图的路径 - - @since v1.5.0 - */ -- (void)addFilter:(NSString *_Nullable)colorImagePath; - -/** - * 添加 MV 图层方法 1, 相当于 addMVLayerWithColor:colorURL alpha:alphaURL timeRange:kCMTimeRangeZero loopEnable:NO - * - * @param colorURL 彩色层视频的地址 - * @param alphaURL 被彩色层当作透明层的视频的地址 - - @since v1.5.0 - */ -- (void)addMVLayerWithColor:(NSURL *_Nullable)colorURL alpha:(NSURL *_Nullable)alphaURL; - - -/** - * 添加 MV 图层方法 2 - * - * @param colorURL 彩色层视频的地址 - * @param alphaURL 被彩色层当作透明层的视频的地址 - * @param timeRange 选取 MV 文件的时间段, 如果选取整个 MV,直接传入 kCMTimeRangeZero 即可 - * @param loopEnable 当 MV 时长(timeRange.duration)小于视频时长时,是否循环播放 MV - - @since v1.14.0 - */ -- (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL timeRange:(CMTimeRange)timeRange loopEnable:(BOOL)loopEnable; - @end diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h new file mode 100644 index 00000000..7be7540a --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h @@ -0,0 +1,58 @@ +// +// PLSAudioConfiguration.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/1. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLSAudioConfiguration + @brief 采集和录制文件编码音频参数配置类 + + @since v1.0.0 + */ +@interface PLSAudioConfiguration : NSObject + +/*! + @property numberOfChannels + @brief 采集音频数据的声道数,默认为 1 + + @warning 并非所有采集设备都支持多声道数据的采集 + + @since v1.0.0 + */ +@property (assign, nonatomic) NSUInteger numberOfChannels; + +/*! + @property sampleRate + @brief 音频采样率 sampleRate 默认为 PLSAudioSampleRate_44100Hz + + @since v1.0.0 + */ +@property (assign, nonatomic) PLSAudioSampleRate sampleRate; + +/*! + @property bitRate + @brief 音频编码码率 bitRate 默认为 PLSAudioBitRate_128Kbps + + @since v1.0.0 + */ +@property (assign, nonatomic) PLSAudioBitRate bitRate; + + +/*! + @method defaultConfiguration + @brief 创建一个默认配置的 PLSAudioConfiguration 实例. + + @return 创建的默认 PLSAudioConfiguration 对象 + + @since v1.0.0 + */ ++ (instancetype)defaultConfiguration; + +@end diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSEditPlayer.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSEditPlayer.h new file mode 100644 index 00000000..241c27e7 --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSEditPlayer.h @@ -0,0 +1,217 @@ +// +// PLSEditPlayer.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/7/10. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import +#import "PLSTypeDefines.h" + +@class PLSEditPlayer; + +/*! + @protocol PLSEditPlayerDelegate + @brief 视频编辑播放器协议 + + @since v1.1.0 + */ +@protocol PLSEditPlayerDelegate + +@optional + +/*! + @method player:didGetOriginPixelBuffer: + @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param player PLSEditPlayer 实例 + @param pixelBuffer CVPixelBufferRef 视频帧 + + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef + + @since v1.1.0 + */ +- (CVPixelBufferRef __nonnull)player:(PLSEditPlayer *__nonnull)player didGetOriginPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer __deprecated_msg("Method deprecated in v1.9.0. Use `player: didGetOriginPixelBuffer: timestamp:`"); + +/*! + @method player:didGetOriginPixelBuffer:timestamp: + @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param player PLSEditPlayer 实例 + @param pixelBuffer CVPixelBufferRef 视频帧 + @param timestamp 视频帧的时间戳 + + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef + + @since v1.9.0 + */ +- (CVPixelBufferRef __nonnull)player:(PLSEditPlayer *__nonnull)player didGetOriginPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer timestamp:(CMTime)timestamp; + +/*! + @method player:didReadyToPlayForItem:timeRange + @brief 当前视频的播放时刻达到了视频开头 + + @param player PLSEditPlayer 实例 + @param item 当前视频 + @param timeRange 当前视频的有效视频区域,对应 PLSEditPlayer 的属性 @property (assign, nonatomic) CMTimeRange timeRange + + @since v1.9.0 + */ +- (void)player:(PLSEditPlayer *__nonnull)player didReadyToPlayForItem:(AVPlayerItem *__nonnull)item timeRange:(CMTimeRange)timeRange; + +/*! + @method player:didReachEndForItem:timeRange + @brief 当前视频的播放时刻达到了视频结尾 + + @param player PLSEditPlayer 实例 + @param item 当前视频 + @param timeRange 当前视频的有效视频区域,对应 PLSEditPlayer 的属性 @property (assign, nonatomic) CMTimeRange timeRange + + @since v1.9.0 + */ +- (void)player:(PLSEditPlayer *__nonnull)player didReachEndForItem:(AVPlayerItem *__nonnull)item timeRange:(CMTimeRange)timeRange; + +@end + +/*! + @class PLSEditPlayer + @brief 视频编辑播放器类 + + @since v1.1.0 + */ +@interface PLSEditPlayer : AVPlayer + +/*! + @property delegate + @brief id 类型代理 + + @since v1.1.0 + */ +@property (weak, nonatomic) __nullable id delegate; + +/*! + @property loopEnabled + @brief 循环播放。设置为 YE,表示单曲循环。默认为 NO + + @since v1.1.0 + */ +@property (assign, nonatomic) BOOL loopEnabled; + +/*! + @property isPlaying + @brief 播放器是否在播放状态 + + @since v1.1.0 + */ +@property (readonly, nonatomic) BOOL isPlaying; + +/*! + @property preview + @brief 播放器的预览视图 + + @since v1.1.0 + */ +@property (strong, nonatomic) UIView *__nullable preview; + +/*! + @property fillMode + @brief 播放器预览视图的填充方式 + + @since v1.1.0 + */ +@property (assign, nonatomic) PLSVideoFillModeType fillMode; + +/*! + @property volume + @brief 播放器的音量 + + @since v1.1.0 + */ +@property (assign, nonatomic) float volume; + +/*! + @property timeRange + @brief 播放器播放文件的 timeRange 范围内 [start, duration] 片段 + + @since v1.1.0 + */ +@property (assign, nonatomic) CMTimeRange timeRange; + +/*! + @property videoSize + @brief 播放器播放视频的分辨率 + + @since v1.5.0 + */ +@property (assign, nonatomic) CGSize videoSize; + +/*! + @method audioPlayer + @brief 初始化音频播放器 + + @return 音频播放器 + @since v1.3.0 + */ ++ (PLSEditPlayer *_Nullable)audioPlayer; + +/*! + @method setItemByStringPath: + @brief 通过 stringPath 加载 AVPlayerItem + + @param stringPath 文件存放地址 + + @since v1.1.0 + */ +- (void)setItemByStringPath:(NSString *__nullable)stringPath; + +/*! + @method setItemByUrl: + @brief 通过 url 加载 AVPlayerItem + + @param url 文件存放地址 + + @since v1.1.0 + */ +- (void)setItemByUrl:(NSURL *__nullable)url; + +/*! + @method setItemByAsset: + @brief 通过 asset 加载 AVPlayerItem + + @param asset AVAsset 对象 + + @since v1.1.0 + */ +- (void)setItemByAsset:(AVAsset *__nullable)asset; + +/*! + @method setItem: + @brief 接收 item 去播放 + + @param item AVPlayerItem 对象 + + @since v1.1.0 + */ +- (void)setItem:(AVPlayerItem *__nullable)item; + +/*! + @method play + @brief 播放 + + @since v1.1.0 + */ +- (void)play; + +/*! + @method pause + @brief 暂停 + + @since v1.1.0 + */ +- (void)pause; + +@end diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSEditSettings.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSEditSettings.h new file mode 100644 index 00000000..152325b1 --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSEditSettings.h @@ -0,0 +1,115 @@ +// +// PLSEditSettings.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/7/11. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTypeDefines.h" + +// ------------------------------------------------------------------ + +/*! + @constant PLSMovieSettingsKey + @abstract 视频对象的编辑信息 + @discussion + 存储的值的类型为 NSDictionary,包括 + PLSURLKey, + PLSAssetKey, + PLSStartTimeKey, + PLSDurationKey, + PLSVolumeKey, + PLSNameKey + + Note: PLSURLKey 和 PLSAssetKey 中必须设置其中的一项. + + @since v1.1.0 + */ +PLS_EXPORT NSString *const PLSMovieSettingsKey; + +/*! + @constant PLSAudioSettingsKey + @abstract 音频对象的编辑信息 + @discussion + 存储的值的类型为 NSDictionary,包括 + PLSURLKey, + PLSStartTimeKey, + PLSDurationKey, + PLSVolumeKey, + PLSNameKey, // 可以不设置 + PLSLocationStartTimeKey, // added by v1.11.0 + PLSLocationDurationKey // added by v1.11.0 + + @since v1.1.0 + */ +PLS_EXPORT NSString *const PLSAudioSettingsKey; + +/*! + @constant PLSWatermarkSettingsKey + @abstract 水印的设置信息 + @discussion + 存储的值的类型为 NSDictionary,包括 + PLSURLKey, + PLSSizeKey, + PLSPointKey + + @since v1.1.0 + */ +PLS_EXPORT NSString *const PLSWatermarkSettingsKey; + +/*! + @constant PLSStickerSettingsKey + @abstract 贴纸设置信息 + @discussion + 存储的值的类型为 NSDictionary,包括 + PLSStickerKey, + PLSSizeKey, + PLSPointKey + PLSRotationKey, + PLSStartTimeKey, + PLSDurationKey, + PLSVideoPreviewSizeKey, + PLSVideoOutputSizeKey + + @since v1.11.0 + */ +PLS_EXPORT NSString *const PLSStickerSettingsKey; + +// ------------------------------------------------------------------ + +PLS_EXPORT NSString *const PLSURLKey; /* NSURL */ + +PLS_EXPORT NSString *const PLSAssetKey; /* AVAsset */ + +PLS_EXPORT NSString *const PLSDurationKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSStartTimeKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSVolumeKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSNameKey; /* NSString */ + +PLS_EXPORT NSString *const PLSSizeKey; /* NSValue(CGSize) */ + +PLS_EXPORT NSString *const PLSPointKey; /* NSValue(CGPoint) */ + +PLS_EXPORT NSString *const PLSAlphaKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSTypeKey; /* NSNumber(NSInteger) */ + +PLS_EXPORT NSString *const PLSStickerKey; /* UIView */ + +PLS_EXPORT NSString *const PLSRotationKey; /* NSNumber(float),单位为度,比如:0,45,90,180 */ + +PLS_EXPORT NSString *const PLSVideoPreviewSizeKey; /* NSValue(CGSize) */ + +PLS_EXPORT NSString *const PLSVideoOutputSizeKey; /* NSValue(CGSize) */ + +PLS_EXPORT NSString *const PLSLocationStartTimeKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSLocationDurationKey; /* NSNumber(float) */ + + diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSFilter.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSFilter.h new file mode 100644 index 00000000..c277cead --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSFilter.h @@ -0,0 +1,73 @@ +// +// PLSFilter.h +// PLShortVideoKit +// +// Created by suntongmian on 17/4/13. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import + +/*! + @class PLSFilter + @brief 滤镜处理类 + + @since v1.3.0 + */ +@interface PLSFilter : NSObject + +/*! + @property colorImagePath + @abstract 色彩图片的路径 + + @since v1.3.0 + */ +@property (strong, nonatomic) NSString *colorImagePath; + +/*! + @method init + @abstract 初始化滤镜实例 + + @return PLSFilter 实例 + @since v1.3.0 + */ +- (instancetype)init; + +/*! + @method initWithColorImagePath: + @abstract 使用色彩图片初始化滤镜实例 + + @param colorImagePath 色彩图片的路径 + + @return PLSFilter 实例 + @since v1.1.0 + */ +- (instancetype)initWithColorImagePath:(NSString *)colorImagePath __deprecated; + +/*! + @method process: + @abstract 处理图像,加滤镜效果 + + @param pixelBuffer 源图像数据 + + @return 处理之后的 CVPixelBufferRef 滤镜图像 + + @since v1.1.0 + */ +- (CVPixelBufferRef)process:(CVPixelBufferRef)pixelBuffer; + +/*! + @method applyFilter:colorImagePath: + @abstract 处理图像,加滤镜效果 + + @param inputImage 待处理图片 + @param colorImagePath 滤镜资源文件路径 + + @return 处理之后的 UIImage 滤镜图像 + + @since v1.1.0 + */ ++ (UIImage *)applyFilter:(UIImage *)inputImage colorImagePath:(NSString *)colorImagePath; + +@end diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSTypeDefines.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSTypeDefines.h new file mode 100644 index 00000000..fffd7a69 --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSTypeDefines.h @@ -0,0 +1,371 @@ +// +// PLSTypeDefines.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/1. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#ifndef PLCameraStreamingKit_PLTypeDefines_h +#define PLCameraStreamingKit_PLTypeDefines_h + +#import +#import + +#if defined(__cplusplus) +#define PLS_EXPORT extern "C" +#else +#define PLS_EXPORT extern +#endif + + +// post with userinfo @{@"state": @(state)}. always posted via MainQueue. +extern NSString *PLSCameraAuthorizationStatusDidGetNotificaiton; +extern NSString *PLSMicrophoneAuthorizationStatusDidGetNotificaiton; + +extern NSString *PLSCameraDidStartRunningNotificaiton; +extern NSString *PLSMicrophoneDidStartRunningNotificaiton; + +/*! + @typedef PLSAuthorizationStatus + @abstract 设备授权状态。 + + @since v1.0.0 + */ +typedef enum { + /// 还没有确定是否授权 + PLSAuthorizationStatusNotDetermined = 0, + /// 设备受限,一般在家长模式下设备会受限 + PLSAuthorizationStatusRestricted, + /// 拒绝授权 + PLSAuthorizationStatusDenied, + /// 已授权 + PLSAuthorizationStatusAuthorized +} PLSAuthorizationStatus; + +/*! + @typedef PLSVideoFillModeType + @abstract 视频预览填充模式。 + + @since v1.0.0 + */ +typedef enum { + /// Stretch to fill the full view, which may distort the image outside of its normal aspect ratio + PLSVideoFillModeStretch, + + /// Maintains the aspect ratio of the source image, adding bars of the specified background color + PLSVideoFillModePreserveAspectRatio, + + /// Maintains the aspect ratio of the source image, zooming in on its center to fill the view + PLSVideoFillModePreserveAspectRatioAndFill +} PLSVideoFillModeType; + +/*! + @typedef PLSPreviewOrientation + @abstract 预览视图的方向。 + + @since v1.3.0 + */ +typedef enum { + PLSPreviewOrientationPortrait = 0, + PLSPreviewOrientationPortraitUpsideDown = 1, + PLSPreviewOrientationLandscapeRight = 2, + PLSPreviewOrientationLandscapeLeft = 3, +} PLSPreviewOrientation; + +/*! + @typedef PLSVideoRecoderRateType + @abstract 视频拍摄速率。 + + @since v1.4.0 + */ +typedef enum { + /** + @brief Maintains the video recoder rate normal, 1x + */ + PLSVideoRecoderRateNormal = 0, + + /** + @brief Maintains the video recoder rate slow, 0.667x + */ + PLSVideoRecoderRateSlow, + + /** + @brief Maintains the video recoder rate very slow, 0.5x + */ + PLSVideoRecoderRateTopSlow, + + /** + @brief Maintains the video recoder rate fast, 1.5x + */ + PLSVideoRecoderRateFast, + + /** + @brief Maintains the video recoder rate very fast, 2x + */ + PLSVideoRecoderRateTopFast + +} PLSVideoRecoderRateType; + +#pragma mark - Audio SampleRate + +/*! + @typedef PLSAudioSampleRate + @abstract 音频编码采样率。 + + @discussion 音频编码采样率 和 音频编码的码率直接相关。下表为码率推荐表: + + |================================================================|
+ | 采样率 Hz | 推荐码率(单声道)bps | 推荐码率 (双声道) bps |
+ |================================================================|
+ | 48000 | 64*1000 | 128*1000 |
+ |----------------------------------------------------------------|
+ | 44100 | 64*1000 | 128*1000 |
+ |----------------------------------------------------------------|
+ | 22050 | 32*1000 | 64*1000 |
+ |----------------------------------------------------------------|
+ | 16000 | 32*1000 | 64*1000 |
+ |----------------------------------------------------------------|
+ | 11025 | 32*1000 | 32*1000 |
+ |----------------------------------------------------------------|
+ 更多详细的码率设置,可以参考如下网页: + http://wiki.hydrogenaud.io/index.php?title=Fraunhofer_FDK_AAC#Bitrate_Modes + + @since v1.0.0 + */ +typedef enum { + /** + @brief PLSAudioSampleRate_48000Hz 48000Hz 音频编码采样率 + */ + PLSAudioSampleRate_48000Hz = 48000, + + /** + @brief PLSAudioSampleRate_44100Hz 44100Hz 音频编码采样率 + */ + PLSAudioSampleRate_44100Hz = 44100, + + /** + @brief PLSAudioSampleRate_22050Hz 22050Hz 音频编码采样率 + */ + PLSAudioSampleRate_22050Hz = 22050, + + /** + @brief PLSAudioSampleRate_16000Hz 16000Hz 音频编码采样率 + + @since v1.16.0 + */ + PLSAudioSampleRate_16000Hz = 16000, + + /** + @brief PLSAudioSampleRate_11025Hz 11025Hz 音频编码采样率 + */ + PLSAudioSampleRate_11025Hz = 11025, + +} PLSAudioSampleRate; + +#pragma mark - Audio BitRate + +/*! + @typedef PLSAudioBitRate + @abstract 音频编码码率。 + + @since v1.0.0 + */ +typedef enum { + + /** + @brief PLSAudioBitRate_32Kbps 32Kbps 音频码率 + + @since v1.16.0 + */ + PLSAudioBitRate_32Kbps = 32000, + + /** + @brief PLSAudioBitRate_64Kbps 64Kbps 音频码率 + */ + PLSAudioBitRate_64Kbps = 64000, + + /** + @brief PLSAudioBitRate_96Kbps 96Kbps 音频码率 + */ + PLSAudioBitRate_96Kbps = 96000, + + /** + @brief PLSAudioBitRate_128Kbps 128Kbps 音频码率 + */ + PLSAudioBitRate_128Kbps = 128000, + + /** + @brief PLSAudioBitRate_192Kbps 192Kbps 音频码率 + */ + PLSAudioBitRate_192Kbps = 192000, + + /** + @brief PLSAudioBitRate_256Kbps 256Kbps 音频码率 + + @since v1.16.0 + */ + PLSAudioBitRate_256Kbps = 256000, + +} PLSAudioBitRate; + +#pragma mark - Video File Type + +/*! + @typedef PLSFileType + + @abstract 视频格式 + + @since v1.0.5 + */ +typedef enum { + PLSFileTypeMPEG4, // .mp4 + PLSFileTypeQuickTimeMovie, // .mov + PLSFileTypeM4A, // .m4a +} PLSFileType; + +#pragma mark - Video File Preset + +/*! + @typedef PLSFilePreset + + @abstract 视频分辨率 + + @since v1.0.5 + */ +typedef enum { + PLSFilePresetLowQuality, + PLSFilePresetMediumQuality, + PLSFilePresetHighestQuality, + PLSFilePreset640x480, + PLSFilePreset960x540, + PLSFilePreset1280x720, + PLSFilePreset1920x1080, +} PLSFilePreset; + +#pragma mark - Video File Transition Animation + +/*! + @typedef PLSTransitionType + + @abstract 视频转场动画效果 + + @since v1.7.0 + */ +typedef enum { + PLSTransitionTypeFade = 0, // 淡入淡出 +} PLSTransitionType; + +/*! + @typedef PLSComposerPriorityType + + @abstract 多个视频拼接的时候,采用的拼接策略: 由于视频文件的音频通道和视频通道时长不一定相等(其实总是不相等,只是相差时间很短), + 在多个视频拼接为一个视频的时候,音视频通道的总时长相差会变大,这可能不是开发者想要的结果。因此提供几种模式供开发者选择 + + @since v1.14.0 + */ +typedef enum { + + /** + @brief 以拼接之后,单个视频时间段内音视频同步优先,这是默认模式:这种模式的好处是无论拼接多少个文件,总是能保证拼 + 接后的文件音视频是同步的,不好之处是拼接处可能会有音频的卡顿 + */ + PLSComposerPriorityTypeSync = 0, + + /** + @brief 以拼接之后,音视频播放连续性优先:这种模式的好处是无论拼接多少个文件,总是能保证拼接后的文件播放是流畅的, + 不好之处是可能引起音视频不同步 + */ + PLSComposerPriorityTypeSmooth, + + /** + @brief 以拼接的文件视频通道长度为准,当参与拼接文件的音频通道时长比视频通道时长长的时候,将多出的音频数据丢弃掉。 + 当视音频通道时长比视频通道时长短的视频,则将音频通道补齐和视频通道一样长。当一段视频中,音频数据和视频数据时长相 + 差较大(超过 0.1 秒)时,不建议使用这种模式 + + @since v1.16.0 + */ + PLSComposerPriorityTypeVideo, + + /** + @brief 以拼接的文件音频通道长度为准,当参与拼接文件的视频通道时长比音频通道时长长的时候,将多出的视频数据丢弃掉。 + 当视频通道时长比音频通道时长短的视频,则将视频通道补齐和音频通道一样长。当一段视频中,音频数据和视频数据时长相差 + 较大(超过 0.1 秒)时,不建议使用这种模式 + + @since v1.16.0 + */ + PLSComposerPriorityTypeAudio, +} PLSComposerPriorityType; + +/*! + @typedef PLSWaterMarkType + + @abstract 水印的类型 + + @since v1.15.0 + */ +typedef enum { + + // 静态水印,比如:PNG、JPG 等静态图片 + PLSWaterMarkTypeStatic = 0, + + // GIF 水印 + PLSWaterMarkTypeGif, +} PLSWaterMarkType; + +/*! + @typedef PLSMediaType + + @abstract 媒体类型 + + @since v1.16.0 + */ +typedef enum { + + // 图片 + PLSMediaTypeImage = 0, + // 视频 + PLSMediaTypeVideo, + // GIF + PLSMediaTypeGIF, +} PLSMediaType; + + +/*! + @typedef PLShortVideoLogLevel + @abstract 短视频日志级别。 + @since v2.1.0 + */ +typedef enum { + // No logs + PLShortVideoLogLevelOff = 0, + // Error logs only + PLShortVideoLogLevelError, + // Error and warning logs + PLShortVideoLogLevelWarning, + // Error, warning and info logs + PLShortVideoLogLevelInfo, + // Error, warning, info and debug logs + PLShortVideoLogLevelDebug, + // Error, warning, info, debug and verbose logs + PLShortVideoLogLevelVerbose, +} PLShortVideoLogLevel; + + +/*! + @typedef PLSAuthenticationResult + @abstract SDK 授权状态查询。 + @since v1.16.1 + */ +typedef enum { + // 还没有确定是否授权 + PLSAuthenticationResultNotDetermined = 0, + // 未授权 + PLSAuthenticationResultDenied, + // 已成功 + PLSAuthenticationResultAuthorized +} PLSAuthenticationResult; + +#endif + + diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h new file mode 100644 index 00000000..7ecb4a55 --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h @@ -0,0 +1,110 @@ +// +// PLSUploaderConfiguration.h +// PLShortVideoKit +// +// Created by 何昊宇 on 2017/6/8. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import + +/*! + @class PLSUploaderConfiguration + @brief 上传的参数配置类 + */ +@interface PLSUploaderConfiguration : NSObject + +/*! + @property token + @brief 上传视频空间 token + + @since v1.0.4 + */ +@property (nonatomic, strong)NSString * _Nonnull token; + +/*! + @property videoKey + @brief 上传视频空间设置的 key,默认为当前上传视频文件的 hash 值 + + @since v1.0.4 + */ +@property (nonatomic, strong)NSString * _Nullable videoKey; + +/*! + @property https + @brief 上传视频空间是否需要设置为 https 上传, YES 为 https 上传,NO 为 http 上传,默认为 YES + + @since v1.0.4 + */ +@property (nonatomic, assign, getter=isHttps)BOOL https; + +/*! + @property recorder + @brief 断点续传文件记录 + @discussion 默认为 Documents 下 PLShortVideoUploaderRecorder, 即:Documents/PLShortVideoUploaderRecorder + @warning 断点续上传要求:1 文件本身内容不发生变化 + 3 上传视频空间设置的 key , 即 videoKey 与 recorder 中一致 + 4 上传到的 bucket 为原 bucket + + @since v1.0.5 + */ +@property (nonatomic, strong)NSString * _Nullable recorder; + +/*! + @property params + @brief 上传视频空间设置的 key,默认为当前上传视频文件的 hash 值 + + @since v1.0.4 + */ +@property (nonatomic, strong)NSDictionary * _Nullable params; + +/*! + @method initWithToken:videoKeyhttps:recorder + @abstract PLSUploaderConfiguration 初始化方法 + @warning token 必填,不能为空 + + @param token 上传的 token 值 + @param videoKey 上传的 key 值 + @param https 是否使用 https 上传 + @param recorder 断点记录 + + @return PLSUploaderConfiguration 实例 + @since v1.0.4 + */ +- (instancetype _Nullable)initWithToken:(NSString * _Nonnull)token + videoKey:(NSString * _Nullable)videoKey + https:(BOOL)https + recorder:(NSString * _Nullable)recorder; +/*! + @method defaultWithToken: + @abstract 使用默认配置生成一个 PLSUploaderConfiguration 对象 + @discussion 调用此方法,除 token 之外,其他值均为默认值 + + @param token 上传的 token 值 + + @return PLSUploaderConfiguration 实例 + @since v1.0.4 + */ ++ (instancetype _Nullable)defaultWithToken:(NSString * _Nonnull)token; + +/*! + @method initWithToken:videoKey:https:recorder:params + @abstract PLSUploaderConfiguration 初始化方法 + @warning token 必填,不能为空 + + @param token 上传的 token 值 + @param videoKey 上传的 key 值 + @param https 是否使用 https 上传 + @param recorder 断点记录 + @param params 上传参数 + + @return PLSUploaderConfiguration 实例 + @since v1.0.4 + */ +- (instancetype _Nullable)initWithToken:(NSString * _Nonnull)token + videoKey:(NSString * _Nullable)videoKey + https:(BOOL)https + recorder:(NSString * _Nullable)recorder + params:(NSDictionary * _Nullable)params; + +@end diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h new file mode 100644 index 00000000..7e5c69fe --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h @@ -0,0 +1,124 @@ +// +// PLSUploaderResponInfo.h +// PLShortVideoKit +// +// Created by 何昊宇 on 2017/6/8. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +/*! + @class PLSUploaderResponseInfo + @brief 上传完成的反馈信息 + */ +@interface PLSUploaderResponseInfo : NSObject +/*! + @property statusCode + @brief 状态码 + */ +@property (readonly) int statusCode; + +/*! + @property reqId + @brief 七牛服务器生成的请求ID,用来跟踪请求信息,如果使用过程中出现问题,请反馈此ID + */ +@property (nonatomic, copy, readonly) NSString * _Nullable reqId; + +/*! + @property xlog + @brief 七牛服务器内部跟踪记录 + */ +@property (nonatomic, copy, readonly) NSString * _Nullable xlog; + +/*! + @property xvia + @brief cdn服务器内部跟踪记录 + */ +@property (nonatomic, copy, readonly) NSString * _Nullable xvia; + +/*! + @property error + @brief 错误信息,出错时请反馈此记录 + */ +@property (nonatomic, copy, readonly) NSError * _Nullable error; + +/*! + @property host + @brief 服务器域名 + */ +@property (nonatomic, copy, readonly) NSString * _Nullable host; + +/*! + @property duration + @brief 请求消耗的时间,单位 秒 + */ +@property (nonatomic, readonly) double duration; + +/*! + @property serverIp + @brief 服务器IP + */ +@property (nonatomic, readonly) NSString * _Nullable serverIp; + +/*! + @property id + @brief 客户端id + */ +@property (nonatomic, readonly) NSString * _Nullable id; + +/*! + @property timeStamp + @brief 时间戳 + */ +@property (readonly) UInt64 timeStamp; + +/*! + @property canceled + @brief 是否取消 + */ +@property (nonatomic, readonly, getter=isCancelled) BOOL canceled; + +/*! + @property ok + @brief 成功的请求 + */ +@property (nonatomic, readonly, getter=isOK) BOOL ok; + +/*! + @property broken + @brief 是否网络错误 + */ +@property (nonatomic, readonly, getter=isConnectionBroken) BOOL broken; + +/*! + @property notQiniu + @brief 是否为 七牛响应 + */ +@property (nonatomic, readonly, getter=isNotQiniu) BOOL notQiniu; + +/*! + @method initWithStatusCode:reqId:xlog:xvia:error:host:duration:serverIp:id:timeStamp:canceled:ok:broken:notQiniu: + @abstract PLSUploaderResponInfo 初始化方法 + + @return PLSUploaderResponseInfo 实例 + @since v1.0.4 + */ + +- (instancetype _Nullable)initWithStatusCode:(int)statusCode + reqId:(NSString *_Nullable)reqId + xlog:(NSString *_Nullable)xlog + xvia:(NSString *_Nullable)xvia + error:(NSError *_Nullable)error + host:(NSString *_Nullable)host + duration:(double)duration + serverIp:(NSString *_Nullable)serverIp + id:(NSString *_Nullable)id + timeStamp:(UInt64)timeStamp + canceled:(BOOL)canceled + ok:(BOOL)ok + broken:(BOOL)broken + notQiniu:(BOOL)notQiniu; + + + +@end diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h new file mode 100644 index 00000000..93bf371a --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h @@ -0,0 +1,138 @@ +// +// PLSVideoConfiguration.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/1. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import + +/*! + @class PLSVideoConfiguration + @brief 采集和录制文件编码视频参数配置类 + + @since v1.0.0 + */ +@interface PLSVideoConfiguration : NSObject + +/*! + @property videoFrameRate + @brief 采集的视频数据的帧率,默认为 25 + + @since v1.0.0 + */ +@property (assign, nonatomic) NSUInteger videoFrameRate; + +/*! + @property sessionPreset + @brief 采集的视频的 sessionPreset,默认为 AVCaptureSessionPreset1280x720 + + @since v1.0.0 + */ +@property (strong, nonatomic) NSString *sessionPreset; + +/*! + @property previewMirrorFrontFacing + @brief 前置预览是否开启镜像,默认为 YES + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL previewMirrorFrontFacing; + +/*! + @property previewMirrorRearFacing + @brief 后置预览是否开启镜像,默认为 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL previewMirrorRearFacing; + +/*! + @property streamMirrorFrontFacing + @brief 前置摄像头,录制的流是否开启镜像,默认 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL streamMirrorFrontFacing; + +/*! + @property streamMirrorRearFacing + @brief 后置摄像头,录制的流是否开启镜像,默认 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL streamMirrorRearFacing; + +/*! + @property position + @brief 开启 camera 时的采集摄像头位置,默认为 AVCaptureDevicePositionBack + + @since v1.0.0 + */ +@property (assign, nonatomic) AVCaptureDevicePosition position; + +/*! + @property videoOrientation + @brief 开启 camera 时的采集摄像头的旋转方向,默认为 AVCaptureVideoOrientationPortrait + + @since v1.0.0 + */ +@property (assign, nonatomic) AVCaptureVideoOrientation videoOrientation; + +/*! + @property videoSize + @abstract 编码时的视频分辨率,默认 (480, 854) + + @discussion 需要注意的是,这个参数影响的是视频编码时的分辨率,而非摄像头采集到数据的预览大小,传递给编码器的图像尺寸与此尺寸不同时,会按照 AVVideoScalingModeResizeAspectFill + 对图像做剪切,从而确保图像不会出现压缩的现象。 + + @since v1.0.0 + */ +@property (assign, nonatomic) CGSize videoSize; + +/*! + @property averageVideoBitRate + @abstract 平均视频编码码率。默认为 1024*1000 + + @discussion 单位为 bps(Bits per Second)。该参数的视频编码实际过程中,并不是恒定的数值,所以只能设定平均视频编码码率。 + + @since v1.0.0 + */ +@property (nonatomic, assign) NSUInteger averageVideoBitRate; + +/*! + @property videoMaxKeyframeInterval + @abstract 视频编码关键帧最大间隔(GOP)。 + + @discussion h.264 编码时,两个关键帧之间间隔的最多的帧数,一般为 fps 的两倍或者三倍。默认为 2*fps + + @since v1.0.0 + */ +@property (nonatomic, assign) NSUInteger videoMaxKeyframeInterval; + +/*! + @property videoProfileLevel + @abstract H.264 编码时使用的 Profile Level。 + + @discussion 默认情况下使用 AVVideoProfileLevelH264HighAutoLevel,如果对于视频编码有额外的需求并且知晓该参数带来的影响可以自行更改。 + + @warning 当你不清楚该参数更改对分辨率要求,码率等影响时,请不要随意更改。 + + @since v1.0.0 + */ +@property (nonatomic, copy) NSString *videoProfileLevel; + +/*! + @method defaultConfiguration + @brief 创建一个默认配置的 PLSVideoConfiguration 实例. + + @return 创建的默认 PLSVideoConfiguration 对象 + + @since v1.0.0 + */ ++ (instancetype)defaultConfiguration; + +@end diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h new file mode 100644 index 00000000..b278e7b7 --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h @@ -0,0 +1,242 @@ +// +// PLShortVideoEditor.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/7/10. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import "PLSEditPlayer.h" + +@class PLShortVideoEditor; +/*! + @protocol PLShortVideoEditorDelegate + @brief 视频编辑协议 + */ +@protocol PLShortVideoEditorDelegate + +@optional + +/*! + @method shortVideoEditor:didGetOriginPixelBuffer: + @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param editor PLShortVideoEditor 实例 + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef + + @since v1.5.0 + */ +- (CVPixelBufferRef)shortVideoEditor:(PLShortVideoEditor *)editor didGetOriginPixelBuffer:(CVPixelBufferRef)pixelBuffer __deprecated_msg("Method deprecated in v1.9.0. Use `shortVideoEditor: didGetOriginPixelBuffer: timestamp:`"); + +/*! + @method shortVideoEditor:didGetOriginPixelBuffer:timestamp + @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param editor PLShortVideoEditor 实例 + @param timestamp 视频帧的时间戳 + + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef + + @since v1.9.0 + */ +- (CVPixelBufferRef)shortVideoEditor:(PLShortVideoEditor *)editor didGetOriginPixelBuffer:(CVPixelBufferRef)pixelBuffer timestamp:(CMTime)timestamp; + +/*! + @method shortVideoEditor:didReadyToPlayForAsset:timeRange + @brief 当前视频的播放时刻达到了视频开头 + + @param editor PLShortVideoEditor 实例 + @param asset 当前视频 + @param timeRange 当前视频的有效视频区域,对应 PLShortVideoEditor 的属性 @property (assign, nonatomic) CMTimeRange timeRange + + @since v1.9.0 + */ +- (void)shortVideoEditor:(PLShortVideoEditor *)editor didReadyToPlayForAsset:(AVAsset *)asset timeRange:(CMTimeRange)timeRange; + +/*! + @method shortVideoEditor:didReachEndForAsset:timeRange + @brief 当前视频的播放时刻达到了视频结尾 + + @param editor PLShortVideoEditor 实例 + @param asset 当前视频 + @param timeRange 当前视频的有效视频区域,对应 PLShortVideoEditor 的属性 @property (assign, nonatomic) CMTimeRange timeRange + + @since v1.9.0 + */ +- (void)shortVideoEditor:(PLShortVideoEditor *)editor didReachEndForAsset:(AVAsset *)asset timeRange:(CMTimeRange)timeRange; + +@end + +/*! + @class PLShortVideoEditor + @brief 视频编辑类 + + @since v1.1.0 + */ +@interface PLShortVideoEditor : NSObject + +/*! + @property completionBlock + @brief 编辑完成时的 block 回调 + + @since v1.1.0 + */ +@property (copy, nonatomic) void(^completionBlock)(NSURL *url); + +/*! + @property delegate + @brief 类型的代理 + + @since v1.5.0 + */ +@property (weak, nonatomic) id delegate; + +/*! + @property previewView + @brief 编辑时的预览视图 + + @since v1.5.0 + */ +@property (strong, nonatomic, readonly) UIView *previewView; + +/*! + @property fillMode + @brief 预览视图的填充方式 + + @since v1.1.0 + */ +@property (assign, nonatomic) PLSVideoFillModeType fillMode; + +/*! + @property loopEnabled + @brief 循环播放。设置为 YES,表示单曲循环。默认为 NO + + @since v1.5.0 + */ +@property (assign, nonatomic) BOOL loopEnabled; + +/*! + @property isEditing + @brief 处于编辑状态时为 YES + + @since v1.9.0 + */ +@property (assign, nonatomic, readonly) BOOL isEditing; + +/*! + @property timeRange + @brief 播放文件的 timeRange 范围内 [start, duration] 片段 + + @since v1.5.0 + */ +@property (assign, nonatomic) CMTimeRange timeRange; + +/*! + @property videoSize + @brief 通过该参数可以设置视频的预览分辨率 + + @since v1.5.0 + */ +@property (assign, nonatomic) CGSize videoSize; + +/*! + @property volume + @brief 原视频的音量 + + @since v1.5.0 + */ +@property (assign, nonatomic, readwrite) CGFloat volume; + +/*! + @method initWithURL: + @brief 使用 NSURL 初始化编辑实例 + + @return PLShortVideoEditor 实例 + @since v1.1.0 + */ +- (instancetype)initWithURL:(NSURL *)url; + +/*! + @method initWithAsset: + @brief 使用 AVAsset 初始化编辑实例 + + @return PLShortVideoEditor 实例 + @since v1.1.0 + */ +- (instancetype)initWithAsset:(AVAsset *)asset; + +/*! + @method initWithAsset:videoSize + @brief 使用 AVAsset 初始化编辑实例 + + @param asset 原视频,即被编辑的视频素材 + @param videoSize 编辑时的预览分辨率,当取值为 CGSizeZero 时,预览分辨率为原视频的分辨率,当取值为(width, height)时,预览分辨率为(width, height) + + @return PLShortVideoEditor 实例 + @since v1.5.0 + */ +- (instancetype)initWithAsset:(AVAsset *)asset videoSize:(CGSize)videoSize; + +/*! + @method initWithPlayerItem:videoSize + @brief 使用 AVPlayerItem 初始化编辑实例 + + @param playerItem 原视频,即被编辑的视频素材 + @param videoSize 编辑时的预览分辨率,当取值为 CGSizeZero 时,预览分辨率为原视频的分辨率,当取值为(width, height)时,预览分辨率为(width, height) + + @return PLShortVideoEditor 实例 + @since v1.11.0 + */ +- (instancetype)initWithPlayerItem:(AVPlayerItem *)playerItem videoSize:(CGSize)videoSize; + +/*! + @method startEditing + @brief 加载编辑信息,实时预览编辑效果 + + @since v1.1.0 + */ +- (void)startEditing; + +/*! + @method stopEditing + @brief 停止实时预览编辑效果 + + @since v1.1.0 + */ +- (void)stopEditing; + +/*! + @method replaceCurrentAssetWithAsset: + @brief 替换当前的 AVAsset 对象 + + @param asset 原视频,即被编辑的视频素材 + + @since v1.5.0 + */ +- (void)replaceCurrentAssetWithAsset:(AVAsset *)asset; + +/*! + @method currentTime + @brief 获取当前播放时刻 + + @return 当前播放的时刻 + @since v1.9.0 + */ +- (CMTime)currentTime; + +/*! + @method seekToTime:completionHandler + @brief seek 到视频的 time 时刻 + + @param time seek 的时间点 + @param completionHandler seek 操作完成的回调 + + @since v1.9.0 + */ +- (void)seekToTime:(CMTime)time completionHandler:(void (^)(BOOL finished))completionHandler; +@end + + diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoKit.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoKit.h new file mode 100644 index 00000000..7add2e73 --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoKit.h @@ -0,0 +1,33 @@ +// +// PLShortVideoKit.h +// PLShortVideoKit +// +// Created by hxiongan on 2019/3/13. +// Copyright © 2019年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import + +//! Project version number for PLShortVideoKit. +FOUNDATION_EXPORT double PLShortVideoKitVersionNumber; + +//! Project version string for PLShortVideoKit. +FOUNDATION_EXPORT const unsigned char PLShortVideoKitVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h new file mode 100644 index 00000000..8b734ecf --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h @@ -0,0 +1,68 @@ +// +// PLShortVideoKitEnv.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/11/27. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLShortVideoKitEnv + @brief 初始化 ShortVideoKit 运行环境 + */ +@interface PLShortVideoKitEnv : NSObject + +/*! + @method initEnv + @brief 初始化 ShortVideoKit 的运行环境,需要在 -application:didFinishLaunchingWithOptions: 方法下调用该方法, + + @warning 不调用该方法将导致 PLShortVideoKitEnv 对象无法初始化 + */ ++(void)initEnv; + +/*! + @method isInited + @brief 判断当前环境是否已经初始化 + + @return 已初始化返回 YES,否则为 NO + */ ++(BOOL)isInited; + +/*! + @method enableFileLogging + @abstract 开启SDK内部写文件日志功能,以方便SDK支持团队定位您所遇到的问题。 + + @note 日志文件存放位置为 App Container/Library/Caches/Pili-ShortVideo/Logs + */ ++ (void)enableFileLogging; + +/*! + @method setLogLevel: + @abstract 设置SDK内部输出日志的级别,默认为 PLShortVideoLogLevelWarning 级别。该方法设置的输出级别会分别同步到控制台与文件日志中。 + + @warning 请确保不要在线上产品开启 PLShortVideoLogLevelVerbose 级别输出,这将影响产品性能。 + */ ++ (void)setLogLevel:(PLShortVideoLogLevel)logLevel; + +/*! + @method deviceID + @brief 获取设备 ID. 默认为 UUID + + @return 返回当前设备 ID + */ ++ (NSString *)deviceID; + +/*! + @method setDeviceID: + @brief 设置设备 ID + + @param deviceID 设备 ID + + */ ++ (void)setDeviceID:(NSString *)deviceID; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h similarity index 72% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h rename to Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h index caa3a3b0..b8f01fbf 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h @@ -14,86 +14,142 @@ #import "PLSTypeDefines.h" @class PLShortVideoRecorder; + +/*! + @protocol PLShortVideoRecorderDelegate + @brief 短视频录制协议 + + @since v1.0.0 + */ @protocol PLShortVideoRecorderDelegate @optional #pragma mark -- 摄像头/麦克风权限变化的回调 -/** +/*! + @method shortVideoRecorder:didGetCameraAuthorizationStatus: @abstract 摄像头授权状态发生变化的回调 + @param recorder PLShortVideoRecorder 实例 + @param status 相机授权状态 + @since v1.0.0 */ - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didGetCameraAuthorizationStatus:(PLSAuthorizationStatus)status; -/** +/*! + @method shortVideoRecorder:didGetMicrophoneAuthorizationStatus: @abstract 麦克风授权状态发生变化的回调 + @param recorder PLShortVideoRecorder 实例 + @param status 麦克风授权状态 + @since v1.0.0 */ - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didGetMicrophoneAuthorizationStatus:(PLSAuthorizationStatus)status; #pragma mark -- 摄像头对焦位置的回调 -/** +/*! + @method shortVideoRecorderDidFocusAtPoint: @abstract 摄像头对焦位置的回调 + @param point 相机当前焦点 + @since v1.6.0 */ - (void)shortVideoRecorderDidFocusAtPoint:(CGPoint)point __deprecated_msg("Method deprecated in v1.9.0. Use `shortVideoRecorder: didFocusAtPoint:`");; -/** +/*! + @method shortVideoRecorder:didFocusAtPoint: @abstract 摄像头对焦位置的回调 + @param recorder PLShortVideoRecorder 实例 + @param point 相机当前焦点 + @since v1.9.0 */ - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didFocusAtPoint:(CGPoint)point; #pragma mark -- 摄像头/麦克风采集数据的回调 -/** +/*! + @method shortVideoRecorder:pixelBuffer: @abstract 获取到摄像头原数据时的回调, 便于开发者做滤镜等处理,需要注意的是这个回调在 camera 数据的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 + @param recorder PLShortVideoRecorder 实例 + @param pixelBuffer 视频帧数据 + @since v1.0.0 */ - (CVPixelBufferRef __nonnull)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder cameraSourceDidGetPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer; -/** +/*! + @method shortVideoRecorder:microphoneSourceDidGetSampleBuffer: @abstract 获取到麦克风原数据时的回调,需要注意的是这个回调在 microphone 数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题 + @param recorder PLShortVideoRecorder 实例 + @param sampleBuffer 音频帧数据 + @since v1.0.1 */ - (CMSampleBufferRef __nonnull)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder microphoneSourceDidGetSampleBuffer:(CMSampleBufferRef __nonnull)sampleBuffer; #pragma mark -- 视频录制动作的回调 -/** +/*! + @method shortVideoRecorder:didStartRecordingToOutputFileAtURL: @abstract 开始录制一段视频时 + @param recorder PLShortVideoRecorder 实例 + @param fileURL 录制文件的存放地址 + @since v1.0.0 */ - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didStartRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL; -/** +/*! + @method shortVideoRecorder:didRecordingToOutputFileAtURL:fileDuration:totalDuration: @abstract 正在录制的过程中。在完成该段视频录制前会一直回调,可用来更新所有视频段加起来的总时长 totalDuration UI。 + @param recorder PLShortVideoRecorder 实例 + @param fileURL 当前正在录制的文件存放地址 + @param fileDuration 当前正在录制的文件时长 + @param totalDuration 所有录制文件的总时长 + @since v1.0.0 */ - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; -/** +/*! + @method shortVideoRecorder:didDeleteFileAtURL:fileDuration:totalDuration: @abstract 删除了某一段视频 + @param recorder PLShortVideoRecorder 实例 + @param fileURL 当前删除的文件存放地址 + @param fileDuration 当前删除的文件时长 + @param totalDuration 删除当前文件之后剩余录制文件的总时长 + @since v1.0.0 */ - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didDeleteFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; -/** +/*! + @method shortVideoRecorder:didFinishRecordingToOutputFileAtURL:fileDuration:totalDuration: @abstract 完成一段视频的录制时 + @param recorder PLShortVideoRecorder 实例 + @param fileURL 当前录制完成的文件存放地址 + @param fileDuration 当前录制完成的文件时长 + @param totalDuration 所有录制文件的总时长 + @since v1.0.0 */ - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didFinishRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; -/** +/*! + @method shortVideoRecorder:didFinishRecordingMaxDuration: @abstract 在达到指定的视频录制时间 maxDuration 后,如果再调用 [PLShortVideoRecorder startRecording],那么会立即执行该回调。该回调功能是用于页面跳转 + @param recorder PLShortVideoRecorder 实例 + @param maxDuration 设置的最大录制时长 + @since v1.0.0 */ - (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didFinishRecordingMaxDuration:(CGFloat)maxDuration; @@ -102,64 +158,76 @@ #pragma mark - basic -/** - * @abstract 短视频录制的核心类。 - * - * @discussion 一个 PLShortVideoRecorder 实例会包含了对视频源、音频源的控制,并且对流的操作及流状态的返回都是通过它来完成的。 +/*! + @class PLShortVideoRecorder + @abstract 短视频录制的核心类。 + + @discussion 一个 PLShortVideoRecorder 实例会包含了对视频源、音频源的控制,并且对流的操作及流状态的返回都是通过它来完成的。 */ @interface PLShortVideoRecorder : NSObject -/** - @brief 返回代表当前会话的所有视频段文件的 asset +/*! + @method assetRepresentingAllFiles + @brief 获取代表当前会话的所有视频段文件的 asset + @return 返回代表当前会话的所有视频段文件的 asset @since v1.0.0 */ - (AVAsset *__nonnull)assetRepresentingAllFiles; -/** +/*! + @property maxDuration @brief 视频录制的最大时长,单位为秒。默认为10秒 @since v1.0.0 */ @property (assign, nonatomic) CGFloat maxDuration; -/** +/*! + @property minDuration @brief 视频录制的最短时间,单位为秒。默认为2秒 @since v1.0.0 */ @property (assign, nonatomic) CGFloat minDuration; -/** +/*! + @property videoConfiguration @brief 视频配置,只读 @since v1.0.0 */ @property (strong, nonatomic, readonly) PLSVideoConfiguration *__nonnull videoConfiguration; -/** +/*! + @property audioConfiguration @brief 音频配置,只读 @since v1.0.0 */ @property (strong, nonatomic, readonly) PLSAudioConfiguration *__nonnull audioConfiguration; -/** +/*! + @property previewView @brief 摄像头的预览视图 @since v1.0.0 */ @property (strong, nonatomic, readonly) UIView *__nullable previewView; -/** +/*! + @property adaptationRecording @brief 根据设备的方向自动确定竖屏、横屏拍摄。默认为 NO,不启用自动确定 @since v1.3.0 */ @property (assign, nonatomic) BOOL adaptationRecording; -/** - @brief 当 adaptationRecording 为YES时,获取设备方向的回调 deviceOrientationBlock 才有效。 +/*! + @property deviceOrientation + @brief 获取当前设备的旋转方向 + + @discussion 当 adaptationRecording 为YES时,获取设备方向的回调 deviceOrientationBlock 才有效。 拍摄时可根据 deviceOrientation 做 UI 效果来标明当前拍摄的方向是竖屏还是横屏。 PLSPreviewOrientationPortrait 竖屏拍摄 PLSPreviewOrientationPortraitUpsideDown 倒立拍摄 @@ -170,14 +238,15 @@ */ @property (copy, nonatomic) void(^ _Nullable deviceOrientationBlock)(PLSPreviewOrientation deviceOrientation); -/** +/*! + @property delegate @brief 代理对象 @since v1.0.0 */ @property (weak, nonatomic) id __nullable delegate; -/** +/*! @property delegateQueue @abstract 触发代理对象回调时所在的任务队列。 @@ -191,117 +260,79 @@ */ @property (strong, nonatomic) dispatch_queue_t __nullable delegateQueue; -/** +/*! + @property fillMode @brief previewView 中视频的填充方式,默认使用 PLVideoFillModePreserveAspectRatioAndFill @since v1.0.0 */ @property (readwrite, nonatomic) PLSVideoFillModeType fillMode; -/** +/*! + @property isRecording @brief PLShortVideoRecorder 处于录制状态时为 true @since v1.0.0 */ @property (readonly, nonatomic) BOOL isRecording; -/** +/*! + @property captureEnabled @brief 是否开启音视频采集 @since v1.2.0 */ @property (assign, nonatomic, readonly) BOOL captureEnabled; -/** - @brief 视频拍摄速率值,默认使用 PLSVideoRecoderRateNormal,isRecording 为 YES 时,设置该值无效 - - @since v1.4.0 - */ -@property (readwrite, nonatomic) PLSVideoRecoderRateType recoderRate; - -/** +/*! + @property outputFileType @brief 视频的文件类型,默认为 PLSFileTypeMPEG4(.mp4) @since v1.6.0 */ @property (assign, nonatomic) PLSFileType outputFileType; -/** - @brief 指定捕捉某个 View 的画面,将 View 画面录制为视频 - - @since v1.11.0 - */ -@property (strong, nonatomic) UIView *_Nullable catpuredView; - -/** - @brief 指定捕捉某个 View 的画面,将 View 画面录制为视频时的初始化方法 - - @since v1.11.0 - - @discussion catpuredViewVideoConfiguration 必须要设置,用来配置视频信息。 - audioConfiguration 设置为 nil 时,不采集音频。 - */ - -- (nonnull instancetype)initWithCatpuredViewVideoConfiguration:(PLSVideoConfiguration *_Nonnull)catpuredViewVideoConfiguration audioConfiguration:(PLSAudioConfiguration *_Nullable)audioConfiguration; - -/** +/*! + @method initWithVideoConfiguration:audioConfiguration: @abstract 初始化方法 - @since v1.0.0 - @discussion videoConfiguration 设置为 nil 时,不采集视频。 audioConfiguration 设置为 nil 时,不采集音频。 - */ -- (nonnull instancetype)initWithVideoConfiguration:(PLSVideoConfiguration *_Nullable)videoConfiguration audioConfiguration:(PLSAudioConfiguration *_Nullable)audioConfiguration; - -/** - @abstract 初始化方法 - - @since v1.2.0 - @discussion 是否使用 SDK 内部的音视频采集,默认为 YES,当设置为 NO 时,可通过以下两个接口导入音视频数据 - - (void)writePixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer timeStamp:(CMTime)timeStamp; - - (void)writeAudioBuffer:(AudioBuffer *_Nonnull)audioBuffer asbd:(AudioStreamBasicDescription *_Nonnull)asbd timeStamp:(CMTime)timeStamp; - */ -- (nonnull instancetype)initWithVideoConfiguration:(PLSVideoConfiguration *__nonnull)videoConfiguration audioConfiguration:(PLSAudioConfiguration *__nonnull)audioConfiguration captureEnabled:(BOOL)captureEnabled; - -/** - @abstract 写入视频数据,当 captureEnabled 为 NO 时,可通过该接口导入视频数据 - - @warning 目前仅支持 kCVPixelFormatType_32BGRA 格式的 pixelBuffer - - @since v1.2.0 - */ -- (void)writePixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer timeStamp:(CMTime)timeStamp; - -/** - @abstract 写入音频数据,当 captureEnabled 为 NO 时,可通过该接口导入音频数据 + @param videoConfiguration 视频采集和编码参数 + @param audioConfiguration 音频采集和编码参数 - @since v1.2.0 + @since v1.0.0 + @return 返回 PLShortVideoRecorder 实例 */ -- (void)writeSampleBuffer:(CMSampleBufferRef _Nonnull)sampleBuffer; +- (nonnull instancetype)initWithVideoConfiguration:(PLSVideoConfiguration *_Nullable)videoConfiguration audioConfiguration:(PLSAudioConfiguration *_Nullable)audioConfiguration; -/** +/*! + @method insertVideo: @abstract 插入视频,支持任意位置,通过该接口传入,成为 PLShortVideoRecorder 当前视频数组的下一个视频段 + @param videoURL 插入的视频存放地址 + @warning PLShortVideoRecorder 初始化后调用,当视频时长加上视频数组中的所有视频段时长,超过视频设置的最大时长 maxDuration 时,则传值无效 @since v1.7.0 */ - (void)insertVideo:(NSURL *_Nonnull)videoURL; -/** +/*! + @method startRecording @brief 开始录制视频,录制的视频的存放地址由 SDK 内部自动生成 @warning 获取所有录制的视频段的地址,可以使用 - (NSArray *__nullable)getAllFilesURL - @since v1.0.0 */ - (void)startRecording; -/** +/*! + @method startRecording: @brief 开始录制视频 + @param fileURL 录制的视频的存放地址,该参数可以在外部设置,录制的视频会保存到该位置 @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 @@ -311,58 +342,71 @@ */ - (void)startRecording:(NSURL *_Nonnull)fileURL; -/** +/*! + @method stopRecording @brief 停止录制视频 @since v1.0.0 */ - (void)stopRecording; -/** +/*! + @method cancelRecording @brief 取消录制会停止视频录制并删除已经录制的视频段文件 @since v1.0.0 */ - (void)cancelRecording; -/** +/*! + @method deleteLastFile @brief 删除上一个录制的视频段 @since v1.0.0 */ - (void)deleteLastFile; -/** +/*! + @method deleteAllFiles @brief 删除所有录制的视频段 @since v1.0.0 */ - (void)deleteAllFiles; -/** +/*! + @method getAllFilesURL @brief 获取所有录制的视频段的地址 + @return 返回当前录制完成的所有视频段地址 @since v1.0.0 */ - (NSArray *__nullable)getAllFilesURL; -/** +/*! + @method getFilesCount @brief 获取录制的视频段的总数目 + @return 返回当前录制完成的是视频段总数 @since v1.0.0 */ - (NSInteger)getFilesCount; -/** +/*! + @method getTotalDuration @brief 获取所有录制的视频段加起来的总时长 + @return 返回所有录制的视频段加起来的总时长 @since v1.0.0 */ - (CGFloat)getTotalDuration; -/** +/*! + @method getScreenShotWithCompletionHandler: @brief 实时截图, 异步返回截图结果 image. 在 handler 内部调用 self,请使用 __weak typeof(self) weakSelf = self, 避免循环引用, 因为 SDK 内部对 handle 执行了 copy 操作 + @param handler 截图完成的回调 + @since v1.9.0 */ - (void)getScreenShotWithCompletionHandler:(void(^_Nullable)(UIImage * _Nullable image))handler; @@ -371,9 +415,14 @@ #pragma mark - PLShortVideoRecorder (backgroundMonitor) +/*! + @category PLShortVideoRecorder (backgroundMonitor) + @brief 退后台的操作 + */ @interface PLShortVideoRecorder (backgroundMonitor) -/** +/*! + @property backgroundMonitorEnable @abstract 默认为 YES,即 SDK 内部根据监听到的 Application 前后台状态自动停止和开始录制视频 @warning 设置为 YES 时,即 Application 进入后台,若当前为拍摄视频状态,SDK 内部会自动停止视频的录制,恢复到前台,SDK 内部自动启动视频的录制; @@ -388,61 +437,9 @@ @end -#pragma mark -- PLShortVideoRecorder (mixAudio) - -@interface PLShortVideoRecorder (mixAudio) -/** - @abstract 设置录制时的背景音乐 - - @warning PLShortVideoRecorder 初始化后调用,audioURL 为音频 URL - - @since v1.7.0 - */ -- (void)mixAudio:(NSURL *_Nullable)audioURL; - -/** - @abstract 设置录制时的背景音乐 - - @warning PLShortVideoRecorder 初始化后调用,audioURL 为音频 URL - * - * @param audioURL 音频 URL - * @param playEnable 音频添加后是否立即播放 - * - @since v1.11.0 - */ -- (void)mixAudio:(NSURL *_Nullable)audioURL playEnable:(BOOL)playEnable; - -/** - @abstract 设置录制时的背景音乐 - - @warning PLShortVideoRecorder 初始化后调用,audioURL 为音频 URL - * - * @param audioURL 音频 URL - * @param startTime 音频开始播放的位置 - * @param volume 音频的音量 - * @param playEnable 音频添加后是否立即播放 - * - @since v1.11.0 - */ -- (void)mixAudio:(NSURL *_Nullable)audioURL startTime:(NSTimeInterval)startTime volume:(CGFloat)volume playEnable:(BOOL)playEnable; - -/** - @brief 获取添加背景音乐录制完成后的 audioMix - - @warning 设置背景音乐后有效 - * - * @param musicVolume 背景音乐音量,范围 0 ~ 1 - * @param videoVolume 原视频音量,范围 0 ~ 1 - * @param completionHandler 获取 composition 及 audioMix - * - @since v1.7.0 - */ -- (void)mixWithMusicVolume:(float)musicVolume videoVolume:(float)videoVolume completionHandler:(void (^_Nonnull)(AVMutableComposition * _Nullable composition, AVAudioMix * _Nullable audioMix, NSError * _Nullable error))completionHandler; -@end - #pragma mark - Category (Info) -/** +/*! @category PLShortVideoRecorder (Info) @abstract SDK 信息相关 @@ -454,14 +451,17 @@ @method versionInfo @abstract PLShortVideoRecorder 的 SDK 版本。 + @return 返回 SDK 版本信息 @since v1.0.0 */ + (NSString *__nonnull)versionInfo; /*! - @method check authentication + @method checkAuthentication: @abstract SDK 授权状态查询 + @param resultBlock 授权状态查询完成之后的回调 + @since v1.16.1 */ + (void)checkAuthentication:(void(^ __nonnull)(PLSAuthenticationResult result))resultBlock;; @@ -470,7 +470,7 @@ #pragma mark - Category (Dubber) -/** +/*! @category PLShortVideoRecorder (Dubber) @abstract 视频配音 @@ -478,9 +478,13 @@ */ @interface PLShortVideoRecorder (Dubber) -/** +/*! + @method mixAsset:timeRange: @brief 纯音频录制时,将录制的纯音频 AVAsset *audio = [self.recorder assetRepresentingAllFiles] 与 asset 混合。 + @param asset AVAsset 对象文件 + @param timeRange asset 的截取时间段 + @since v1.6.0 */ - (AVAsset *_Nullable)mixAsset:(AVAsset *_Nullable)asset timeRange:(CMTimeRange)timeRange; @@ -489,51 +493,55 @@ #pragma mark - Category (CameraSource) -/** - * @category PLShortVideoRecorder(CameraSource) - * - * @discussion 与摄像头相关的接口 +/*! + @category PLShortVideoRecorder(CameraSource) + @discussion 与摄像头相关的接口 @since v1.0.0 */ @interface PLShortVideoRecorder (CameraSource) -/** +/*! + @property captureSession @brief 只读变量,给有特殊需求的开发者使用 @since v1.15.0 */ @property (readonly, nonatomic) AVCaptureSession *_Nullable captureSession; -/** +/*! + @property captureDeviceInput @brief 视频采集输入源,只读变量,给有特殊需求的开发者使用 @since v1.11.1 */ @property (readonly, nonatomic) AVCaptureDeviceInput *_Nullable captureDeviceInput; -/** +/*! + @property captureDevicePosition @brief default as AVCaptureDevicePositionBack @since v1.0.0 */ @property (assign, nonatomic) AVCaptureDevicePosition captureDevicePosition; -/** +/*! + @property videoOrientation @brief 开启 camera 时的采集摄像头的旋转方向,默认为 AVCaptureVideoOrientationPortrait @since v1.0.0 */ @property (assign, nonatomic) AVCaptureVideoOrientation videoOrientation; -/** +/*! + @property torchOn @abstract default as NO. @since v1.0.0 */ @property (assign, nonatomic, getter=isTorchOn) BOOL torchOn; -/** +/*! @property continuousAutofocusEnable @abstract 手动对焦的视图动画。该属性默认开启。 @@ -541,7 +549,7 @@ */ @property (assign, nonatomic) BOOL innerFocusViewShowEnable; -/** +/*! @property continuousAutofocusEnable @abstract 连续自动对焦。该属性默认开启。 @@ -549,7 +557,7 @@ */ @property (assign, nonatomic, getter=isContinuousAutofocusEnable) BOOL continuousAutofocusEnable; -/** +/*! @property touchToFocusEnable @abstract 手动点击屏幕进行对焦。该属性默认开启。 @@ -557,123 +565,142 @@ */ @property (assign, nonatomic, getter=isTouchToFocusEnable) BOOL touchToFocusEnable; -/** +/*! @property smoothAutoFocusEnabled @abstract 该属性适用于视频拍摄过程中用来减缓因自动对焦产生的镜头伸缩,使画面不因快速的对焦而产生抖动感。该属性默认开启。 */ @property (assign, nonatomic, getter=isSmoothAutoFocusEnabled) BOOL smoothAutoFocusEnabled; -/** +/*! + @property focusPointOfInterest @abstract default as (0.5, 0.5), (0,0) is top-left, (1,1) is bottom-right. @since v1.0.0 */ @property (assign, nonatomic) CGPoint focusPointOfInterest; -/** +/*! + @property videoZoomFactor @abstract 默认为 1.0,设置的数值需要小于等于 videoActiveForat.videoMaxZoomFactor,如果大于会设置失败 @since v1.0.0 */ @property (assign, nonatomic) CGFloat videoZoomFactor; -/** +/*! + @property videoFormats @brief videoFormats @since v1.0.0 */ @property (strong, nonatomic, readonly) NSArray *__nonnull videoFormats; -/** +/*! + @property videoActiveFormat @brief videoActiveFormat @since v1.0.0 */ @property (strong, nonatomic) AVCaptureDeviceFormat *__nonnull videoActiveFormat; -/** +/*! + @property sessionPreset @brief 采集的视频的 sessionPreset,默认为 AVCaptureSessionPreset1280x720 @since v1.0.0 */ @property (strong, nonatomic) NSString *__nonnull sessionPreset; -/** +/*! + @property videoFrameRate @brief 采集的视频数据的帧率,默认为 25 @since v1.0.0 */ @property (assign, nonatomic) NSUInteger videoFrameRate; -/** +/*! + @property previewMirrorFrontFacing @brief 前置预览是否开启镜像,默认为 YES @since v1.0.0 */ @property (assign, nonatomic) BOOL previewMirrorFrontFacing; -/** +/*! + @property previewMirrorRearFacing @brief 后置预览是否开启镜像,默认为 NO @since v1.0.0 */ @property (assign, nonatomic) BOOL previewMirrorRearFacing; -/** - * 前置摄像头,编码写入文件时是否开启镜像,默认 NO +/*! + @property streamMirrorFrontFacing + @brief 前置摄像头,编码写入文件时是否开启镜像,默认 NO @since v1.0.0 */ @property (assign, nonatomic) BOOL streamMirrorFrontFacing; -/** - * 后置摄像头,编码写入文件时是否开启镜像,默认 NO +/*! + @property streamMirrorRearFacing + @brief 后置摄像头,编码写入文件时是否开启镜像,默认 NO @since v1.0.0 */ @property (assign, nonatomic) BOOL streamMirrorRearFacing; -/** - * 预览的渲染队列 +/*! + @property renderQueue + @brief 预览的渲染队列 @since v1.0.0 */ @property (strong, nonatomic, readonly) dispatch_queue_t __nonnull renderQueue; -/** - * 预览的渲染 OpenGL context +/*! + @property renderContext + @brief 预览的渲染 OpenGL context @since v1.0.0 */ @property (strong, nonatomic, readonly) EAGLContext *__nonnull renderContext; -/** - * 切换前置/后置摄像头 +/*! + @method toggleCamera + @brief 切换前置/后置摄像头 */ - (void)toggleCamera; -/** - * 开启音视频采集 - * +/*! + @method startCaptureSession + @brief 开启音视频采集 + @since v1.0.0 */ - (void)startCaptureSession; -/** - * 停止音视频采集 - * +/*! + @method stopCaptureSession + @brief 停止音视频采集 + @since v1.0.0 */ - (void)stopCaptureSession; -/** - * 是否开启美颜 +/*! + @method setBeautifyModeOn: + @brief 是否开启美颜 + + @param beautifyModeOn 美颜开关 @since v1.0.0 */ -(void)setBeautifyModeOn:(BOOL)beautifyModeOn; -/** +/*! + @method setBeautify: @brief 设置对应 Beauty 的程度参数. @param beautify 范围从 0 ~ 1,0 为不美颜 @@ -682,44 +709,30 @@ */ -(void)setBeautify:(CGFloat)beautify; -/** - * 设置美白程度(注意:如果美颜不开启,设置美白程度参数无效) - * - * @param whiten 范围是从 0 ~ 1,0 为不美白 +/*! + @method setWhiten: + @brief 设置美白程度(注意:如果美颜不开启,设置美白程度参数无效) + + @param whiten 范围是从 0 ~ 1,0 为不美白 @since v1.0.0 */ -(void)setWhiten:(CGFloat)whiten; -/** - * 设置红润的程度参数.(注意:如果美颜不开启,设置美白程度参数无效) - * - * @param redden 范围是从 0 ~ 1,0 为不红润 +/*! + @method setRedden: + @brief 设置红润的程度参数.(注意:如果美颜不开启,设置美白程度参数无效) - @since v1.0.0 - */ - --(void)setRedden:(CGFloat)redden; - -/** - * 开启水印 - * - * @param waterMarkImage 水印的图片 - * @param position 水印的位置 + @param redden 范围是从 0 ~ 1,0 为不红润 @since v1.0.0 */ --(void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position; -/** - * 移除水印 - - @since v1.0.0 - */ --(void)clearWaterMark; +-(void)setRedden:(CGFloat)redden; -/** - * 重新配置视频的参数 +/*! + @method reloadvideoConfiguration: + @brief 重新配置视频的参数 @since v1.0.0 */ diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h new file mode 100644 index 00000000..2526fe2b --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h @@ -0,0 +1,197 @@ +// +// PLShortVideoTranscoder.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/6/21. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLShortVideoTranscoder + @abstract 视频转码 + + @discussion 对视频进行转码处理 + */ +@interface PLShortVideoTranscoder : NSObject + +/*! + @property isExportMovieToPhotosAlbum + @brief 将视频导出到相册,默认为 NO + + @since v1.4.0 + */ +@property (assign, nonatomic) BOOL isExportMovieToPhotosAlbum; + +/*! + @property outputURL + @abstract 视频转码后的地址 + + @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 + + @since v1.0.5 + */ +@property (strong, nonatomic) NSURL *outputURL; + +/*! + @property outputFileType + @abstract 视频转码后的格式,默认为 PLSFileTypeMPEG4(.mp4) + + @since v1.0.5 + */ +@property (assign, nonatomic) PLSFileType outputFileType; + +/*! + @property outputFilePreset + @abstract 转码后视频的质量,默认为 PLSFilePresetHighestQuality + + @since v1.0.5 + */ +@property (assign, nonatomic) PLSFilePreset outputFilePreset; + +/*! + @property bitrate + @abstract 转码后视频的码率,默认为 6000 * 1000 bps,对应 PLSFilePresetHighestQuality + + @warning 只设置 outputFilePreset,不设置 bitrate,内部 bitrate 默认值如下: + PLSFilePresetLowQuality, 默认对应 700 * 1000 bps + PLSFilePresetMediumQuality, 默认对应 3000 * 1000 bps + PLSFilePresetHighestQuality, 默认对应 6000 * 1000 bps + PLSFilePreset640x480, 默认对应 2000 * 1000 bps + PLSFilePreset960x540, 默认对应 3000 * 1000 bps + PLSFilePreset1280x720, 默认对应 4000 * 1000 bps + PLSFilePreset1920x1080, 默认对应 6000 * 1000 bps + 如果 bitrate 的值大于原始视频的视频码率,则重置 bitrate 的值为原始视频的视频码率。 + + @since v1.11.0 + */ +@property (assign, nonatomic) float bitrate; + +/*! + @property progress + @abstract 转码的进度 + + @since v1.0.5 + */ +@property (assign, nonatomic, readonly) float progress; + +/*! + @property timeRange + @abstract 设置需要转码的视频时间段,默认为视频的总时长 + + @since v1.0.5 + */ +@property (assign, nonatomic) CMTimeRange timeRange; + +/*! + @property isAdjustVideoOrientation + @abstract 调整视频方向,默认为 NO。设置为 YES,可调整视频方向,生成的视频不需要通过视频角度信息和分辨率来获取实际分辨率。 + 比如 iPhone 相机拍摄的视频 (1920x1080, 90度, 纵向),播放器播放预览分辨率为 1080x1920。 + + @since v1.1.1 + */ +@property (assign, nonatomic) BOOL isAdjustVideoOrientation; + +/*! + @property rotateOrientation + @abstract 视频旋转方向,默认为 PLSPreviewOrientationPortrait。 + PLSPreviewOrientationPortrait = 0, 正立 0度 + PLSPreviewOrientationPortraitUpsideDown = 1, 180度 + PLSPreviewOrientationLandscapeRight = 2, 270度 + PLSPreviewOrientationLandscapeLeft = 3, 90度 + + @since v1.8.0 + */ +@property (assign, nonatomic) PLSPreviewOrientation rotateOrientation; + +/*! + @property videoFrameRate + @abstract 导出视频的帧率,默认 0,有效范围 [0 ~ 原视频帧率],当为 0 的时候,导出视频帧率等于原视频帧率, + 当设置的帧率大于原视频帧率时,会被自动调整为原视频帧率 + + @since v1.13.0 + */ +@property (assign, nonatomic) float videoFrameRate; + +/*! + @property completionBlock + @abstract 视频转码完成的 block + + @since v1.0.5 + */ +@property (copy, nonatomic) void(^completionBlock)(NSURL *url); + +/*! + @property failureBlock + @abstract 视频转码失败的 block + + @since v1.0.5 + */ +@property (copy, nonatomic) void(^failureBlock)(NSError* error); + +/*! + @property processingBlock + @abstract 视频转码进度的 block,可在该 block 中刷新转码进度条 UI + + @since v1.0.5 + */ +@property (copy, nonatomic) void(^processingBlock)(float progress); + +/*! + @method initWithAsset: + @brief 使用 AVAsset 初始化转码对象 + + @param asset 送去转码的视频 + + @return PLShortVideoTranscoder 实例 + @since v1.0.5 + */ +- (id)initWithAsset:(AVAsset *)asset; + +/*! + @method initWithURL: + @brief 使用 NSURL 初始化转码对象 + + @param url 送去转码的视频 + + @return PLShortVideoTranscoder 实例 + @since v1.0.5 + */ +- (id)initWithURL:(NSURL *)url; + +/*! + @method startTranscoding + @brief 在初始化转码对象 PLShortVideoTranscoder 并设置好转码参数后,执行该方法启动转码流程 + + @since v1.0.5 + */ +- (void)startTranscoding; + +/*! + @method cancelTranscoding + @brief 取消转码流程 + + @since v1.0.5 + */ +- (void)cancelTranscoding; + +/*! + @method videoDisplay:bounds:rotate: + @brief 返回 AVAsset 在 bounds 大小的 view 中播放,有视频部分的 frame + + @param asset AVAsset 实例 + @param bounds 预览 view 的大小 + @param previewOrientation 预览的方法 + + @since v1.13.0 + */ ++ (CGRect)videoDisplay:(AVAsset *)asset bounds:(CGRect)bounds rotate:(PLSPreviewOrientation)previewOrientation; + +@end + + diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h new file mode 100644 index 00000000..60b02214 --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h @@ -0,0 +1,155 @@ +// +// PLShortVideoUploader.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/7. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import "PLSUploaderConfiguration.h" +#import "PLSUploaderResponseInfo.h" + + +@class PLShortVideoUploader; +@class ALAsset; +@class PHAsset; + +/*! + @protocol PLShortVideoUploaderDelegate + @brief 文件上传协议 + + @since v1.0.4 + */ +@protocol PLShortVideoUploaderDelegate + +@optional + +/*! + @method shortVideoUploader:uploadKeyuploadPercent: + @abstract 上传进度回调 + @discussion 一个 PLShortVideoUploader 实例实现视频上传功能。 + + @param uploader PLShortVideoUploader 实例 + @param uploadKey 上传的 key 值 + @param uploadPercent 上传进度 + + @since v1.0.4 + */ +- (void)shortVideoUploader:(PLShortVideoUploader * _Nonnull)uploader uploadKey:(NSString * _Nullable)uploadKey uploadPercent:(float)uploadPercent; + +/*! + @method shortVideoUploader:completeInfo:uploadKey:resp: + @abstract 上传结果回调 + + @param uploader PLShortVideoUploader 实例 + @param info 上传完成信息 + @param uploadKey 上传的 key 值 + @param resp 上传完成的返回信息 + + @since v1.0.4 + */ +- (void)shortVideoUploader:(PLShortVideoUploader * _Nonnull)uploader completeInfo:(PLSUploaderResponseInfo * _Nonnull)info uploadKey:(NSString * _Nonnull)uploadKey resp:(NSDictionary * _Nullable)resp; + +@end + +/*! + @class PLShortVideoUploader + @abstract 短视频录制的上传功能核心类。 + + @discussion 一个 PLShortVideoUploader 实例实现段视频上传功能。 + */ +@interface PLShortVideoUploader : NSObject + +/*! + @property cancelUpload + @brief 取消/继续上传,YES 为取消上传,NO 为继续上传,默认为 NO + + @since v1.0.4 + */ +@property (nonatomic, assign, readonly, getter=isCancelUpload)BOOL cancelUpload; + +/*! + @property uploadPercent + @brief 上传进度 + + @since v1.0.4 + */ +@property (nonatomic, assign, readonly)float uploadPercent; + +/*! + @property uploadConfig + @brief 上传配置参数 + @see PLSUploaderConfiguration类 + + @since v1.0.4 + */ +@property (nonatomic, strong, readonly)PLSUploaderConfiguration * _Nonnull uploadConfig; + +/*! + @property delegate + @brief 代理对象,用于告知上传状态改变或其他行为,对象需实现 PLSUploadDelegate 协议 + + @since v1.0.4 + */ +@property (nonatomic, weak, nullable) id delegate; + +/*! + @method sharedUploader: + @abstract 创建 PLShortVideoUploader 单例对象 + + @return PLShortVideoUploader 实例 + + @since v1.0.4 + */ ++ (instancetype _Nullable)sharedUploader:(PLSUploaderConfiguration * _Nonnull)config; + +/*! + @method initWithConfiguration: + @abstract 初始化 PLShortVideoUploader + + @return PLShortVideoUploader 实例 + + @since v1.0.4 + */ +- (instancetype _Nullable)initWithConfiguration:(PLSUploaderConfiguration * _Nonnull)config; + +/*! + @method uploadVideoFile: + @abstract 上传视频文件 + + @param videoPath 上传的视频文件存放地址 + + @since v1.0.4 + */ +- (void)uploadVideoFile:(NSString * _Nonnull)videoPath; + +/*! + @method uploadVideoALAsset: + @abstract 上传 ALAsset 类视频资源文件 + + @param asset 上传的 ALAsset 视频文件 + + @since v1.0.5 + */ +- (void)uploadVideoALAsset:(ALAsset * _Nonnull)asset; + +/*! + @method uploadVideoPHAsset: + @abstract 上传 PHAsset 类视频资源文件 + + @param asset 上传的 PHAsset 视频文件 + + @since v1.0.5 + */ +- (void)uploadVideoPHAsset:(PHAsset * _Nonnull)asset; + +/*! + @method cancelUploadVidoFile + @abstract 取消上传视频 + + @since v1.0.4 + */ +- (void)cancelUploadVidoFile; + +@end diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Info.plist b/Pod/Library/Basic/PLShortVideoKit.framework/Info.plist new file mode 100644 index 00000000..75a5963a Binary files /dev/null and b/Pod/Library/Basic/PLShortVideoKit.framework/Info.plist differ diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/Modules/module.modulemap b/Pod/Library/Basic/PLShortVideoKit.framework/Modules/module.modulemap new file mode 100644 index 00000000..d6c2ef59 --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module PLShortVideoKit { + umbrella header "PLShortVideoKit.h" + + export * + module * { export * } +} diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/PLShortVideoKit b/Pod/Library/Basic/PLShortVideoKit.framework/PLShortVideoKit new file mode 100644 index 00000000..e62b0b89 Binary files /dev/null and b/Pod/Library/Basic/PLShortVideoKit.framework/PLShortVideoKit differ diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeDirectory b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeDirectory new file mode 100644 index 00000000..5470c471 Binary files /dev/null and b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeDirectory differ diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeRequirements b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeRequirements new file mode 100644 index 00000000..c56bef96 Binary files /dev/null and b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeRequirements differ diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeRequirements-1 b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeRequirements-1 new file mode 100644 index 00000000..0f53b13f Binary files /dev/null and b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeRequirements-1 differ diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeResources b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeResources new file mode 100644 index 00000000..49c0b920 --- /dev/null +++ b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeResources @@ -0,0 +1,376 @@ + + + + + files + + Headers/AVAsset+PLSExtendProperty.h + + SWRl2gOO0iYX4V7JptJkIxTzeEE= + + Headers/PLSAVAssetExportSession.h + + 9n3d9qSIDe3rz9Dg/RcptjisiFg= + + Headers/PLSAudioConfiguration.h + + 2Bb0sf/wC9dJ+Qfkysn3as/woNY= + + Headers/PLSEditPlayer.h + + K4Kx5sLRbW84OydcFnteZ8yTCdQ= + + Headers/PLSEditSettings.h + + /vHTTsPKNhiWupmCF7MwwWY1ayc= + + Headers/PLSFilter.h + + Ee2XD6Z5U6tES2yn1bHEwGwwLUQ= + + Headers/PLSTypeDefines.h + + GyZvMlO5kQUDrJV/g/6YaoHBToU= + + Headers/PLSUploaderConfiguration.h + + cQayQ/rAx8WsCM9wUwfx1A96Yr8= + + Headers/PLSUploaderResponseInfo.h + + 8c6O/9F1IJBt0ofw4yXEQUtrwPM= + + Headers/PLSVideoConfiguration.h + + VW9JUbmxCpXkklRVBBO/jc+Dfyw= + + Headers/PLShortVideoEditor.h + + 8ItSGs4jRp7sz/TRVxQNwehTQ5o= + + Headers/PLShortVideoKit.h + + ids26XZ/FQ0yqrOWLsw3MbHXxS8= + + Headers/PLShortVideoKitEnv.h + + qlw9lqQd2bYzY99QtlTEW4Cn4X8= + + Headers/PLShortVideoRecorder.h + + JLpWfrwTs5nVHAGyfgKm1MndjJY= + + Headers/PLShortVideoTranscoder.h + + rUXI88JO8HfrtyM0x/1kSJC0Zog= + + Headers/PLShortVideoUploader.h + + EnmjKfkvfilweaFWgUAaM8dyIoQ= + + Info.plist + + Vxn4N0JBFoO1+PYa/5pMDT3UfM0= + + Modules/module.modulemap + + +pa9k0pqKWlbwK9Mjk4UbUk5dRY= + + + files2 + + Headers/AVAsset+PLSExtendProperty.h + + hash + + SWRl2gOO0iYX4V7JptJkIxTzeEE= + + hash2 + + K7tvrUxowuShZk2JjHhoRsY6JuglIcaavRfUTyFGhHg= + + + Headers/PLSAVAssetExportSession.h + + hash + + 9n3d9qSIDe3rz9Dg/RcptjisiFg= + + hash2 + + OlpES7TcZqbToepk4VyyShH2zQmHlMcYKqdi0e2UUkg= + + + Headers/PLSAudioConfiguration.h + + hash + + 2Bb0sf/wC9dJ+Qfkysn3as/woNY= + + hash2 + + pe8YPDmhYhtChXZMjmL/j+zyBRF682tMShb2Sua+wiA= + + + Headers/PLSEditPlayer.h + + hash + + K4Kx5sLRbW84OydcFnteZ8yTCdQ= + + hash2 + + gQPF+KszCQfe15bHco0E5Co6sKBKXarfEw6E5vDQ2GU= + + + Headers/PLSEditSettings.h + + hash + + /vHTTsPKNhiWupmCF7MwwWY1ayc= + + hash2 + + ISlZDXiGdbCzS9fMbs53aTTcu9zXefFIQKUjO8Qlczs= + + + Headers/PLSFilter.h + + hash + + Ee2XD6Z5U6tES2yn1bHEwGwwLUQ= + + hash2 + + 1+LjfiELKeMsqEzNwvF2OgnyRvD7G5FNtCLWR4kSziA= + + + Headers/PLSTypeDefines.h + + hash + + GyZvMlO5kQUDrJV/g/6YaoHBToU= + + hash2 + + XPkmrHwOvglhgLt8JOgalbpe+kwuNjfNTIHaP+5HH7Q= + + + Headers/PLSUploaderConfiguration.h + + hash + + cQayQ/rAx8WsCM9wUwfx1A96Yr8= + + hash2 + + T7r6RH12isCfcKYFErE2/WQE/zkfdpxvGs5o62vy9jw= + + + Headers/PLSUploaderResponseInfo.h + + hash + + 8c6O/9F1IJBt0ofw4yXEQUtrwPM= + + hash2 + + ttc1D03XnTd+LcJGKZMiCrocm9OkyiYMf+1/rPx/GaY= + + + Headers/PLSVideoConfiguration.h + + hash + + VW9JUbmxCpXkklRVBBO/jc+Dfyw= + + hash2 + + M+DL7sHWoV2ssA7zTmeE8jYJdyDn7/RYmik/IWeCNBs= + + + Headers/PLShortVideoEditor.h + + hash + + 8ItSGs4jRp7sz/TRVxQNwehTQ5o= + + hash2 + + AqWGSeIJ0OO9UfFtM1dyPcHxRshMaHZMPShD0nDozFE= + + + Headers/PLShortVideoKit.h + + hash + + ids26XZ/FQ0yqrOWLsw3MbHXxS8= + + hash2 + + PKs87/Tfe37vk8rZuGlAkhQApDNnwgrZwyKn/N+curQ= + + + Headers/PLShortVideoKitEnv.h + + hash + + qlw9lqQd2bYzY99QtlTEW4Cn4X8= + + hash2 + + 2HhROV5zwTFWfozCrLEt21DZOGUEMvUGFwXLzk+KPt4= + + + Headers/PLShortVideoRecorder.h + + hash + + JLpWfrwTs5nVHAGyfgKm1MndjJY= + + hash2 + + RFGkse/idYaCncXcZZAGQScCSfX8tx5qBib6fgGvMpg= + + + Headers/PLShortVideoTranscoder.h + + hash + + rUXI88JO8HfrtyM0x/1kSJC0Zog= + + hash2 + + Cf8EuCb/di1iN8u4V7V4nRhflsOKWd9Xgej8toWpeOQ= + + + Headers/PLShortVideoUploader.h + + hash + + EnmjKfkvfilweaFWgUAaM8dyIoQ= + + hash2 + + LrTK8wZVo2KzqQIJzcpWzeCCjwbgkxAbJjtTfe4IC9Q= + + + Modules/module.modulemap + + hash + + +pa9k0pqKWlbwK9Mjk4UbUk5dRY= + + hash2 + + xoarXq2A9ptaDfat5G5iJgV0awRKFOAUT5CybLzv/EI= + + + + rules + + ^ + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^ + + weight + 20 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ + + nested + + weight + 10 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^[^/]+$ + + nested + + weight + 10 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeSignature b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeSignature new file mode 100644 index 00000000..66058216 Binary files /dev/null and b/Pod/Library/Basic/PLShortVideoKit.framework/_CodeSignature/CodeSignature differ diff --git a/Pod/Library/Basic/libMuseProcessor.a b/Pod/Library/Basic/libMuseProcessor.a new file mode 100644 index 00000000..ed5e2127 Binary files /dev/null and b/Pod/Library/Basic/libMuseProcessor.a differ diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h b/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h deleted file mode 100644 index 4d52adb5..00000000 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h +++ /dev/null @@ -1,77 +0,0 @@ -// -// PLShortVideoAsset.h -// PLShortVideoKit -// -// Created by 冯文秀 on 2017/9/26. -// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. -// - -#import -#import -#import "PLSTypeDefines.h" - -@interface PLShortVideoAsset : NSObject - -/** - @brief 实例初始化方法 - - @since v1.6.0 - */ -- (instancetype _Nullable )initWithURL:(NSURL *_Nullable)url; - -/** - @brief 实例初始化方法 - - @since v1.6.0 - */ -- (instancetype _Nullable )initWithAsset:(AVAsset *_Nullable)asset; - -/** - @brief 返回倍速处理后的视频 - * - * @param timeRange 倍速处理时间段 - * - * @param rateType 倍速处理的类型 - * - - @since v1.8.0 - */ -- (AVAsset *_Nonnull)scaleTimeRange:(CMTimeRange)timeRange toRateType:(PLSVideoRecoderRateType)rateType; - -/** - @brief 返回倍速处理后的视频 - * - * @param sourceAsset 需要倍速处理的视频,为 nil 时,默认使用 PLShortVideoAsset 初始化传入的视频数据 - * - * @param timeRange 倍速处理时间段 - * - * @param rateType 倍速处理的类型 - * - - @since v1.6.0 - */ -- (AVAsset *_Nonnull)scaleAsset:(AVAsset *_Nullable)sourceAsset timeRange:(CMTimeRange)timeRange rateType:(PLSVideoRecoderRateType)rateType __deprecated_msg("Method deprecated in v1.8.0. Use `scaleTimeRange: toRateType:`"); - -/** - @brief 返回倍速处理后的视频. 将 timeRangeArray 第 n 个元素的 timeRange 按照 rateTypeArray 第 n 个元素的 rateType 进行变速, timeRangeArray 没有包含到的时间段按照原速处理, 两个数组的元素必须相等并且数组不能为空数组 - * - * @param timeRangeArray 倍速处理时间段数组,包含 NSValue(CMTimeRange) 元素的数组,时间段不能重复且单调递增 - * - * @param rateTypeArray 倍速处理的类型数组,包含 NSNumber(PLSVideoRecoderRateType) 元素的数组, - * - - @since v1.15.0 - */ -- (AVAsset *_Nonnull)scaleTimeRanges:(NSArray *)timeRangeArray toRateTypes:(NSArray *)rateTypeArray; - -/** - @brief 返回拼接好的视频 - * - * @param assetArray AVAsset 数组 - * - - @since v1.6.0 - */ -- (AVAsset *_Nonnull)appendAssetArray:(NSArray *_Nonnull)assetArray; - -@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h new file mode 100644 index 00000000..4690bb3c --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/AVAsset+PLSExtendProperty.h @@ -0,0 +1,75 @@ +// +// AVAsset+PLSExtendProperty.h +// PLShortVideoKit +// +// Created by suntongmian on 2018/3/28. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import + +/*! + @category AVAsset (PLSExtendProperty) + @brief AVAsset 常用属性获取的类别 + + @since v1.11.0 + */ +@interface AVAsset (PLSExtendProperty) + +/*! + @property pls_videoSize + @brief 视频的真实分辨率,即就是视频播放的时候,显示的分辨率 + + @since v1.11.0 + */ +@property (assign, nonatomic, readonly) CGSize pls_videoSize; + +/*! + @property pls_portrait + @brief 视频是否为竖屏视频 + + @since v1.11.0 + */ +@property (assign, nonatomic, readonly) BOOL pls_portrait; + +/*! + @property pls_squareVideo + @brief 视频是否为正方形视频 + + @since v1.11.0 + */ +@property (assign, nonatomic, readonly) BOOL pls_squareVideo; + +/*! + @property pls_bitrate + @brief 视频的码率 + + @since v1.11.0 + */ +@property (assign, nonatomic, readonly) float pls_bitrate; + +/*! + @property pls_normalFrameRate + @brief 视频的帧率 + + @since v1.15.0 + */ +@property (assign, nonatomic, readonly) float pls_normalFrameRate; + +/*! + @property pls_channel + @brief 如果 AVAsset 包含音频通道,则返回第一个音频通道的声道数 + + @since v1.16.1 + */ +@property (assign, nonatomic, readonly) UInt32 pls_channel; + +/*! + @property pls_sampleRate + @brief 如果 AVAsset 包含音频通道,则返回第一个音频通道的采样率 + + @since v1.16.1 + */ +@property (assign, nonatomic, readonly) Float64 pls_sampleRate; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h new file mode 100644 index 00000000..efdef202 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAVAssetExportSession.h @@ -0,0 +1,275 @@ +// +// PLSAVAssetExportSession.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/7/11. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import "PLSTypeDefines.h" + + +@class PLSAVAssetExportSession; + +/*! + @protocol PLSAVAssetExportSessionDelegate + @abstract 视频导出协议 + + @since v1.1.0 + */ +@protocol PLSAVAssetExportSessionDelegate + +@optional + +/*! + @method assetExportSession:didOutputPixelBuffer: + @abstract 输出视频文件的视频数据,用来做滤镜处理 + + @param assetExportSession PLSAVAssetExportSession 实例 + @param pixelBuffer 视频帧 + + @since v1.1.0 + */ +- (CVPixelBufferRef __nonnull)assetExportSession:(PLSAVAssetExportSession *__nonnull)assetExportSession didOutputPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer __deprecated_msg("Method deprecated in v1.9.0. Use `assetExportSession: didOutputPixelBuffer: timestamp:`"); + +/*! + @method assetExportSession:didOutputPixelBuffer:timestamp: + @abstract 输出视频文件的视频数据,用来做滤镜处理 + + @param assetExportSession PLSAVAssetExportSession 实例 + @param pixelBuffer 视频帧 + @param timestamp 视频帧的时间戳 + + @since v1.9.0 + */ +- (CVPixelBufferRef __nonnull)assetExportSession:(PLSAVAssetExportSession *__nonnull)assetExportSession didOutputPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer timestamp:(CMTime)timestamp; + +@end + +/*! + @class PLSAVAssetExportSession + @brief 短视频导出核心类 + */ +@interface PLSAVAssetExportSession : NSObject + +/*! + @property delegate + @abstract 操作视频段的代理 + + @since v1.1.0 + */ +@property (weak, nonatomic) __nullable id delegate; + +/*! + @property delegateQueue + @abstract 触发代理对象回调时所在的任务队列。 + + @discussion 默认情况下该值为 nil,此时代理方法都会通过 main queue 异步执行回调。如果你期望可以所有的回调在自己创建或者其他非主线程调用, + 可以设置改 delegateQueue 属性。 + + @see PLSAVAssetExportSessionDelegate + @see delegate + + @since v1.1.0 + */ +@property (strong, nonatomic) dispatch_queue_t __nullable delegateQueue; + + +/*! + @method initWithAsset: + @brief 实例初始化方法 + + @param asset AVAsset 实例 + + @return PLSAVAssetExportSession 实例 + @since v1.1.0 + */ +- (instancetype _Nullable )initWithAsset:(AVAsset *_Nullable)asset; + +/*! + @property isExportMovieToPhotosAlbum + @brief 将视频导出到相册,默认为 NO + + @since v1.4.0 + */ +@property (assign, nonatomic) BOOL isExportMovieToPhotosAlbum; + +/*! + @property outputFileType + @brief 视频导出的文件类型,默认为 PLSFileTypeMPEG4(.mp4) + + @since v1.1.0 + */ +@property (assign, nonatomic) PLSFileType outputFileType; + +/*! + @property outputURL + @brief 视频导出的路径 + + @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 + + @since v1.1.0 + */ +@property (strong, nonatomic) NSURL * _Nullable outputURL; + +/*! + @property bitrate + @brief 视频的码率,默认为原视频的码率 + + @since v1.11.0 + */ +@property (assign, nonatomic) float bitrate; + +/*! + @property videoLayerOrientation + @brief 视频旋转,默认为 PLSPreviewOrientationPortrait 视频的原始方向 + + @since v1.7.0 + */ +@property (assign, nonatomic) PLSPreviewOrientation videoLayerOrientation; + +/*! + @property outputVideoSize + @brief 视频导出的分辨率 + + @since v1.5.0 + */ +@property (assign, nonatomic) CGSize outputVideoSize; + +/*! + @property outputVideoFrameRate + @brief 视频的帧率 + + @discussion 默认为原视频的帧率. 如果设置的帧率大于原视频的帧率,将会使用原视频的帧率作为导出视频的帧率,没有特别的需求不建议使用此属性.使用此属性的场景举例:在编辑阶段对帧率为 60 FPS 的视频进行 “极速“ 处理,然后使用 PLSAVAssetExportSession 导出这个极速处理的视频,如果不加帧率限制,导出的将会是 120 FPS 的视频,iPhone 设备播放 120 FPS 的视频会存在问题。此时可以使用此属性将导出视频的帧率限制在 60 FPS 以内。 + + @since v1.15.0 + */ +@property (assign, nonatomic) float outputVideoFrameRate; + +/*! + @property audioBitrate + @brief 导出视频的音频码率,默认:PLSAudioBitRate_128Kbps + + @discussion 音频的码率设置应该根据音频采样率和声道数来设置,如果设置的码率值和标准值相差太大,可能引起音频编码失败,导致导出视频文件失败。推荐的码率设置请查看 PLSAudioSampleRate 和 PLSAudioBitRate + @see PLSAudioSampleRate + @see PLSAudioBitRate + + @since v1.16.0 + */ +@property (assign, nonatomic) PLSAudioBitRate audioBitrate; + +/*! + @property audioChannel + @brief 导出视频的音频声道数。 + @discussion 目前支持单声道和双声道(即 1 个声道数和 2 个声道数). 如果不设置,将按照如下规则处理: + 如果原视频是单声道,则导出视频将使用单声道. 如果原视频声道数不小于 2,则导出视频声道数为 2 + + @since v1.16.0 + */ +@property (assign, nonatomic) UInt32 audioChannel; + +/*! + @property shouldOptimizeForNetworkUse + @brief 是否设置便于网络环境下的传输,默认为 YES + + @since v1.1.0 + */ +@property (assign, nonatomic) BOOL shouldOptimizeForNetworkUse; + +/*! + @property outputSettings + @brief 视频导出的设置信息 + + @since v1.1.0 + */ +@property (strong, nonatomic) NSDictionary * _Nullable outputSettings; + +/*! + @property progress + @brief 视频导出的进度 + + @since v1.1.0 + */ +@property (nonatomic, readonly) float progress; + +/*! + @property completionBlock + @abstract 视频导出完成的 block + + @since v1.1.0 + */ +@property (copy, nonatomic) void(^ _Nullable completionBlock)(NSURL * _Nullable url); + +/*! + @property failureBlock + @abstract 视频导出失败的 block + + @since v1.1.0 + */ +@property (copy, nonatomic) void(^ _Nullable failureBlock)(NSError* _Nullable error); + +/*! + @property processingBlock + @abstract 视频导出进度的 block,可在该 block 中刷新导出进度条 UI + + @since v1.1.0 + */ +@property (copy, nonatomic) void(^ _Nullable processingBlock)(float progress); + +/*! + @method exportAsynchronously + @brief 异步进行视频导出 + + @since v1.1.0 + */ +- (void)exportAsynchronously; + +/*! + @method cancelExport + @brief 取消视频导出 + + @since v1.1.0 + */ +- (void)cancelExport; + +/*! + @method addFilter: + @brief 添加滤镜效果 + + @param colorImagePath 当前使用的滤镜的颜色表图的路径 + + @since v1.5.0 + */ +- (void)addFilter:(NSString *_Nullable)colorImagePath; + +/*! + @method addMVLayerWithColor:alpha: + @brief 添加 MV 图层方法 1, 相当于 addMVLayerWithColor:colorURL alpha:alphaURL timeRange:kCMTimeRangeZero loopEnable:NO + + @param colorURL 彩色层视频的地址 + @param alphaURL 被彩色层当作透明层的视频的地址 + + @since v1.5.0 + */ +- (void)addMVLayerWithColor:(NSURL *_Nullable)colorURL alpha:(NSURL *_Nullable)alphaURL; + + +/*! + @method addMVLayerWithColor:alpha:timeRange:loopEnable + @brief 添加 MV 图层方法 2 + + @param colorURL 彩色层视频的地址 + @param alphaURL 被彩色层当作透明层的视频的地址 + @param timeRange 选取 MV 文件的时间段, 如果选取整个 MV,直接传入 kCMTimeRangeZero 即可 + @param loopEnable 当 MV 时长(timeRange.duration)小于视频时长时,是否循环播放 MV + + @since v1.14.0 + */ +- (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL timeRange:(CMTimeRange)timeRange loopEnable:(BOOL)loopEnable; + +@end + + diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h new file mode 100644 index 00000000..7be7540a --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioConfiguration.h @@ -0,0 +1,58 @@ +// +// PLSAudioConfiguration.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/1. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLSAudioConfiguration + @brief 采集和录制文件编码音频参数配置类 + + @since v1.0.0 + */ +@interface PLSAudioConfiguration : NSObject + +/*! + @property numberOfChannels + @brief 采集音频数据的声道数,默认为 1 + + @warning 并非所有采集设备都支持多声道数据的采集 + + @since v1.0.0 + */ +@property (assign, nonatomic) NSUInteger numberOfChannels; + +/*! + @property sampleRate + @brief 音频采样率 sampleRate 默认为 PLSAudioSampleRate_44100Hz + + @since v1.0.0 + */ +@property (assign, nonatomic) PLSAudioSampleRate sampleRate; + +/*! + @property bitRate + @brief 音频编码码率 bitRate 默认为 PLSAudioBitRate_128Kbps + + @since v1.0.0 + */ +@property (assign, nonatomic) PLSAudioBitRate bitRate; + + +/*! + @method defaultConfiguration + @brief 创建一个默认配置的 PLSAudioConfiguration 实例. + + @return 创建的默认 PLSAudioConfiguration 对象 + + @since v1.0.0 + */ ++ (instancetype)defaultConfiguration; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h similarity index 67% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h index cf9f415b..59f298f4 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSAudioMixConfiguration.h @@ -8,40 +8,48 @@ #import "PLSAudioConfiguration.h" -/** +/*! + * @class PLSAudioMixConfiguration * @abstract 双屏录制的音频设置类 */ @interface PLSAudioMixConfiguration : PLSAudioConfiguration -/** +/*! + @property disableMicrophone @brief 是否禁用麦克风音频采集,defalut: NO @since v1.11.0 */ @property (assign, nonatomic) BOOL disableMicrophone; -/** +/*! + @property disableSample @brief 是否禁用素材视频的音频数据,default: NO @since v1.11.0 */ @property (assign, nonatomic) BOOL disableSample; -/** - @brief 混音处理的时候,microphone 的音量大小. 当 disableSample 和 disableMicrophone 同时为 NO 时,该参数才有意义. default 0.5 (可用范围0.0~1.0) +/*! + @property microphoneVolume + @brief 混音处理的时候,microphone 的音量大小. + @discussion 当 disableSample 和 disableMicrophone 同时为 NO 时,该参数才有意义. default 0.5 (可用范围0.0~1.0) @since v1.11.0 */ @property (assign, nonatomic) float microphoneVolume; -/** - @brief 混音处理的时候,素材视频的音频大小. 当 disableSample 和 disableMicrophone 同时为 NO 时,该参数才有意义. default 0.5 (可用范围0.0~1.0) +/*! + @property sampleVolume + @brief 混音处理的时候,素材视频的音频大小. + @discussion 当 disableSample 和 disableMicrophone 同时为 NO 时,该参数才有意义. default 0.5 (可用范围0.0~1.0) @since v1.11.0 */ @property (assign, nonatomic) float sampleVolume; -/** +/*! + @property acousticEchoCancellationEnable @brief 回声消除开关,默认为 YES @discussion 启用回音消除,从扬声器播放的声音将会被消除掉,如果是带上耳机的、则没有必要启用回音消除,启用回音消除会让播放声音变得很大 @@ -50,7 +58,8 @@ */ @property (assign, nonatomic) BOOL acousticEchoCancellationEnable; -/** +/*! + @method defaultConfiguration @brief 创建一个默认配置的 PLSAudioMixConfiguration 实例. @return 创建的默认 PLSAudioMixConfiguration 对象 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h similarity index 86% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h index 1fa52bcf..54616abe 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSComposeMediaItem.h @@ -11,19 +11,26 @@ #import #import "PLSTypeDefines.h" - +/*! + @class PLSComposeMediaItem + @brief 图片视频混排媒体信息类 + + @since v1.16.0 + */ @interface PLSComposeMediaItem : NSObject #pragma mark - Common property -/** +/*! + @property mediaType @brief 媒体文件类型. @since v1.16.0 */ @property (assign, nonatomic) PLSMediaType mediaType; -/** +/*! + @property url @brief 媒体文件存放地址。普通图片、视频和 GIF 都可以使用 url 传递 @since v1.16.0 @@ -33,7 +40,8 @@ #pragma mark - Video property -/** +/*! + @property asset @brief 如果当前媒体文件是视频,asset 和 url 同时有值的情况下,将使用 asset,忽略 url @since v1.16.0 @@ -43,14 +51,16 @@ #pragma mark - Image property -/** +/*! + @property image @brief 如果当前媒体文件是图片,image 和 url 同时有值的情况下,将使用 image,忽略 url @since v1.16.0 */ @property (strong, nonatomic) UIImage *_Nullable image; -/** +/*! + @property imageDuration @brief 图片转换为视频的时长,默认为3.0,即3秒 @since v1.16.0 @@ -60,7 +70,8 @@ #pragma mark - GIF property -/** +/*! + @property gifImageData @brief 如果当前媒体文件是 GIF,gifImageData 和 url 同时有值的情况下,将使用 gifImageData,忽略 url 注意:GIF 资源不能通过 UIImage 来传递 @@ -68,7 +79,8 @@ */ @property (strong, nonatomic) NSData * _Nullable gifImageData; -/** +/*! + @property loopCount @brief 如果当前媒体文件是 GIF,则代表 GIF 转为视频的时候,GIF 循环播放的次数. 默认:1,即不做循环 如果当前媒体文件不是 GIF,则 loopCount 不会被使用 diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditPlayer.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditPlayer.h new file mode 100644 index 00000000..23122d01 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditPlayer.h @@ -0,0 +1,329 @@ +// +// PLSEditPlayer.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/7/10. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import +#import "PLSTypeDefines.h" + +@class PLSEditPlayer; + +/*! + @protocol PLSEditPlayerDelegate + @brief 视频编辑播放器协议 + + @since v1.1.0 + */ +@protocol PLSEditPlayerDelegate + +@optional + +/*! + @method player:didGetOriginPixelBuffer: + @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param player PLSEditPlayer 实例 + @param pixelBuffer CVPixelBufferRef 视频帧 + + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef + + @since v1.1.0 + */ +- (CVPixelBufferRef __nonnull)player:(PLSEditPlayer *__nonnull)player didGetOriginPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer __deprecated_msg("Method deprecated in v1.9.0. Use `player: didGetOriginPixelBuffer: timestamp:`"); + +/*! + @method player:didGetOriginPixelBuffer:timestamp: + @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param player PLSEditPlayer 实例 + @param pixelBuffer CVPixelBufferRef 视频帧 + @param timestamp 视频帧的时间戳 + + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef + + @since v1.9.0 + */ +- (CVPixelBufferRef __nonnull)player:(PLSEditPlayer *__nonnull)player didGetOriginPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer timestamp:(CMTime)timestamp; + +/*! + @method player:didReadyToPlayForItem:timeRange + @brief 当前视频的播放时刻达到了视频开头 + + @param player PLSEditPlayer 实例 + @param item 当前视频 + @param timeRange 当前视频的有效视频区域,对应 PLSEditPlayer 的属性 @property (assign, nonatomic) CMTimeRange timeRange + + @since v1.9.0 + */ +- (void)player:(PLSEditPlayer *__nonnull)player didReadyToPlayForItem:(AVPlayerItem *__nonnull)item timeRange:(CMTimeRange)timeRange; + +/*! + @method player:didReachEndForItem:timeRange + @brief 当前视频的播放时刻达到了视频结尾 + + @param player PLSEditPlayer 实例 + @param item 当前视频 + @param timeRange 当前视频的有效视频区域,对应 PLSEditPlayer 的属性 @property (assign, nonatomic) CMTimeRange timeRange + + @since v1.9.0 + */ +- (void)player:(PLSEditPlayer *__nonnull)player didReachEndForItem:(AVPlayerItem *__nonnull)item timeRange:(CMTimeRange)timeRange; + +@end + +/*! + @class PLSEditPlayer + @brief 视频编辑播放器类 + + @since v1.1.0 + */ +@interface PLSEditPlayer : AVPlayer + +/*! + @property delegate + @brief id 类型代理 + + @since v1.1.0 + */ +@property (weak, nonatomic) __nullable id delegate; + +/*! + @property loopEnabled + @brief 循环播放。设置为 YE,表示单曲循环。默认为 NO + + @since v1.1.0 + */ +@property (assign, nonatomic) BOOL loopEnabled; + +/*! + @property isPlaying + @brief 播放器是否在播放状态 + + @since v1.1.0 + */ +@property (readonly, nonatomic) BOOL isPlaying; + +/*! + @property preview + @brief 播放器的预览视图 + + @since v1.1.0 + */ +@property (strong, nonatomic) UIView *__nullable preview; + +/*! + @property fillMode + @brief 播放器预览视图的填充方式 + + @since v1.1.0 + */ +@property (assign, nonatomic) PLSVideoFillModeType fillMode; + +/*! + @property volume + @brief 播放器的音量 + + @since v1.1.0 + */ +@property (assign, nonatomic) float volume; + +/*! + @property timeRange + @brief 播放器播放文件的 timeRange 范围内 [start, duration] 片段 + + @since v1.1.0 + */ +@property (assign, nonatomic) CMTimeRange timeRange; + +/*! + @property videoSize + @brief 播放器播放视频的分辨率 + + @since v1.5.0 + */ +@property (assign, nonatomic) CGSize videoSize; + +/*! + @method audioPlayer + @brief 初始化音频播放器 + + @return 音频播放器 + @since v1.3.0 + */ ++ (PLSEditPlayer *_Nullable)audioPlayer; + +/*! + @method setItemByStringPath: + @brief 通过 stringPath 加载 AVPlayerItem + + @param stringPath 文件存放地址 + + @since v1.1.0 + */ +- (void)setItemByStringPath:(NSString *__nullable)stringPath; + +/*! + @method setItemByUrl: + @brief 通过 url 加载 AVPlayerItem + + @param url 文件存放地址 + + @since v1.1.0 + */ +- (void)setItemByUrl:(NSURL *__nullable)url; + +/*! + @method setItemByAsset: + @brief 通过 asset 加载 AVPlayerItem + + @param asset AVAsset 对象 + + @since v1.1.0 + */ +- (void)setItemByAsset:(AVAsset *__nullable)asset; + +/*! + @method setItem: + @brief 接收 item 去播放 + + @param item AVPlayerItem 对象 + + @since v1.1.0 + */ +- (void)setItem:(AVPlayerItem *__nullable)item; + +/*! + @method play + @brief 播放 + + @since v1.1.0 + */ +- (void)play; + +/*! + @method pause + @brief 暂停 + + @since v1.1.0 + */ +- (void)pause; + +/*! + @method setWaterMarkWithImage:position: + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + + @since v1.1.0 + */ +- (void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position; + +/*! + @method setWaterMarkWithImage:position:size: + @brief开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + + @since v1.14.0 + */ +- (void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position size:(CGSize)size; + +/*! + @method setWaterMarkWithImage:position:size:waterMarkType:alpha:rotateDegree: + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + @param type 水印的类型 + @param alpha 水印的透明度 (0 ~ 1) + @param degree 水印旋转角度 (单位:度) + + @since v1.15.0 + */ +- (void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position size:(CGSize)size waterMarkType:(PLSWaterMarkType)type alpha:(CGFloat)alpha rotateDegree:(CGFloat)degree; + +/*! + @method setGifWaterMarkWithData:position:size:alpha:rotateDegree: + @brief 开启水印,此方法只能设置 gif 水印 + + @param gifData gif 图片数据 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + @param alpha 水印的透明度 (0 ~ 1) + @param degree 水印旋转角度 (单位:度) + + @since v1.15.0 + */ +- (void)setGifWaterMarkWithData:(NSData *)gifData position:(CGPoint)position size:(CGSize)size alpha:(CGFloat)alpha rotateDegree:(CGFloat)degree; + +/*! + @method clearWaterMark + @brief 移除水印 + + @since v1.1.0 + */ +- (void)clearWaterMark; + +/*! + @method addFilter: + @brief 添加滤镜效果 + + @param colorImagePath 当前使用的滤镜的颜色表图的路径 + + @since v1.5.0 + */ +- (void)addFilter:(NSString *_Nullable)colorImagePath; + +/*! + @method addMVLayerWithColor:alpha: + @brief 添加 MV 图层方法 1, 相当于 addMVLayerWithColor:colorURL alpha:alphaURL timeRange:kCMTimeRangeZero loopEnable:NO + + @param colorURL 彩色层视频的地址 + @param alphaURL 被彩色层当作透明层的视频的地址 + + @since v1.5.0 + */ +- (void)addMVLayerWithColor:(NSURL *_Nullable)colorURL alpha:(NSURL *_Nullable)alphaURL; + +/*! + @method addMVLayerWithColor:alpha:timeRange:loopEnable: + @brief 添加 MV 图层方法 2 + + @param colorURL 彩色层视频的地址 + @param alphaURL 被彩色层当作透明层的视频的地址 + @param timeRange 选取 MV 文件的时间段, 如果选取整个 MV,直接传入 kCMTimeRangeZero 即可 + @param loopEnable 当 MV 时长(timeRange.duration)小于视频时长时,是否循环播放 MV + + @since v1.14.0 + */ +- (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL timeRange:(CMTimeRange)timeRange loopEnable:(BOOL)loopEnable; + +/*! + @method rotateVideoLayer + @brief 旋转视频的方向,能将竖屏视频旋转为横屏视频,横屏视频旋转为竖屏视频 + + @return PLSPreviewOrientation 当前视频的方向 + + @since v1.7.0 + */ +- (PLSPreviewOrientation)rotateVideoLayer; + +/*! + @method resetVideoLayerOrientation + @brief 重置视频的旋转方向,视频的方向被置为视频的原始方向 + + @since v1.7.0 + */ +- (void)resetVideoLayerOrientation; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditSettings.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditSettings.h new file mode 100644 index 00000000..152325b1 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSEditSettings.h @@ -0,0 +1,115 @@ +// +// PLSEditSettings.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/7/11. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTypeDefines.h" + +// ------------------------------------------------------------------ + +/*! + @constant PLSMovieSettingsKey + @abstract 视频对象的编辑信息 + @discussion + 存储的值的类型为 NSDictionary,包括 + PLSURLKey, + PLSAssetKey, + PLSStartTimeKey, + PLSDurationKey, + PLSVolumeKey, + PLSNameKey + + Note: PLSURLKey 和 PLSAssetKey 中必须设置其中的一项. + + @since v1.1.0 + */ +PLS_EXPORT NSString *const PLSMovieSettingsKey; + +/*! + @constant PLSAudioSettingsKey + @abstract 音频对象的编辑信息 + @discussion + 存储的值的类型为 NSDictionary,包括 + PLSURLKey, + PLSStartTimeKey, + PLSDurationKey, + PLSVolumeKey, + PLSNameKey, // 可以不设置 + PLSLocationStartTimeKey, // added by v1.11.0 + PLSLocationDurationKey // added by v1.11.0 + + @since v1.1.0 + */ +PLS_EXPORT NSString *const PLSAudioSettingsKey; + +/*! + @constant PLSWatermarkSettingsKey + @abstract 水印的设置信息 + @discussion + 存储的值的类型为 NSDictionary,包括 + PLSURLKey, + PLSSizeKey, + PLSPointKey + + @since v1.1.0 + */ +PLS_EXPORT NSString *const PLSWatermarkSettingsKey; + +/*! + @constant PLSStickerSettingsKey + @abstract 贴纸设置信息 + @discussion + 存储的值的类型为 NSDictionary,包括 + PLSStickerKey, + PLSSizeKey, + PLSPointKey + PLSRotationKey, + PLSStartTimeKey, + PLSDurationKey, + PLSVideoPreviewSizeKey, + PLSVideoOutputSizeKey + + @since v1.11.0 + */ +PLS_EXPORT NSString *const PLSStickerSettingsKey; + +// ------------------------------------------------------------------ + +PLS_EXPORT NSString *const PLSURLKey; /* NSURL */ + +PLS_EXPORT NSString *const PLSAssetKey; /* AVAsset */ + +PLS_EXPORT NSString *const PLSDurationKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSStartTimeKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSVolumeKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSNameKey; /* NSString */ + +PLS_EXPORT NSString *const PLSSizeKey; /* NSValue(CGSize) */ + +PLS_EXPORT NSString *const PLSPointKey; /* NSValue(CGPoint) */ + +PLS_EXPORT NSString *const PLSAlphaKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSTypeKey; /* NSNumber(NSInteger) */ + +PLS_EXPORT NSString *const PLSStickerKey; /* UIView */ + +PLS_EXPORT NSString *const PLSRotationKey; /* NSNumber(float),单位为度,比如:0,45,90,180 */ + +PLS_EXPORT NSString *const PLSVideoPreviewSizeKey; /* NSValue(CGSize) */ + +PLS_EXPORT NSString *const PLSVideoOutputSizeKey; /* NSValue(CGSize) */ + +PLS_EXPORT NSString *const PLSLocationStartTimeKey; /* NSNumber(float) */ + +PLS_EXPORT NSString *const PLSLocationDurationKey; /* NSNumber(float) */ + + diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h new file mode 100644 index 00000000..e53db792 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFadeTranstion.h @@ -0,0 +1,35 @@ +// +// PLSFadeTranstion.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/1/17. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import "PLSTransition.h" + +/*! + @class PLSFadeTranstion + @brief 渐隐渐现动画类 + + @since v1.10.0 + */ +@interface PLSFadeTranstion : PLSTransition + +/*! + @property fromOpacity + @brief 起始透明度 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat fromOpacity; + +/*! + @property toOpacity + @brief 结束透明度 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat toOpacity; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFilter.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFilter.h new file mode 100644 index 00000000..c277cead --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSFilter.h @@ -0,0 +1,73 @@ +// +// PLSFilter.h +// PLShortVideoKit +// +// Created by suntongmian on 17/4/13. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import + +/*! + @class PLSFilter + @brief 滤镜处理类 + + @since v1.3.0 + */ +@interface PLSFilter : NSObject + +/*! + @property colorImagePath + @abstract 色彩图片的路径 + + @since v1.3.0 + */ +@property (strong, nonatomic) NSString *colorImagePath; + +/*! + @method init + @abstract 初始化滤镜实例 + + @return PLSFilter 实例 + @since v1.3.0 + */ +- (instancetype)init; + +/*! + @method initWithColorImagePath: + @abstract 使用色彩图片初始化滤镜实例 + + @param colorImagePath 色彩图片的路径 + + @return PLSFilter 实例 + @since v1.1.0 + */ +- (instancetype)initWithColorImagePath:(NSString *)colorImagePath __deprecated; + +/*! + @method process: + @abstract 处理图像,加滤镜效果 + + @param pixelBuffer 源图像数据 + + @return 处理之后的 CVPixelBufferRef 滤镜图像 + + @since v1.1.0 + */ +- (CVPixelBufferRef)process:(CVPixelBufferRef)pixelBuffer; + +/*! + @method applyFilter:colorImagePath: + @abstract 处理图像,加滤镜效果 + + @param inputImage 待处理图片 + @param colorImagePath 滤镜资源文件路径 + + @return 处理之后的 UIImage 滤镜图像 + + @since v1.1.0 + */ ++ (UIImage *)applyFilter:(UIImage *)inputImage colorImagePath:(NSString *)colorImagePath; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSGifComposer.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSGifComposer.h new file mode 100644 index 00000000..0ab06a4d --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSGifComposer.h @@ -0,0 +1,129 @@ +// +// PLSGifComposer.h +// PLShortVideoKit +// +// Created by 冯文秀 on 2017/7/28. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import + +/*! + @class PLSGifComposer + @brief 图片生成 GIF 类 + */ +@interface PLSGifComposer : NSObject + +/*! + @property gifName + @abstract Gif 的名称,可以为 nil。当为 nil 时,内部会自动生成一个唯一的名称 + + @since v1.3.0 + */ +@property (strong, nonatomic) NSString *gifName; + +/*! + @property completionBlock + @abstract Gif 合成完成的 block。url 为 Gif 文件的地址 + + @since v1.3.0 + */ +@property (copy, nonatomic) void(^completionBlock)(NSURL *url); + +/*! + @property failureBlock + @abstract Gif 合成失败的 block + + @since v1.3.0 + */ +@property (copy, nonatomic) void(^failureBlock)(NSError* error); + +/*! + @property interval + @abstract Gif 动图每帧间隔设置,默认 0.1f,若需自定义,请在调用 composeGif 合成前,设置该属性 + + @since v1.4.0 + */ +@property (assign, nonatomic) CGFloat interval; + +/*! + @method initWithImagesArray: + @brief 实例初始化方法 + + @param imagesArray 图片数据 + + @since v1.3.0 + */ +- (instancetype)initWithImagesArray:(NSArray *)imagesArray; + +/*! + @method composeGif + @brief 将视频帧/图片数组合成为 Gif 动图,合成结果的回调见 completionBlock,failureBlock + + @since v1.3.0 + */ +- (void)composeGif; + +/*! + @method cancelComposeGif + @brief 取消合成 Gif 动图 + + @since v1.4.0 + */ +- (void)cancelComposeGif; + +/*! + @method loadGifWithFrame:superView:repeatCount: + @brief UIImageView 加载 Gif 图 + + @param frame UIImageView的frame + @param superView UIImageView的父视图 + @param repeatCount gif播放重复次数,0 为无限循环 + + @since v1.3.0 + */ +- (void)loadGifWithFrame:(CGRect)frame superView:(UIView *)superView repeatCount:(NSInteger)repeatCount; + +/*! + @method getImagesWithVideoURL:startTime:endTime:imageCount:imageSize:completionBlock: + @brief 从视频中获取多张图片 + + @param videoURL 原视频的地址 + @param startTime 从视频中获取图片的起始时间点 + @param endTime 从视频中获取图片的结束时间点,如果设置为 0,则将使用视频总时长作为结束时间 + @param imageCount 从视频中获取的图片总数 + @param imageSize 获取图片的宽高 + @param completionBlock 获取图片完成的回调 block. 如果发生错误,错误信息将通过 block 返回 + + @since v1.16.0 + */ ++ (void)getImagesWithVideoURL:(NSURL * _Nonnull)videoURL + startTime:(float)startTime + endTime:(float)endTime + imageCount:(int)imageCount + imageSize:(CGSize)imageSize + completionBlock:(void (^)(NSError *error, NSArray *images))completionBlock; + +/*! + @method getImagesWithAsset:startTime:endTime:imageCount:imageSize:completionBlock: + @brief 从视频中获取多张图片 + + @param asset 视频 AVAsset 对象 + @param startTime 从视频中获取图片的起始时间点 + @param endTime 从视频中获取图片的结束时间点,如果设置为 0,则将使用视频总时长作为结束时间 + @param imageCount 从视频中获取的图片总数 + @param imageSize 获取图片的宽高 + @param completionBlock 获取图片完成的回调 block. 如果发生错误,错误信息将通过 block 返回 + + @since v1.16.0 + */ ++ (void)getImagesWithAsset:(AVAsset * _Nonnull)asset + startTime:(float)startTime + endTime:(float)endTime + imageCount:(int)imageCount + imageSize:(CGSize)imageSize + completionBlock:(void (^)(NSError *error, NSArray *images))completionBlock; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h new file mode 100644 index 00000000..6d5d6af7 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageRotateRecorder.h @@ -0,0 +1,277 @@ +// +// PLSImageRotateRecorder.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/5/23. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import "PLSVideoConfiguration.h" +#import "PLSAudioConfiguration.h" +#import "PLSTypeDefines.h" + +@class PLSImageRotateRecorder; + +/*! + @protocol PLSImageRotateRecorderDelegate + @brief 图片旋转录制协议 + */ +@protocol PLSImageRotateRecorderDelegate +@optional + +#pragma mark -- 音视频采集数据的回调 +/*! + @method imageRotateRecorder:didGetRotatePixelBuffer: + @abstract 获取到旋转动画原数据时的回调, 便于开发者做滤镜等处理,需要注意的是这个是在视频采集的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 + + @param recorder PLSImageRotateRecorder 实例 + @param pixelBuffer 视频帧数据 + + @since v1.0.0 + */ +- (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didGetRotatePixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer; + +/*! + @method imageRotateRecorder:didGetMicrophoneSampleBuffer: + @abstract 获取到麦克风原数据时的回调,需要注意的是这个回调在麦克风数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题 + + @param recorder PLSImageRotateRecorder 实例 + @param sampleBuffer 音频帧数据 + + @since v1.0.1 + */ +- (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didGetMicrophoneSampleBuffer:(CMSampleBufferRef __nonnull)sampleBuffer; + +#pragma mark -- 录制状态回调回调 +/*! + @method imageRotateRecorder:didStartRecording: + @abstract 录制开始回调(由于启动录制是一个耗时的过程,因此放在一个单独的线程中,调用 startRecording:只是通知启动录制,真正的开始录制由此回调告知) + + @param recorder PLSImageRotateRecorder 实例 + @param fileURL 录制文件保存的地址 + + @since v1.11.0 + */ +- (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didStartRecording:(NSURL *__nonnull)fileURL; + +/*! + @method imageRotateRecorder:didRecordingToOutputFileAtURL:fileDuration:totalDuration:currentAngle: + @abstract 录制时长回调,录制过程中,这个方法会不断的回调 + + @param recorder PLSImageRotateRecorder 实例 + @param fileURL 当前正在录制的文件 + @param fileDuration 当前正在录制的文件已录制时长 + @param totalDuration 所有已经录制文件的总时长 + @param currentAngle 当前旋转图片所处的角度,单位: 弧度 + + @since v1.11.0 + */ +- (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CMTime)fileDuration totalDuration:(CMTime)totalDuration currentAngle:(float)currentAngle; + +/*! + @method imageRotateRecorder:didFinishRecording:fileDuration:totalDuration:currentAngle: + @abstract 录制结束回调(调用stopRecording,为了让所有音视频数据都写入到文件,会有一定的延时,因此这个回调是真正结束录制的通知) + + @param recorder PLSImageRotateRecorder 实例 + @param fileURL 录制文件保存的地址 + @param fileDuration 当前录制完成文件的时长 + @param totalDuration 已经录制完成的所有文件总时长 + @param currentAngle 当前旋转图片所处的角度,单位: 弧度 + + @since v1.11.0 + */ +- (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didFinishRecording:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration currentAngle:(float)currentAngle; + +/*! + @method imageRotateRecorder:didDeleteFileAtURL:fileDuration:totalDuration:currentAngle: + @abstract 删除一段视频之后的回调 + + @param recorder PLSImageRotateRecorder 实例 + @param fileURL 删除文件的地址 + @param fileDuration 删除文件的时长 + @param totalDuration 剩余文件的总时长 + @param currentAngle 剩余文件中最后一个文件录制结束时对应的角度 + + @since v1.11.0 + */ +- (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder didDeleteFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration currentAngle:(float)currentAngle; + +/*! + @method imageRotateRecorder:errorOccur: + @abstract 录制过程中发生错误回调 + + @param recorder PLSImageRotateRecorder 实例 + @param error 错误信息 + + @since v1.11.0 + */ +- (void)imageRotateRecorder:(PLSImageRotateRecorder *__nonnull)recorder errorOccur:(NSError *__nullable)error; + +@end + + +/*! + @class PLSImageRotateRecorder + @abstract 图片旋转动画录制类,将图片动画和麦克风采集音频录制为视频文件 + + @discussion PLSImageRotateRecorder 内部包含了旋转动画图片的获取、渲染 和 麦克风音频数据的采集 + */ +@interface PLSImageRotateRecorder : NSObject + +/*! + @method initWithVideoConfiguration:audioConfiguration: + @abstract 初始化方法 + + @param videoConfiguration 视频参数设置。必须设置,不能为 nil, 否则初始化返回 nil + @param audioConfiguration 音频参数设置为。可以为 nil。为 nil 时,不采集音频 + @since v1.11.0 + */ +- (nullable instancetype)initWithVideoConfiguration:(PLSVideoConfiguration *__nonnull)videoConfiguration + audioConfiguration:(PLSAudioConfiguration *__nullable)audioConfiguration; + +/*! + @property delegate + @brief 代理 + + @since v1.11.0 + */ +@property (nonatomic, weak) id __nullable delegate; + +/*! + @property callbackQueue + @brief 触发代理对象回调时所在的任务队列。default main_queue + + @since v1.11.0 + */ +@property (nonatomic, assign) dispatch_queue_t __nullable callbackQueue; + +/*! + @property previewView + @brief 预览 view + + @since v1.11.0 + */ +@property (nonatomic, readonly) UIView *__nonnull previewView; + +/*! + @property backgroundImage + @brief 背景图片,必须设置 + + @since v1.11.0 + */ +@property (nonatomic, strong) UIImage * __nonnull backgroundImage; + +/*! + @property rotateImage + @brief 旋转图片,必须设置 + + @since v1.11.0 + */ +@property (nonatomic, strong) UIImage *__nonnull rotateImage; + +/*! + @property rotateFrame + @brief 设置旋转图片在视频中的大小和位置,必须设置。正在录制的时候不可设置, 相对于初始化 videoConfiguration.videoSize, 视频左上角为 {0,0} + + @since v1.11.0 + */ +@property (nonatomic, assign) CGRect rotateFrame; + +/*! + @property rotateSpeed + @brief 旋转速度,多少秒转动一圈,正值为顺时针旋转、负值为逆时针旋转。建议设置范围: 5s ~ 20s. default: 10s + + @since v1.11.0 + */ +@property (nonatomic, assign) float rotateSpeed; + +/*! + @property fileType + @brief 录制文件的类型。PLSFileTypeMPEG4(.mp4) 或者 PLSFileTypeQuickTimeMovie(.mov). default: PLSFileTypeMPEG4 + + @since v1.11.0 + */ +@property (nonatomic, assign) PLSFileType fileType; + +/*! + @property isRecording + @brief 是否处于录制状态 + + @since v1.11.0 + */ +@property (nonatomic, readonly) BOOL isRecording; + +/*! + @method resetRotateToAngle: + @abstract 重置录制角度。 stopRecording 之后,当前的角度会保持,下一次录制开始的时候, + 角度接着上一次 stopRecording 时的角度。调用此方法,可以将角度重置为指定角度 + + @param angle 要设置的角度,单位:弧度 + + @since v1.11.0 + */ +- (void)resetRotateToAngle:(float)angle; + +/*! + @method getAllRecordingFiles + @abstract 获取所有已经录制完成的视频地址 + + @return 返回已经录制完成的所有视频段 + @since v1.11.0 + */ +- (NSArray *__nullable)getAllRecordingFiles; + +/*! + @method assetRepresentingAllFiles + @brief 获取代表当前所有录制视频段文件的 asset + + @return 返回代表当前所有录制视频段文件的 asset + @since v1.11.0 + */ +- (AVAsset *__nullable)assetRepresentingAllFiles; + +/*! + @method deleteLastRecordingFile + @abstract 删除最后一次录制完成的文件 + + @since v1.11.0 + */ +- (void)deleteLastRecordingFile; + +/*! + @method deleteAllRecordingFiles + @abstract 删除所有已经录制完成的视频地址 + + @since v1.11.0 + */ +- (void)deleteAllRecordingFiles; + +/*! + @method startRecording: + @abstract 开始录制 + + @param outURL 录制文件的保存位置。如果为 nil,则 SDK 内部会创建一个 + @since v1.11.0 + */ +- (void)startRecording:(NSURL *__nullable)outURL; + +/*! + @method stopRecording: + @abstract 停止录制。如果当前处理录制状态,调用之后,已经录制的文件通过回调 (imageRotateRecorder:didFinishRecording:)返回 + + @since v1.11.0 + */ +- (void)stopRecording; + +/*! + @method cancelRecording + @abstract 取消录制会停止视频录制并删除录制的视频段文件 + + @since v1.11.0 + */ +- (void)cancelRecording; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageSetting.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageSetting.h new file mode 100644 index 00000000..e315e72a --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageSetting.h @@ -0,0 +1,51 @@ +// +// PLSImageSetting.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/1/17. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import + +/*! + @class PLSImageSetting + @brief 转场动画图片设置 + + @since v1.10.0 + */ +@interface PLSImageSetting : NSObject + +/*! + @property image + @brief 图片实例 + + @since v1.10.0 + */ +@property (nonatomic, strong) UIImage *image; + +/*! + @property imageSize + @brief 图片所占区域大小 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGSize imageSize; + +/*! + @property startX + @brief 图片所占区域的起始x位置,相对于PLSVideoSetting中设置的width的偏移像素 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat startX; + +/*! + @property startY + @brief 图片所占区域的起始Y位置,相对于PLSVideoSetting中设置的height的偏移像素 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat startY; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h similarity index 79% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h index f75e09ae..aa0b4d9c 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageToMovieComposer.h @@ -10,105 +10,127 @@ #import #import "PLSTypeDefines.h" +/*! + @class PLSImageToMovieComposer + @abstract 图片合成视频类 + + @since v1.7.0 + */ __deprecated_msg("Class PLSImageToMovieComposer is deprecated in v1.16.0, use PLSImageVideoComposer instead") @interface PLSImageToMovieComposer : NSObject -/** +/*! + @property completionBlock @abstract 图片合成视频完成的 block @since v1.7.0 */ @property (copy, nonatomic) void(^completionBlock)(NSURL *url); -/** +/*! + @property failureBlock @abstract 图片合成视频失败的 block @since v1.7.0 */ @property (copy, nonatomic) void(^failureBlock)(NSError* error); -/** +/*! + @property processingBlock @abstract 图片合成视频进度的 block,可在该 block 中刷新进度条 UI @since v1.7.0 */ @property (copy, nonatomic) void(^processingBlock)(float progress); -/** +/*! + @property videoSize @abstract 视频文件的分辨率,默认为 544x960 @since v1.7.0 */ @property (assign, nonatomic) CGSize videoSize; -/** +/*! + @property videoFramerate @abstract 视频文件的帧率, 默认为 30 帧 @since v1.7.0 */ @property (assign, nonatomic) NSUInteger videoFramerate; -/** +/*! + @property bitrate @abstract 视频文件的码率,默认为 1024*1000 bps @since v1.7.0 */ @property (assign, nonatomic) CGFloat bitrate; -/** +/*! + @property transitionType @abstract 转场动画类型,默认为渐入渐出 @since v1.7.0 */ @property (assign, nonatomic) PLSTransitionType transitionType; -/** +/*! + @property transitionDuration @abstract 转场动画持续的时长,默认为1.0,即1秒 @since v1.8.0 */ @property (assign, nonatomic) CGFloat transitionDuration; -/** +/*! + @property imageDuration @abstract 每张图片持续的时长,默认为2.0,即2秒 @since v1.8.0 */ @property (assign, nonatomic) CGFloat imageDuration; -/** +/*! + @property outputFileType @brief 视频的文件类型,默认为 PLSFileTypeMPEG4(.mp4) @since v1.7.0 */ @property (assign, nonatomic) PLSFileType outputFileType; -/** +/*! + @method initWithImages: @brief 初始化 - * + @param images 用于生成视频文件的图片数组 + @return PLSImageToMovieComposer 实例 @since v1.7.0 */ - (instancetype)initWithImages:(NSArray *)images; -/** +/*! + @method initWithImageURLs: @brief 初始化 - * + @param urls 图片保存的路径数组 + @return PLSImageToMovieComposer 实例 @since v1.14.0 */ - (instancetype)initWithImageURLs:(NSArray *)urls; -/** +/*! + @method startComposing @brief 执行图片合成视频 @since v1.7.0 */ - (void)startComposing; -/** +/*! + @method stopComposing @brief 停止图片合成视频 @since v1.7.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h similarity index 70% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h index d9d7b760..99b926cc 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSImageVideoComposer.h @@ -10,142 +10,162 @@ #import "PLSComposeMediaItem.h" #import "PLSTypeDefines.h" -/** - * @abstract 图片视频混排 - * - * @discussion 可以将多张图片和多个视频拼接为一个视频,并且支持设置转场 +/*! + @class PLSImageVideoComposer + @abstract 图片视频混排 + + @discussion 可以将多张图片和多个视频拼接为一个视频,并且支持设置转场 */ @interface PLSImageVideoComposer : NSObject -/** +/*! + @property completionBlock @abstract 合成视频完成的 block @since v1.16.0 */ @property (copy, nonatomic) void(^_Nullable completionBlock)(NSURL *url); -/** +/*! + @property failureBlock @abstract 合成视频失败的 block @since v1.16.0 */ @property (copy, nonatomic) void(^ _Nullable failureBlock)(NSError* error); -/** +/*! + @property processingBlock @abstract 合成视频进度的 block,可在该 block 中刷新进度条 UI @since v1.16.0 */ @property (copy, nonatomic) void(^ _Nullable processingBlock)(float progress); -/** +/*! + @property isExportMovieToPhotosAlbum @brief 将视频导出到相册,默认为 NO @since v1.16.0 */ @property (assign, nonatomic) BOOL isExportMovieToPhotosAlbum; -/** +/*! + @property outputURL @brief 合成视频的保存 URL。 如果不设置,内部将自动创建 URL @since v1.16.0 */ @property(strong, nonatomic) NSURL *_Nullable outputURL; -/** +/*! + @property musicURL @brief 添加背景音乐 @since v1.16.0 */ @property(strong, nonatomic) NSURL *_Nullable musicURL; -/** +/*! + @property musicVolume @brief 背景音乐音量, 默认:1.0,取值范围(0 ~ 1.0) @since v1.16.0 */ @property(assign, nonatomic) float musicVolume; -/** +/*! + @property movieVolume @brief 原视频的音量。默认:1.0,取值范围(0 ~ 1.0) @since v1.16.0 */ @property(assign, nonatomic) float movieVolume; -/** +/*! + @property disableTransition @brief 是否禁用转场, 默认:NO @since v1.16.0 */ @property(assign, nonatomic) BOOL disableTransition; -/** - @brief 转场动画持续的时长,默认为 1.0,即 1 秒. 如果 transitionDuration 的值大于合并的视频中最短时长,则 - 将使用合并的视频中最短视频的时长作为转场动画的时长. - 仅当 disableTransition 为 NO 的时候,transitionDuration 才生效 +/*! + @property transitionDuration + @brief 转场动画持续的时长,默认为 1.0,即 1 秒. 如果 transitionDuration 的值大于合并的视频中最短时长,则将使用合并的视频中最短视频的时长作为转场动画的时长.仅当 disableTransition 为 NO 的时候,transitionDuration 才生效 + @since v1.16.0 */ @property (assign, nonatomic) NSTimeInterval transitionDuration; -/** +/*! + @property transitionType @abstract 转场类型,默认为渐入渐出。仅当 disableTransition 为 NO 的时候,transitionType 才生效 @since v1.16.0 */ @property (assign, nonatomic) PLSTransitionType transitionType; -/** -@abstract 拼接策略. 仅当 disableTransition 为 YES 的时候,composerPriorityType 才生效 +/*! + @property composerPriorityType + @abstract 拼接策略. 仅当 disableTransition 为 YES 的时候,composerPriorityType 才生效 -@since v1.16.0 + @since v1.16.0 */ @property (assign, nonatomic) PLSComposerPriorityType composerPriorityType; -/** +/*! + @property videoSize @abstract 合成视频文件的分辨率,默认为 544x960 @since v1.16.0 */ @property (assign, nonatomic) CGSize videoSize; -/** +/*! + @property bitrate @abstract 合成视频文件的码率,默认为 1024*1000 bps @since v1.16.0 */ @property (assign, nonatomic) CGFloat bitrate; -/** +/*! + @property videoFramerate @abstract 合成视频文件的帧率, 默认为 30 帧 @since v1.16.0 */ @property (assign, nonatomic) NSUInteger videoFramerate; -/** +/*! + @property outputFileType @brief 合成视频文件的类型,默认为 PLSFileTypeMPEG4(.mp4) @since v1.16.0 */ @property (assign, nonatomic) PLSFileType outputFileType; -/** +/*! + @property mediaArrays @brief 合并的文件数组,按照数组顺序拼接 @since v1.16.0 */ @property (copy, nonatomic) NSMutableArray *_Nullable mediaArrays; -/** - @brief 执行合成视频。调用之前,先确保将需要设置的参数都已经设置完毕,否则启动合成操作之后再设置参数将不会生效 - 如果发生错误,将通过 failureBlock 将错误信息回调 +/*! + @method startComposing + @brief 执行合成视频 + + @discussion 调用之前,先确保将需要设置的参数都已经设置完毕,否则启动合成操作之后再设置参数将不会生效, 如果发生错误,将通过 failureBlock 将错误信息回调 @since v1.16.0 */ - (void)startComposing; -/** +/*! + @method stopComposing @brief 取消执行合成视频 @since v1.16.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h similarity index 77% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h index 3a0ab99d..de383e0b 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMixMediaItem.h @@ -10,58 +10,74 @@ #import #import "PLSTypeDefines.h" +/*! + @class PLSMixMediaItem + @brief 视频合并信息类 + + @since v1.11.0 + */ @interface PLSMixMediaItem : NSObject -/** +/*! + @property mediaURL @brief 合并文件的地址 @since v1.11.0 */ @property (nonatomic, strong) NSURL *__nonnull mediaURL; -/** +/*! + @property enableAudio @brief 是否使用音频. (默认: YES) @since v1.11.0 */ @property (nonatomic, assign) BOOL enableAudio; -/** +/*! + @property volume @brief 音量大小 (0 ~ 1.0, 默认: 1.0) @since v1.11.0 */ @property (nonatomic, assign) float volume; -/** - @brief 视频在最终合并的视频中的位置, 需要注意的是,这个参数影响的是视频编码时的分辨率,而非素材视频数据的预览大小,传递给编码器的图像尺寸与此尺寸不同时,默认会按照 AVVideoScalingModeResizeAspectFill 对图像做剪切,从而确保图像不会出现变形 +/*! + @property videoFrame + @brief 视频的位置和大小 + + @discussion 在最终合并的视频中的位置, 需要注意的是,这个参数影响的是视频编码时的分辨率,而非素材视频数据的预览大小,传递给编码器的图像尺寸与此尺寸不同时,默认会按照 AVVideoScalingModeResizeAspectFill 对图像做剪切,从而确保图像不会出现变形 @since v1.11.0 */ @property (assign, nonatomic) CGRect videoFrame; -/** +/*! + @property zIndex @brief 相对于 Z 轴的层数。如果多个 PLSMixMediaItem 的 videoFrame 发生重合,那么 zIndex 大的将覆盖在 zIndex 小的上面 @since v1.11.0 */ @property (assign, nonatomic) int zIndex; -/** +/*! + @property fillMode @brief 当视频的宽高比和 videoFrame 的宽高比不一致的时候,视频的contentMode (默认: PLSVideoFillModePreserveAspectRatioAndFill) @since v1.11.0 */ @property (assign, nonatomic) PLSVideoFillModeType fillMode; -/** +/*! + @property loop @brief 如果本文件时长小于设置合并的文件时长,是否将本文件以 loop 的形式添加到设置的合并文件时长。默认:YES @since v1.11.0 */ @property (assign, nonatomic) BOOL loop; -/** +/*! + @property startTime @brief 设置本文件的开始播放时间。比如想要实现多个视频合并之后,播放模式是一个视频播放完成之后,另外一个视频接着播放, 那么可以将 loop 设置为 NO,并且将 PLSMultiVideoMixer 的属性 duration 设置为为所有文件的时长之和, 即可以通过设置 startTime 的值来实现. 默认:kCMTimeZero @@ -70,14 +86,16 @@ */ @property (assign, nonatomic) CMTime startTime; -/** +/*! + @property duration @brief 本文件的时长。 只读属性,为实现多个视频合并播放模式“一个接着一个顺序播放”设置 startTime 提供方便 @since v1.11.0 */ @property (readonly, nonatomic) CMTime duration; -/** +/*! + @property videoSize @brief 视频宽高。如果有视频通道,返回视频的宽高。如果没有,返回 CGSizeZero. 注意:这个 videoSize 是视频真实宽高经过 CGAffineTransform 处理之后宽高 @since v1.11.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSMovieComposer.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMovieComposer.h similarity index 76% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSMovieComposer.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMovieComposer.h index ee5f88ff..a1b3104f 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSMovieComposer.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMovieComposer.h @@ -11,95 +11,120 @@ #import #import "PLSTypeDefines.h" +/*! + @class PLSMovieComposer + @abstract 多个视频拼接类 + + @since v1.4.0 + */ __deprecated_msg("Class PLSMovieComposer is deprecated in v1.16.0, use PLSImageVideoComposer with disableTransition instead") @interface PLSMovieComposer : NSObject -/** +/*! + @property completionBlock @abstract 视频拼接完成的 block @since v1.4.0 */ @property (copy, nonatomic) void(^completionBlock)(NSURL *url); -/** +/*! + @property failureBlock @abstract 视频拼接失败的 block @since v1.4.0 */ @property (copy, nonatomic) void(^failureBlock)(NSError* error); -/** +/*! + @property processingBlock @abstract 视频拼接进度的 block,可在该 block 中刷新进度条 UI @since v1.4.0 */ @property (copy, nonatomic) void(^processingBlock)(float progress); -/** +/*! + @property isExportMovieToPhotosAlbum @brief 将视频导出到相册,默认为 NO @since v1.4.0 */ @property (assign, nonatomic) BOOL isExportMovieToPhotosAlbum; -/** +/*! + @property outputFileType @abstract 拼接后视频的格式,默认为 PLSFileTypeMPEG4(.mp4) @since v1.6.0 */ @property (assign, nonatomic) PLSFileType outputFileType; -/** +/*! + @property videoSize @abstract 拼接后视频的分辨率,默认为第1个视频的分辨率 @since v1.4.0 */ @property (assign, nonatomic) CGSize videoSize; -/** +/*! + @property videoFrameRate @abstract 拼接后视频数据的帧率,默认为 25 @since v1.6.0 */ @property (assign, nonatomic) int videoFrameRate; -/** +/*! + @property bitrate @abstract 拼接后视频的码率,默认码率为 1024*1000 bps @since v1.6.0 */ @property (assign, nonatomic) float bitrate; -/** +/*! + @property composerPriorityType @abstract 拼接策略,默认:PLSComposerPriorityTypeSync @since v1.14.0 */ @property (assign, nonatomic) PLSComposerPriorityType composerPriorityType; -/** +/*! + @method initWithAssets: @brief 初始化 + @param assets 待合并的视频 AVAsset 资源 + + @return PLSMovieComposer 实例 @since v1.4.0 */ - (instancetype)initWithAssets:(NSArray *)assets; -/** +/*! + @method initWithUrls: @brief 初始化 + @param urls 待合并的视频存放地址 + + @return PLSMovieComposer 实例 @since v1.4.0 */ - (instancetype)initWithUrls:(NSArray *)urls; -/** +/*! + @method startComposing @brief 执行视频拼接 @since v1.4.0 */ - (void)startComposing; -/** - @brief 停止视频拼接 +/*! + @method stopComposing + @brief 停止视频拼接s @since v1.4.0 */ diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h similarity index 76% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h index a319b8bb..f9e553d9 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSMultiVideoMixer.h @@ -11,37 +11,40 @@ #import "PLSAudioConfiguration.h" #import "PLSMixMediaItem.h" -/** - * @abstract 将多个 视频 或者 纯视频 或者 纯音频 合并为一个文件 - * - * @discussion PLSMultiVideoMixer 没有对合并视频的路数做限制,但由于受手机硬件限制,在没有 AVPlayer 播放的时候,最大可以合并 16 路视频, - * 在有 AVplayer 播放的时候,最大可以合并 8 路视频。因此导出视频之前,尽量将不需要的 AVPlayer 释放掉。 +/*! + @class PLSMultiVideoMixer + @abstract 将多个 视频 或者 纯视频 或者 纯音频 合并为一个文件 + + @discussion PLSMultiVideoMixer 没有对合并视频的路数做限制,但由于受手机硬件限制,在没有 AVPlayer 播放的时候,最大可以合并 16 路视频,在有 AVplayer 播放的时候,最大可以合并 8 路视频。因此导出视频之前,尽量将不需要的 AVPlayer 释放掉。 */ @interface PLSMultiVideoMixer : NSObject -/** +/*! + @property outputURL @brief 导出视频存放url. 必须设置,否则无法导出视频 @since v1.11.0 */ @property (nonatomic, strong) NSURL * _Nonnull outputURL; -/** - @brief 编码的视频大小,PLSMixMediaItem 的属性 videoFrame 就是基于 CGRect {0, 0, videoSize.width, videoSize.height} - 最大支持 1080p +/*! + @property videoSize + @brief 编码的视频大小,PLSMixMediaItem 的属性 videoFrame 就是基于 CGRect {0, 0, videoSize.width, videoSize.height}, 最大支持 1080p @since v1.11.0 */ @property (nonatomic, assign) CGSize videoSize; -/** +/*! + @property duration @brief 合并文件的时长,默认等于所有参与合并文件时长最长的 @since v1.11.0 */ @property (nonatomic, assign) CMTime duration; -/** +/*! + @property frameRate @brief 编码的帧率,如果为 0 或者不设置. 则使用合并的第一个视频文件的 frameRate。最大支持 60 帧 @since v1.11.0 @@ -49,28 +52,32 @@ @property (nonatomic, assign) float frameRate; -/** +/*! + @property completionBlock @brief 导出视频成功的 block @since v1.11.0 */ @property (copy, nonatomic) void(^ _Nullable completionBlock)(NSURL * _Nonnull url); -/** +/*! + @property failureBlock @brief 导出视频失败的 block @since v1.11.0 */ @property (copy, nonatomic) void(^ _Nullable failureBlock)(NSError* _Nonnull error); -/** - @brife 导出视频进度的 block,可在该 block 中刷新进度条 UI +/*! + @property processingBlock + @brief 导出视频进度的 block,可在该 block 中刷新进度条 UI @since v1.11.0 */ @property (copy, nonatomic) void(^ _Nullable processingBlock)(float progress); -/** +/*! + @method addMedia: @abstract 添加合并视频文件, 可以是纯音频或者纯视频文件. 如果多次添加同一个 media,会被忽略 @param media 不能为空 @@ -79,14 +86,17 @@ */ -(void)addMedia:(PLSMixMediaItem *_Nonnull)media; -/** +/*! + @method getAllMedia @abstract 获取所有添加的 PLSMixMediaItem 实例 + @return 返回所有的 PLSMixMediaItem 实例 @since v1.11.0 */ - (NSArray * _Nullable )getAllMedia; -/** +/*! + @method removeMedia: @abstract 删除合并视频文件 @param media 不能为空 @@ -95,14 +105,16 @@ */ -(void)removeMedia:(PLSMixMediaItem *_Nonnull)media; -/** +/*! + @method removeAllMedia @abstract 删除所有合并视频文件 @since v1.11.0 */ -(void)removeAllMedia; -/** +/*! + @method getPlayerItem: @abstract 可以获取 AVPlayerItem 用于预览效果。每次添加、删除合并文件之后、重新调用此方法,获取最新的。注意:每次调用,返回的 AVPlayerItem 都是新的实例 @param error 如果调用此方法发生错误,error 不等于 nil 的话、错误信息将放在 *error 中返回 @@ -113,7 +125,8 @@ */ -(nullable AVPlayerItem *)getPlayerItem:(NSError **_Nullable)error; -/** +/*! + @method setMediaVolume:media: @abstract 预览的时候用于动态调整 PLSMixMediaItem 的音量大小 @param playerItem getPlayerItem: 返回的 AVPlayerItem 实例 @@ -125,14 +138,16 @@ */ - (BOOL)setMediaVolume:(AVPlayerItem *_Nonnull)playerItem media:(PLSMixMediaItem *_Nonnull)media; -/** +/*! + @method startExport @abstract 开始导出文件 @since v1.11.0 */ - (void)startExport; -/** +/*! + @method cancelExport @abstract 取消导出文件 @since v1.11.0 diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSPositionTransition.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSPositionTransition.h new file mode 100644 index 00000000..aadbe7be --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSPositionTransition.h @@ -0,0 +1,35 @@ +// +// PLSPositionTransition.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/1/17. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import "PLSTransition.h" + +/*! + @class PLSPositionTransition + @brief 位置变化动画类 + + @since v1.10.0 + */ +@interface PLSPositionTransition : PLSTransition + +/*! + @property fromPoint + @brief 起始位置,相对于PLSVideoSetting中设置的width、height的偏移像素 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGPoint fromPoint; + +/*! + @property toPoint + @brief 结束位置, 相对于PLSVideoSetting中设置的width、height的偏移像素 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGPoint toPoint; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMedia.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMedia.h similarity index 81% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMedia.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMedia.h index 48d20fda..e2252a65 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMedia.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMedia.h @@ -9,37 +9,48 @@ #import #import +/*! + @class PLSRangeMedia + @brief 视频切割信息实例 + + @since v1.10.0 + */ @interface PLSRangeMedia : NSObject -/** +/*! + @property startTime @brief 选取的开始时间 @since v1.10.0 */ @property (nonatomic, assign) CMTime startTime; -/** +/*! + @property endTime @brief 选取的结束时间 @since v1.10.0 */ @property (nonatomic, assign) CMTime endTime; -/** +/*! + @property asset @brief 视频可以是AVAseet格式,也可以用url,二选一 @since v1.10.0 */ @property (nonatomic, strong) AVAsset *asset; -/** +/*! + @property url @brief 视频的url,也可以用AVAsset,二选一 @since v1.10.0 */ @property (nonatomic, strong) NSURL *url; -/** +/*! + @property isTransition @brief 是不是转场视频 @since v1.10.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h similarity index 81% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h index 02b7f286..2c0c7061 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMediaTools.h @@ -12,26 +12,36 @@ @class PLSRangeMedia; - +/*! + @class PLSRangeMediaTools + @brief 视频切割工具类 + + @since v1.10.0 + */ @interface PLSRangeMediaTools : NSObject -/** +/*! + @method playerItemWithRangeMedia: @abstract 根据PLSRangeMedia的选段信息,生成一个AVPlayerItem,将多段视频整合在一个AVPlayerItem中, 相当于 [PLSRangeMediaTools playerItemWithRangeMedia:rangeMedias videoSize:CGSizeZero fillMode:PLSVideoFillModePreserveAspectRatioAndFill] + @param rangeMedias 待拼接的视频文件 + @return 返回拼接之后的 AVPlayerItem 实例 @since v1.10.0 */ + (AVPlayerItem *)playerItemWithRangeMedia:(NSArray *)rangeMedias; -/** +/*! + @method playerItemWithRangeMedia:videoSize:videoSize; @abstract 根据PLSRangeMedia的选段信息,生成一个AVPlayerItem,将多段视频整合在一个AVPlayerItem中。 @param rangeMedias 视频源 @param videoSize 生成视频的宽高,如果为 CGSizeZero,将使用第一个视频的宽高作为生成视频的宽高 @param fillMode 如果 rangeMedias 的视频宽高比例和 videoSize 宽高比例不一样的时候,使用的填充模式 + @return 返回拼接之后的 AVPlayerItem 实例 @since v1.16.0 */ + (AVPlayerItem *)playerItemWithRangeMedia:(NSArray *)rangeMedias videoSize:(CGSize)videoSize fillMode:(PLSVideoFillModeType)fillMode; diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h similarity index 82% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h index 5d080f0f..011e0813 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRangeMovieExport.h @@ -10,16 +10,25 @@ #import "PLSTypeDefines.h" @class PLSRangeMedia; + +/*! + @class PLSRangeMovieExport + @brief 视频切割导出类 + + @since v1.10.0 + */ @interface PLSRangeMovieExport : NSObject -/** +/*! + @property outURL @brief 导出视频存放url @since v1.10.0 */ @property (nonatomic, strong) NSURL *outURL; -/** +/*! + @property outputFilePreset; @abstract 导出合并视频的宽高控制,默认为 PLSFilePresetHighestQuality. 注意:该属性在 v1.16.0 版本中被弃用,建议使用 outputVideoSize 来设置导出视频的宽高。如果不想使用 outputVideoSize,仍然 @@ -29,63 +38,75 @@ */ @property (assign, nonatomic) PLSFilePreset outputFilePreset __deprecated_msg("outputFilePreset deprecated in v1.16.0. Use `outputVideoSize` instead"); -/** +/*! + @property outputVideoSize @abstract 导出视频的宽高,如果不设置,内部将使用 outputFilePreset 来计算导出视频的宽高 @since v1.16.0 */ @property (assign, nonatomic) CGSize outputVideoSize; -/** +/*! + @property fillMode @abstract 当多个视频宽高比例不一样的时候,视频的填充模式 @since v1.16.0 */ @property (assign, nonatomic) PLSVideoFillModeType fillMode; -/** +/*! + @property bitrate @abstract 导出视频的码率,如果设置为 0,内部会根据 outputVideoSize 选择适当的码率值。默认:0 @since v1.16.0 */ @property (assign, nonatomic) NSInteger bitrate; -/** +/*! + @property completionBlock @abstract 视频合并完成的 block @since v1.10.0 */ @property (copy, nonatomic) void(^completionBlock)(NSURL *url); -/** +/*! + @property failureBlock @abstract 视频合并失败的 block @since v1.10.0 */ @property (copy, nonatomic) void(^failureBlock)(NSError* error); -/** +/*! + @property processingBlock @abstract 视频合并进度的 block,可在该 block 中刷新进度条 UI @since v1.10.0 */ @property (copy, nonatomic) void(^processingBlock)(float progress); -/** +/*! + @method initWithRangeMedia: @brief 初始化 + @param medias 待合并的视频文件 + + @return PLSRangeMovieExport 实例 @since v1.10.0 */ - (instancetype)initWithRangeMedia:(NSArray *)medias; -/** +/*! + @method startExport @brief 执行视频合并 @since v1.10.0 */ - (void)startExport; -/** +/*! + @method stopExport @brief 停止视频合并 @since v1.10.0 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSReverserEffect.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSReverserEffect.h similarity index 83% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSReverserEffect.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSReverserEffect.h index eed61319..bd991258 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSReverserEffect.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSReverserEffect.h @@ -9,63 +9,74 @@ #import #import -/** +/*! + @class PLSReverserEffect @brief 时光倒流处理核心类 @since v1.5.0 */ @interface PLSReverserEffect : NSObject -/** +/*! + @property completionBlock @abstract 时光倒流完成的 Block @since v1.5.0 */ @property (copy, nonatomic) void(^completionBlock)(NSURL *url); -/** +/*! + @property failureBlock @abstract 时光倒流失败的 Block @since v1.5.0 */ @property (copy, nonatomic) void(^failureBlock)(NSError *error); -/** +/*! + @property processingBlock @abstract 时光倒流进度的 Block,可在该 Block 中刷新倒序进度条 UI @since v1.5.0 */ @property (copy, nonatomic) void(^processingBlock)(float progress); -/** +/*! + @property isReversing @brief PLSReverserEffect 处于执行时光倒流状态时为 YES @since v1.5.0 */ @property (readonly, nonatomic) BOOL isReversing; -/** +/*! + @property audioRemoved @brief audioRemoved 是否去掉音频,默认为 YES,即去掉音频。当设置为 NO 时,维持原音频,即不对音频进行倒序处理。 @since v1.14.0 */ @property (assign, nonatomic, getter=isAudioRemoved) BOOL audioRemoved; -/** +/*! + @method initWithAsset: @brief 初始化 + @param asset 原视频文件 + @since v1.5.0 */ - (instancetype)initWithAsset:(AVAsset *)asset; -/** +/*! + @method startReversing @abstract 执行时光倒流 @since v1.5.0 */ - (void)startReversing; -/** +/*! + @method cancelReversing @abstract 取消时光倒流 @since v1.5.0 diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRotateTransition.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRotateTransition.h new file mode 100644 index 00000000..a3f713b5 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSRotateTransition.h @@ -0,0 +1,36 @@ +// +// PLSRotateTransition.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/1/17. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import "PLSTransition.h" + +/*! + @class PLSRotateTransition + @brief 旋转动画类 + + @since v1.10.0 + */ +@interface PLSRotateTransition : PLSTransition + +/*! + @property fromAngle + @brief 旋转起始角度(-2*M_PI ~ 2*M_PI) + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat fromAngle; + + +/*! + @property toAngle + @brief 旋转结束角度(-2*M_PI ~ 2*M_PI) + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat toAngle; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSScaleTransition.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSScaleTransition.h new file mode 100644 index 00000000..0bb9a2d5 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSScaleTransition.h @@ -0,0 +1,37 @@ +// +// PLSScaleTransition.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/1/17. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import "PLSTransition.h" + +/*! + @class PLSScaleTransition + @brief 缩放动画类 + + @since v1.10.0 + */ +@interface PLSScaleTransition : PLSTransition + +/*! + @property fromScale + @brief 放大或者缩小的起始值 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat fromScale; + +/*! + @property toScale + @brief 放大或者缩小的结束值 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat toScale; + + + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTextSetting.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTextSetting.h new file mode 100644 index 00000000..b72a9854 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTextSetting.h @@ -0,0 +1,67 @@ +// +// PLSTextSetting.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/1/17. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import + +/*! + @class PLSTextSetting + @brief 转场动画文字设置 + + @since v1.10.0 + */ +@interface PLSTextSetting : NSObject + +/*! + @property text + @brief 内容 + + @since v1.10.0 + */ +@property (nonatomic, copy) NSString *text; + +/*! + @property textFont + @brief 文字字体 + + @since v1.10.0 + */ +@property (nonatomic, strong) UIFont *textFont; + +/*! + @property textColor + @brief 文字颜色 + + @since v1.10.0 + */ +@property (nonatomic, strong) UIColor *textColor; + +/*! + @property textSize + @brief 内容所占区域大小 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGSize textSize; + +/*! + @property startX + @brief 文字所占区域的起始x位置,相对于PLSVideoSetting中设置的width的偏移像素 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat startX; + +/*! + @property startY + @brief 文字所占区域的起始Y位置,相对于PLSVideoSetting中设置的height的偏移像素 + + @since v1.10.0 + */ +@property (nonatomic, assign) CGFloat startY; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransition.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransition.h new file mode 100644 index 00000000..12ed3684 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransition.h @@ -0,0 +1,47 @@ +// +// PLSTransition.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/1/17. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import + +/*! + @class PLSTransition + @brief 转场动画类 + + @since v1.10.0 + */ +@interface PLSTransition : NSObject + +/*! + @property durationInMs + @brief 动画时长,毫秒 + + @since v1.10.0 + */ +@property (nonatomic, assign) double durationInMs; + +/*! + @property startTimeInMs + @brief 动画开始时间,毫秒 + + @since v1.10.0 + */ +@property (nonatomic, assign) double startTimeInMs; + +/*! + @method animationWithScale: + @abstract 根据配置的参数,返回一个CAAnimation对象,预览view的尺寸和导出视频的尺寸不一样的时候,为了能让预览效果达到和导出视频一样效果,需要对动画的位置等做比例缩放 + @param scale 如果CAAnimation用于预览,sacel = 预览view的width / 导出视频的width + 如果CAAnimation用于生产最终视频,scale = 背景视频的width / 导出视频的width + + @return CAAnimation 实例 + @since v1.10.0 + */ +- (CAAnimation *)animationWithScale:(CGFloat)scale; + + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h new file mode 100644 index 00000000..a9aff670 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTransitionMaker.h @@ -0,0 +1,240 @@ +// +// PLSTransitionMaker.h +// PLShortVideoKit +// +// Created by hxiongan on 2018/1/17. +// Copyright © 2018年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import "PLSImageSetting.h" +#import "PLSTextSetting.h" +#import "PLSTransition.h" + +#define INVALID_RESOURCEID (0) + +@class PLSTransitionMaker; + +/*! + @protocol PLSTransitionMakerDelegate + @brief 转场动画制作协议 + + @since v1.10.0 + */ +@protocol PLSTransitionMakerDelegate +< +NSObject +> +@optional + +/*! + @method transitionMakerPreviewEnd: + @abstract 预览结束会回调 + + @param transitionMaker PLSTransitionMaker 实例 + + @since v1.10.0 + */ +- (void)transitionMakerPreviewEnd:(PLSTransitionMaker *)transitionMaker; + +/*! + @method transitionMaker:exportMediaSucceed: + @abstract 文字转视频成功回调, + + @param transitionMaker PLSTransitionMaker 实例 + @param outURL 存放导出视频的url + + @since v1.10.0 + */ +- (void)transitionMaker:(PLSTransitionMaker *)transitionMaker exportMediaSucceed:(NSURL *)outURL; + +/*! + @method transitionMaker:exportMediaFailed: + @abstract 文字转视频失败回调 + + @param transitionMaker PLSTransitionMaker 实例 + @param error 导出视频错误信息 + + @since v1.10.0 + */ +- (void)transitionMaker:(PLSTransitionMaker *)transitionMaker exportMediaFailed:(NSError *)error; + +@end + + +/*! + @class PLSTransitionMaker + @brief 转场动画制作类 + + @since v1.10.0 + */ +@interface PLSTransitionMaker : NSObject + +/*! + @property outPixelSize + @brief 生成视频的宽高,建议和背景视频宽高比例保持一致. must set + + @since v1.10.0 + */ +@property (nonatomic, assign) CGSize outPixelSize; + +/*! + @property outFrameRate + @brief 生成视频的帧率,= 0时,将使用背景视频的frameRate + + @since v1.10.0 + */ +@property (nonatomic, assign) float outFrameRate; + +/*! + @property backgroundColor + @brief 生成视频底色, default: nil + + @since v1.10.0 + */ +@property (nonatomic, strong) UIColor *backgroundColor; + +/*! + @property totalDuration + @brief 视频总时长, default: 2.5s + + @since v1.10.0 + */ +@property (nonatomic, assign) double totalDuration; + +/*! + @property delegate + @brief 代理 + + @since v1.10.0 + */ +@property (nonatomic, weak) id delegate; + +/*! + @property exportProgressBlock + @brief 生成视频进度 block 回调 + + @since v1.10.0 + */ +@property (copy, nonatomic) void(^exportProgressBlock)(CGFloat progress); + +/*! + @property preview + @brief 预览view + + @since v1.10.0 + */ +@property (nonatomic, readonly) UIView *preview; + +/*! + @property backgroundVideoURL + @brief 背景视频的URL(提供一个纯白或纯黑的视频作为文字的背景) + + @since v1.10.0 + */ +@property (nonatomic, strong) NSURL *backgroundVideoURL; + +/*! + @property outputVideoURL + @brief 最终生成的视频的存放URL + + @since v1.10.0 + */ +@property (nonatomic, strong) NSURL *outputVideoURL; + +/*! + @method addText: + @abstract 添加PLSTextSetting + + @param textSetting 要添加的实例 + + @return 返回唯一的resourceID编号,后面更新此textSetting的时候,带上返回的编号 + @since v1.10.0 + */ +- (NSInteger)addText:(PLSTextSetting *)textSetting; + +/*! + @method addImage: + @abstract 添加PLSImageSetting + + @param imageSetting 要添加的实例 + + @return 返回唯一的resourceID编号,后面更新此imageSetting的时候,带上返回的编号 + @since v1.10.0 + */ +- (NSInteger)addImage:(PLSImageSetting *)imageSetting; + +/*! + @method addTransition:resourceID: + @abstract 添加PLSTransition到知道资源 + + @param transition 要添加的动画 + @param resourceID 动画作用的资源编号 + + @since v1.10.0 + */ +- (void)addTransition:(PLSTransition *)transition resourceID:(NSInteger)resourceID; + +/*! + @method updateTextWithResourceID:newTextSetting: + @abstract 更新textsetting + + @param resourceID 更新的PLSTextSetting编号 + @param textSetting 新的PLSTextSetting实例,如果为nil,则执行删除resourceID操作 + + @since v1.10.0 + */ +- (void)updateTextWithResourceID:(NSInteger)resourceID newTextSetting:(PLSTextSetting *)textSetting; + +/*! + @method updateImageWithResourceID:newImageSetting: + @abstract 更新imageSetting + + @param resourceID 更新的PLSImageSetting编号 + @param imageSetting 新的PLSImageSetting实例,如果为nil,则执行删除resourceID操作 + + @since v1.10.0 + */ +- (void)updateImageWithResourceID:(NSInteger)resourceID newImageSetting:(PLSImageSetting *)imageSetting; + +/*! + @method removeAllResource + @abstract 删除所有文字和图片 + + @since v1.10.0 + */ +- (void)removeAllResource; + +/*! + @method play + @abstract 播放 + + @since v1.10.0 + */ +- (void)play; + +/*! + @method stop + @abstract 停止播放 + + @since v1.10.0 + */ +- (void)stop; + +/*! + @method startMaking + @abstract 开始制作视频 + + @since v1.10.0 + */ +- (void)startMaking; + +/*! + @method cancelMaking + @abstract 取消视频制作 + + @since v1.10.0 + */ +- (void)cancelMaking; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTypeDefines.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTypeDefines.h new file mode 100644 index 00000000..fffd7a69 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSTypeDefines.h @@ -0,0 +1,371 @@ +// +// PLSTypeDefines.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/1. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#ifndef PLCameraStreamingKit_PLTypeDefines_h +#define PLCameraStreamingKit_PLTypeDefines_h + +#import +#import + +#if defined(__cplusplus) +#define PLS_EXPORT extern "C" +#else +#define PLS_EXPORT extern +#endif + + +// post with userinfo @{@"state": @(state)}. always posted via MainQueue. +extern NSString *PLSCameraAuthorizationStatusDidGetNotificaiton; +extern NSString *PLSMicrophoneAuthorizationStatusDidGetNotificaiton; + +extern NSString *PLSCameraDidStartRunningNotificaiton; +extern NSString *PLSMicrophoneDidStartRunningNotificaiton; + +/*! + @typedef PLSAuthorizationStatus + @abstract 设备授权状态。 + + @since v1.0.0 + */ +typedef enum { + /// 还没有确定是否授权 + PLSAuthorizationStatusNotDetermined = 0, + /// 设备受限,一般在家长模式下设备会受限 + PLSAuthorizationStatusRestricted, + /// 拒绝授权 + PLSAuthorizationStatusDenied, + /// 已授权 + PLSAuthorizationStatusAuthorized +} PLSAuthorizationStatus; + +/*! + @typedef PLSVideoFillModeType + @abstract 视频预览填充模式。 + + @since v1.0.0 + */ +typedef enum { + /// Stretch to fill the full view, which may distort the image outside of its normal aspect ratio + PLSVideoFillModeStretch, + + /// Maintains the aspect ratio of the source image, adding bars of the specified background color + PLSVideoFillModePreserveAspectRatio, + + /// Maintains the aspect ratio of the source image, zooming in on its center to fill the view + PLSVideoFillModePreserveAspectRatioAndFill +} PLSVideoFillModeType; + +/*! + @typedef PLSPreviewOrientation + @abstract 预览视图的方向。 + + @since v1.3.0 + */ +typedef enum { + PLSPreviewOrientationPortrait = 0, + PLSPreviewOrientationPortraitUpsideDown = 1, + PLSPreviewOrientationLandscapeRight = 2, + PLSPreviewOrientationLandscapeLeft = 3, +} PLSPreviewOrientation; + +/*! + @typedef PLSVideoRecoderRateType + @abstract 视频拍摄速率。 + + @since v1.4.0 + */ +typedef enum { + /** + @brief Maintains the video recoder rate normal, 1x + */ + PLSVideoRecoderRateNormal = 0, + + /** + @brief Maintains the video recoder rate slow, 0.667x + */ + PLSVideoRecoderRateSlow, + + /** + @brief Maintains the video recoder rate very slow, 0.5x + */ + PLSVideoRecoderRateTopSlow, + + /** + @brief Maintains the video recoder rate fast, 1.5x + */ + PLSVideoRecoderRateFast, + + /** + @brief Maintains the video recoder rate very fast, 2x + */ + PLSVideoRecoderRateTopFast + +} PLSVideoRecoderRateType; + +#pragma mark - Audio SampleRate + +/*! + @typedef PLSAudioSampleRate + @abstract 音频编码采样率。 + + @discussion 音频编码采样率 和 音频编码的码率直接相关。下表为码率推荐表: + + |================================================================|
+ | 采样率 Hz | 推荐码率(单声道)bps | 推荐码率 (双声道) bps |
+ |================================================================|
+ | 48000 | 64*1000 | 128*1000 |
+ |----------------------------------------------------------------|
+ | 44100 | 64*1000 | 128*1000 |
+ |----------------------------------------------------------------|
+ | 22050 | 32*1000 | 64*1000 |
+ |----------------------------------------------------------------|
+ | 16000 | 32*1000 | 64*1000 |
+ |----------------------------------------------------------------|
+ | 11025 | 32*1000 | 32*1000 |
+ |----------------------------------------------------------------|
+ 更多详细的码率设置,可以参考如下网页: + http://wiki.hydrogenaud.io/index.php?title=Fraunhofer_FDK_AAC#Bitrate_Modes + + @since v1.0.0 + */ +typedef enum { + /** + @brief PLSAudioSampleRate_48000Hz 48000Hz 音频编码采样率 + */ + PLSAudioSampleRate_48000Hz = 48000, + + /** + @brief PLSAudioSampleRate_44100Hz 44100Hz 音频编码采样率 + */ + PLSAudioSampleRate_44100Hz = 44100, + + /** + @brief PLSAudioSampleRate_22050Hz 22050Hz 音频编码采样率 + */ + PLSAudioSampleRate_22050Hz = 22050, + + /** + @brief PLSAudioSampleRate_16000Hz 16000Hz 音频编码采样率 + + @since v1.16.0 + */ + PLSAudioSampleRate_16000Hz = 16000, + + /** + @brief PLSAudioSampleRate_11025Hz 11025Hz 音频编码采样率 + */ + PLSAudioSampleRate_11025Hz = 11025, + +} PLSAudioSampleRate; + +#pragma mark - Audio BitRate + +/*! + @typedef PLSAudioBitRate + @abstract 音频编码码率。 + + @since v1.0.0 + */ +typedef enum { + + /** + @brief PLSAudioBitRate_32Kbps 32Kbps 音频码率 + + @since v1.16.0 + */ + PLSAudioBitRate_32Kbps = 32000, + + /** + @brief PLSAudioBitRate_64Kbps 64Kbps 音频码率 + */ + PLSAudioBitRate_64Kbps = 64000, + + /** + @brief PLSAudioBitRate_96Kbps 96Kbps 音频码率 + */ + PLSAudioBitRate_96Kbps = 96000, + + /** + @brief PLSAudioBitRate_128Kbps 128Kbps 音频码率 + */ + PLSAudioBitRate_128Kbps = 128000, + + /** + @brief PLSAudioBitRate_192Kbps 192Kbps 音频码率 + */ + PLSAudioBitRate_192Kbps = 192000, + + /** + @brief PLSAudioBitRate_256Kbps 256Kbps 音频码率 + + @since v1.16.0 + */ + PLSAudioBitRate_256Kbps = 256000, + +} PLSAudioBitRate; + +#pragma mark - Video File Type + +/*! + @typedef PLSFileType + + @abstract 视频格式 + + @since v1.0.5 + */ +typedef enum { + PLSFileTypeMPEG4, // .mp4 + PLSFileTypeQuickTimeMovie, // .mov + PLSFileTypeM4A, // .m4a +} PLSFileType; + +#pragma mark - Video File Preset + +/*! + @typedef PLSFilePreset + + @abstract 视频分辨率 + + @since v1.0.5 + */ +typedef enum { + PLSFilePresetLowQuality, + PLSFilePresetMediumQuality, + PLSFilePresetHighestQuality, + PLSFilePreset640x480, + PLSFilePreset960x540, + PLSFilePreset1280x720, + PLSFilePreset1920x1080, +} PLSFilePreset; + +#pragma mark - Video File Transition Animation + +/*! + @typedef PLSTransitionType + + @abstract 视频转场动画效果 + + @since v1.7.0 + */ +typedef enum { + PLSTransitionTypeFade = 0, // 淡入淡出 +} PLSTransitionType; + +/*! + @typedef PLSComposerPriorityType + + @abstract 多个视频拼接的时候,采用的拼接策略: 由于视频文件的音频通道和视频通道时长不一定相等(其实总是不相等,只是相差时间很短), + 在多个视频拼接为一个视频的时候,音视频通道的总时长相差会变大,这可能不是开发者想要的结果。因此提供几种模式供开发者选择 + + @since v1.14.0 + */ +typedef enum { + + /** + @brief 以拼接之后,单个视频时间段内音视频同步优先,这是默认模式:这种模式的好处是无论拼接多少个文件,总是能保证拼 + 接后的文件音视频是同步的,不好之处是拼接处可能会有音频的卡顿 + */ + PLSComposerPriorityTypeSync = 0, + + /** + @brief 以拼接之后,音视频播放连续性优先:这种模式的好处是无论拼接多少个文件,总是能保证拼接后的文件播放是流畅的, + 不好之处是可能引起音视频不同步 + */ + PLSComposerPriorityTypeSmooth, + + /** + @brief 以拼接的文件视频通道长度为准,当参与拼接文件的音频通道时长比视频通道时长长的时候,将多出的音频数据丢弃掉。 + 当视音频通道时长比视频通道时长短的视频,则将音频通道补齐和视频通道一样长。当一段视频中,音频数据和视频数据时长相 + 差较大(超过 0.1 秒)时,不建议使用这种模式 + + @since v1.16.0 + */ + PLSComposerPriorityTypeVideo, + + /** + @brief 以拼接的文件音频通道长度为准,当参与拼接文件的视频通道时长比音频通道时长长的时候,将多出的视频数据丢弃掉。 + 当视频通道时长比音频通道时长短的视频,则将视频通道补齐和音频通道一样长。当一段视频中,音频数据和视频数据时长相差 + 较大(超过 0.1 秒)时,不建议使用这种模式 + + @since v1.16.0 + */ + PLSComposerPriorityTypeAudio, +} PLSComposerPriorityType; + +/*! + @typedef PLSWaterMarkType + + @abstract 水印的类型 + + @since v1.15.0 + */ +typedef enum { + + // 静态水印,比如:PNG、JPG 等静态图片 + PLSWaterMarkTypeStatic = 0, + + // GIF 水印 + PLSWaterMarkTypeGif, +} PLSWaterMarkType; + +/*! + @typedef PLSMediaType + + @abstract 媒体类型 + + @since v1.16.0 + */ +typedef enum { + + // 图片 + PLSMediaTypeImage = 0, + // 视频 + PLSMediaTypeVideo, + // GIF + PLSMediaTypeGIF, +} PLSMediaType; + + +/*! + @typedef PLShortVideoLogLevel + @abstract 短视频日志级别。 + @since v2.1.0 + */ +typedef enum { + // No logs + PLShortVideoLogLevelOff = 0, + // Error logs only + PLShortVideoLogLevelError, + // Error and warning logs + PLShortVideoLogLevelWarning, + // Error, warning and info logs + PLShortVideoLogLevelInfo, + // Error, warning, info and debug logs + PLShortVideoLogLevelDebug, + // Error, warning, info, debug and verbose logs + PLShortVideoLogLevelVerbose, +} PLShortVideoLogLevel; + + +/*! + @typedef PLSAuthenticationResult + @abstract SDK 授权状态查询。 + @since v1.16.1 + */ +typedef enum { + // 还没有确定是否授权 + PLSAuthenticationResultNotDetermined = 0, + // 未授权 + PLSAuthenticationResultDenied, + // 已成功 + PLSAuthenticationResultAuthorized +} PLSAuthenticationResult; + +#endif + + diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h new file mode 100644 index 00000000..7ecb4a55 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderConfiguration.h @@ -0,0 +1,110 @@ +// +// PLSUploaderConfiguration.h +// PLShortVideoKit +// +// Created by 何昊宇 on 2017/6/8. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import + +/*! + @class PLSUploaderConfiguration + @brief 上传的参数配置类 + */ +@interface PLSUploaderConfiguration : NSObject + +/*! + @property token + @brief 上传视频空间 token + + @since v1.0.4 + */ +@property (nonatomic, strong)NSString * _Nonnull token; + +/*! + @property videoKey + @brief 上传视频空间设置的 key,默认为当前上传视频文件的 hash 值 + + @since v1.0.4 + */ +@property (nonatomic, strong)NSString * _Nullable videoKey; + +/*! + @property https + @brief 上传视频空间是否需要设置为 https 上传, YES 为 https 上传,NO 为 http 上传,默认为 YES + + @since v1.0.4 + */ +@property (nonatomic, assign, getter=isHttps)BOOL https; + +/*! + @property recorder + @brief 断点续传文件记录 + @discussion 默认为 Documents 下 PLShortVideoUploaderRecorder, 即:Documents/PLShortVideoUploaderRecorder + @warning 断点续上传要求:1 文件本身内容不发生变化 + 3 上传视频空间设置的 key , 即 videoKey 与 recorder 中一致 + 4 上传到的 bucket 为原 bucket + + @since v1.0.5 + */ +@property (nonatomic, strong)NSString * _Nullable recorder; + +/*! + @property params + @brief 上传视频空间设置的 key,默认为当前上传视频文件的 hash 值 + + @since v1.0.4 + */ +@property (nonatomic, strong)NSDictionary * _Nullable params; + +/*! + @method initWithToken:videoKeyhttps:recorder + @abstract PLSUploaderConfiguration 初始化方法 + @warning token 必填,不能为空 + + @param token 上传的 token 值 + @param videoKey 上传的 key 值 + @param https 是否使用 https 上传 + @param recorder 断点记录 + + @return PLSUploaderConfiguration 实例 + @since v1.0.4 + */ +- (instancetype _Nullable)initWithToken:(NSString * _Nonnull)token + videoKey:(NSString * _Nullable)videoKey + https:(BOOL)https + recorder:(NSString * _Nullable)recorder; +/*! + @method defaultWithToken: + @abstract 使用默认配置生成一个 PLSUploaderConfiguration 对象 + @discussion 调用此方法,除 token 之外,其他值均为默认值 + + @param token 上传的 token 值 + + @return PLSUploaderConfiguration 实例 + @since v1.0.4 + */ ++ (instancetype _Nullable)defaultWithToken:(NSString * _Nonnull)token; + +/*! + @method initWithToken:videoKey:https:recorder:params + @abstract PLSUploaderConfiguration 初始化方法 + @warning token 必填,不能为空 + + @param token 上传的 token 值 + @param videoKey 上传的 key 值 + @param https 是否使用 https 上传 + @param recorder 断点记录 + @param params 上传参数 + + @return PLSUploaderConfiguration 实例 + @since v1.0.4 + */ +- (instancetype _Nullable)initWithToken:(NSString * _Nonnull)token + videoKey:(NSString * _Nullable)videoKey + https:(BOOL)https + recorder:(NSString * _Nullable)recorder + params:(NSDictionary * _Nullable)params; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h new file mode 100644 index 00000000..7e5c69fe --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSUploaderResponseInfo.h @@ -0,0 +1,124 @@ +// +// PLSUploaderResponInfo.h +// PLShortVideoKit +// +// Created by 何昊宇 on 2017/6/8. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +/*! + @class PLSUploaderResponseInfo + @brief 上传完成的反馈信息 + */ +@interface PLSUploaderResponseInfo : NSObject +/*! + @property statusCode + @brief 状态码 + */ +@property (readonly) int statusCode; + +/*! + @property reqId + @brief 七牛服务器生成的请求ID,用来跟踪请求信息,如果使用过程中出现问题,请反馈此ID + */ +@property (nonatomic, copy, readonly) NSString * _Nullable reqId; + +/*! + @property xlog + @brief 七牛服务器内部跟踪记录 + */ +@property (nonatomic, copy, readonly) NSString * _Nullable xlog; + +/*! + @property xvia + @brief cdn服务器内部跟踪记录 + */ +@property (nonatomic, copy, readonly) NSString * _Nullable xvia; + +/*! + @property error + @brief 错误信息,出错时请反馈此记录 + */ +@property (nonatomic, copy, readonly) NSError * _Nullable error; + +/*! + @property host + @brief 服务器域名 + */ +@property (nonatomic, copy, readonly) NSString * _Nullable host; + +/*! + @property duration + @brief 请求消耗的时间,单位 秒 + */ +@property (nonatomic, readonly) double duration; + +/*! + @property serverIp + @brief 服务器IP + */ +@property (nonatomic, readonly) NSString * _Nullable serverIp; + +/*! + @property id + @brief 客户端id + */ +@property (nonatomic, readonly) NSString * _Nullable id; + +/*! + @property timeStamp + @brief 时间戳 + */ +@property (readonly) UInt64 timeStamp; + +/*! + @property canceled + @brief 是否取消 + */ +@property (nonatomic, readonly, getter=isCancelled) BOOL canceled; + +/*! + @property ok + @brief 成功的请求 + */ +@property (nonatomic, readonly, getter=isOK) BOOL ok; + +/*! + @property broken + @brief 是否网络错误 + */ +@property (nonatomic, readonly, getter=isConnectionBroken) BOOL broken; + +/*! + @property notQiniu + @brief 是否为 七牛响应 + */ +@property (nonatomic, readonly, getter=isNotQiniu) BOOL notQiniu; + +/*! + @method initWithStatusCode:reqId:xlog:xvia:error:host:duration:serverIp:id:timeStamp:canceled:ok:broken:notQiniu: + @abstract PLSUploaderResponInfo 初始化方法 + + @return PLSUploaderResponseInfo 实例 + @since v1.0.4 + */ + +- (instancetype _Nullable)initWithStatusCode:(int)statusCode + reqId:(NSString *_Nullable)reqId + xlog:(NSString *_Nullable)xlog + xvia:(NSString *_Nullable)xvia + error:(NSError *_Nullable)error + host:(NSString *_Nullable)host + duration:(double)duration + serverIp:(NSString *_Nullable)serverIp + id:(NSString *_Nullable)id + timeStamp:(UInt64)timeStamp + canceled:(BOOL)canceled + ok:(BOOL)ok + broken:(BOOL)broken + notQiniu:(BOOL)notQiniu; + + + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h new file mode 100644 index 00000000..93bf371a --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoConfiguration.h @@ -0,0 +1,138 @@ +// +// PLSVideoConfiguration.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/1. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import + +/*! + @class PLSVideoConfiguration + @brief 采集和录制文件编码视频参数配置类 + + @since v1.0.0 + */ +@interface PLSVideoConfiguration : NSObject + +/*! + @property videoFrameRate + @brief 采集的视频数据的帧率,默认为 25 + + @since v1.0.0 + */ +@property (assign, nonatomic) NSUInteger videoFrameRate; + +/*! + @property sessionPreset + @brief 采集的视频的 sessionPreset,默认为 AVCaptureSessionPreset1280x720 + + @since v1.0.0 + */ +@property (strong, nonatomic) NSString *sessionPreset; + +/*! + @property previewMirrorFrontFacing + @brief 前置预览是否开启镜像,默认为 YES + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL previewMirrorFrontFacing; + +/*! + @property previewMirrorRearFacing + @brief 后置预览是否开启镜像,默认为 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL previewMirrorRearFacing; + +/*! + @property streamMirrorFrontFacing + @brief 前置摄像头,录制的流是否开启镜像,默认 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL streamMirrorFrontFacing; + +/*! + @property streamMirrorRearFacing + @brief 后置摄像头,录制的流是否开启镜像,默认 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL streamMirrorRearFacing; + +/*! + @property position + @brief 开启 camera 时的采集摄像头位置,默认为 AVCaptureDevicePositionBack + + @since v1.0.0 + */ +@property (assign, nonatomic) AVCaptureDevicePosition position; + +/*! + @property videoOrientation + @brief 开启 camera 时的采集摄像头的旋转方向,默认为 AVCaptureVideoOrientationPortrait + + @since v1.0.0 + */ +@property (assign, nonatomic) AVCaptureVideoOrientation videoOrientation; + +/*! + @property videoSize + @abstract 编码时的视频分辨率,默认 (480, 854) + + @discussion 需要注意的是,这个参数影响的是视频编码时的分辨率,而非摄像头采集到数据的预览大小,传递给编码器的图像尺寸与此尺寸不同时,会按照 AVVideoScalingModeResizeAspectFill + 对图像做剪切,从而确保图像不会出现压缩的现象。 + + @since v1.0.0 + */ +@property (assign, nonatomic) CGSize videoSize; + +/*! + @property averageVideoBitRate + @abstract 平均视频编码码率。默认为 1024*1000 + + @discussion 单位为 bps(Bits per Second)。该参数的视频编码实际过程中,并不是恒定的数值,所以只能设定平均视频编码码率。 + + @since v1.0.0 + */ +@property (nonatomic, assign) NSUInteger averageVideoBitRate; + +/*! + @property videoMaxKeyframeInterval + @abstract 视频编码关键帧最大间隔(GOP)。 + + @discussion h.264 编码时,两个关键帧之间间隔的最多的帧数,一般为 fps 的两倍或者三倍。默认为 2*fps + + @since v1.0.0 + */ +@property (nonatomic, assign) NSUInteger videoMaxKeyframeInterval; + +/*! + @property videoProfileLevel + @abstract H.264 编码时使用的 Profile Level。 + + @discussion 默认情况下使用 AVVideoProfileLevelH264HighAutoLevel,如果对于视频编码有额外的需求并且知晓该参数带来的影响可以自行更改。 + + @warning 当你不清楚该参数更改对分辨率要求,码率等影响时,请不要随意更改。 + + @since v1.0.0 + */ +@property (nonatomic, copy) NSString *videoProfileLevel; + +/*! + @method defaultConfiguration + @brief 创建一个默认配置的 PLSVideoConfiguration 实例. + + @return 创建的默认 PLSVideoConfiguration 对象 + + @since v1.0.0 + */ ++ (instancetype)defaultConfiguration; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h similarity index 95% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h index 80ef8e1a..292a1b6f 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixConfiguration.h @@ -7,12 +7,13 @@ // #import "PLSVideoConfiguration.h" -/** +/*! + * @class PLSVideoMixConfiguration * @abstract 双屏录制的视频设置类, videoSize 的默认值为(720, 640). averageVideoBitRate 的默认值为 1024*2000 */ @interface PLSVideoMixConfiguration : PLSVideoConfiguration -/** +/*! @property cameraVideoFrame @abstract 相机采集视频占最终合并视频的frame,相对于videoSize。默认 (0, 0, 360, 640) @@ -22,7 +23,7 @@ */ @property (assign, nonatomic) CGRect cameraVideoFrame; -/** +/*! @property sampleVideoFrame @abstract 素材视频占最终合并视频的frame,相对于videoSize。 默认 (360, 0, 360, 640) @@ -32,7 +33,8 @@ */ @property (assign, nonatomic) CGRect sampleVideoFrame; -/** +/*! + @method defaultConfiguration @brief 创建一个默认配置的 PLSVideoMixConfiguration 实例. @return 创建的默认 PLSVideoMixConfiguration 对象 diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h similarity index 66% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h index 69481a01..1acdd588 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLSVideoMixRecorder.h @@ -14,107 +14,165 @@ #import "PLSTypeDefines.h" @class PLSVideoMixRecorder; + +/*! + @protocol PLSVideoMixRecordererDelegate + @brief 分屏视频录制协议 + + @since v1.11.0 + */ @protocol PLSVideoMixRecordererDelegate @optional #pragma mark -- 摄像头/麦克风权限变化的回调 -/** +/*! + @method videoMixRecorder:didGetCameraAuthorizationStatus: @abstract 摄像头授权状态发生变化的回调 + @param recorder PLSVideoMixRecorder 实例 + @param status 相机授权状态 + @since v1.11.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didGetCameraAuthorizationStatus:(PLSAuthorizationStatus)status; -/** +/*! + @method videoMixRecorder:didGetMicrophoneAuthorizationStatus: @abstract 麦克风授权状态发生变化的回调 + @param recorder PLSVideoMixRecorder 实例 + @param status 麦克风授权状态 + @since v1.11.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didGetMicrophoneAuthorizationStatus:(PLSAuthorizationStatus)status; #pragma mark -- 素材文件音视频信息回调 -/** +/*! + @method videoMixRecorder:didGetSampleVideoInfo:videoHeight:frameRate:duration: @abstract 素材文件的视频信息 - - @param duration 文件时长 + + @param recorder PLSVideoMixRecorder 实例 + @param videoWidth 素材文件的宽 + @param videoHeight 素材文件的高 + @param frameRate 素材文件的帧率 + @param duration 素材文件的时长 @since v1.11.0 */ -- (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didGetSampleVideoInfo:(int)videoWith videoHeight:(int)videoheight frameRate:(float)frameRate duration:(CMTime)duration; +- (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didGetSampleVideoInfo:(int)videoWidth videoHeight:(int)videoHeight frameRate:(float)frameRate duration:(CMTime)duration; #pragma mark -- 摄像头对焦位置的回调 -/** +/*! + @method videoMixRecorder:didFocusAtPoint: @abstract 摄像头对焦位置的回调 + @param recorder PLSVideoMixRecorder 实例 + @param point 相机的当前焦点 + @since v1.11.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didFocusAtPoint:(CGPoint)point; #pragma mark -- 摄像头/麦克风采集数据的回调 -/** +/*! + @method videoMixRecorder:cameraSourceDidGetPixelBuffer: @abstract 获取到摄像头原数据时的回调, 便于开发者做滤镜等处理,需要注意的是这个回调在 camera 数据的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 + @param recorder PLSVideoMixRecorder 实例 + @param pixelBuffer 相机采集到的视频帧 + @since v1.11.0 */ - (CVPixelBufferRef __nonnull)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder cameraSourceDidGetPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer; -/** - @abstract 获取到麦克风原数据时的回调,需要注意的是这个回调在 microphone 数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题 - 如果需要修改音频数据,可以直接对 audioBufferList 进行修改 +/*! + @method videoMixRecorder:microphoneSourceDidGetAudioBufferList: + @abstract 获取到麦克风原数据时的回调,需要注意的是这个回调在 microphone 数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题。如果需要修改音频数据,可以直接对 audioBufferList 进行修改 + + @param recorder PLSVideoMixRecorder 实例 + @param audioBufferList 麦克风采集到的音频帧 @since v1.13.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder microphoneSourceDidGetAudioBufferList:(AudioBufferList *__nonnull)audioBufferList; -/** +/*! + @method videoMixRecorder:microphoneSourceDidGetSampleBuffer: @abstract 获取到麦克风原数据时的回调,需要注意的是这个回调在 microphone 数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题 + @param recorder PLSVideoMixRecorder 实例 + @param sampleBuffer 麦克风采集到的音频帧 + @since v1.11.0 */ - (CMSampleBufferRef __nonnull)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder microphoneSourceDidGetSampleBuffer:(CMSampleBufferRef __nonnull)sampleBuffer __deprecated_msg("Method deprecated in v1.13.0. Use `videoMixRecorder: microphoneSourceDidGetAudioBufferList:`"); #pragma mark -- 素材视频/音频数据的回调 -/** +/*! + @method videoMixRecorder:sampleSourceDidGetPixelBuffer: @abstract 获取到素材文件原数据时的回调, 便于开发者做滤镜等处理,需要注意的是这个回调在 素材解码 的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 + @param recorder PLSVideoMixRecorder 实例 + @param pixelBuffer 获取到的素材文件的视频帧 + @since v1.11.0 */ - (CVPixelBufferRef __nonnull)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder sampleSourceDidGetPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer; -/** - @abstract 获取到素材音频数据时的回调,需要注意的是这个回调在 素材解码 数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题 - 如果需要修改音频数据,可以直接对 audioBufferList 进行修改 +/*! + @method videoMixRecorder:sampleSourceDidGetAudioBufferList: + @abstract 获取到素材音频数据时的回调,需要注意的是这个回调在 素材解码 数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题。如果需要修改音频数据,可以直接对 audioBufferList 进行修改 + + @param recorder PLSVideoMixRecorder 实例 + @param audioBufferList 获取到的素材文件的音频帧 @since v1.13.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder sampleSourceDidGetAudioBufferList:(AudioBufferList *__nonnull)audioBufferList; -/** +/*! + @method videoMixRecorder:sampleSourceDidGetSampleBuffer: @abstract 获取到素材音频数据时的回调,需要注意的是这个回调在 素材解码 数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题 + @param recorder PLSVideoMixRecorder 实例 + @param sampleBuffer 获取到的素材文件的音频帧 + @since v1.11.0 */ - (CMSampleBufferRef __nonnull)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder sampleSourceDidGetSampleBuffer:(CMSampleBufferRef __nonnull)sampleBuffer __deprecated_msg("Method deprecated in v1.13.0. Use `videoMixRecorder: sampleSourceDidGetAudioBufferList:`"); #pragma mark -- 合并之后的视频/音频数据的回调 -/** +/*! + @method videoMixRecorder:didGetMergePixelBuffer: @abstract 合并之后数据的回调, 便于开发者做滤镜等处理,需要注意的是这个回调在 合并 的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 + @param recorder PLSVideoMixRecorder 实例 + @param pixelBuffer 素材视频帧和相机采集视频帧合并之后的视频帧 + @since v1.11.0 */ - (CVPixelBufferRef __nonnull)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didGetMergePixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer; -/** +/*! + @method videoMixRecorder:didGetMergeAudioBufferList: @abstract 合并之后数据的回调, 便于开发者对音频数据做处理,需要注意的是这个回调在 合并 的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 如果需要修改音频数据,可以直接对 audioBufferList 进行修改 + @param recorder PLSVideoMixRecorder 实例 + @param audioBufferList 素材音频数据和麦克风音频数据混音之后的音频帧 + @since v1.13.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didGetMergeAudioBufferList:(AudioBufferList * __nonnull)audioBufferList; -/** +/*! + @method videoMixRecorder:didGetMergeAudioSampleBuffer: @abstract 合并之后数据的回调, 便于开发者对音频数据做处理,需要注意的是这个回调在 合并 的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 + @param recorder PLSVideoMixRecorder 实例 + @param sampleBuffer 素材音频数据和麦克风音频数据混音之后的音频帧 + @since v1.11.1 */ - (CMSampleBufferRef __nonnull)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didGetMergeAudioSampleBuffer:(CMSampleBufferRef __nonnull)sampleBuffer __deprecated_msg("Method deprecated in v1.13.0. Use `videoMixRecorder: didGetMergeAudioBufferList:`"); @@ -122,45 +180,74 @@ #pragma mark -- 视频录制动作的回调 -/** +/*! + @method videoMixRecorder:didDeleteFileAtURL:fileDuration:totalDuration: @abstract 删除了某段视频回调 + @param recorder PLSVideoMixRecorder 实例 + @param fileURL 当前删除的文件存放地址 + @param fileDuration 当前删除的文件时长 + @param totalDuration 删除当前文件之后剩余录制文件的总时长 + @since v1.15.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didDeleteFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; -/** +/*! + @method videoMixRecorder:didStartRecordingToOutputFileAtURL: @abstract 开始录制一段视频时 + @param recorder PLSVideoMixRecorder 实例 + @param fileURL 录制文件的存放地址 + @since v1.11.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didStartRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL; -/** +/*! + @method videoMixRecorder:didRecordingToOutputFileAtURL:fileDuration:totalDuration: @abstract 正在录制的过程中。在完成该段视频录制前会一直回调,可用来更新所有视频段加起来的总时长 totalDuration UI。 + @param recorder PLSVideoMixRecorder 实例 + @param fileURL 当前正在录制的文件存放地址 + @param fileDuration 当前正在录制的文件时长 + @param totalDuration 所有录制文件的总时长 + @since v1.11.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; -/** +/*! + @method videoMixRecorder:didFinishRecordingToOutputFileAtURL:fileDuration:totalDuration: @abstract 完成一段视频的录制时 + @param recorder PLSVideoMixRecorder 实例 + @param fileURL 当前录制完成的文件存放地址 + @param fileDuration 当前录制完成的文件时长 + @param totalDuration 所有录制文件的总时长 + @since v1.11.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didFinishRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; -/** +/*! + @method videoMixRecorder:didFinishSampleMediaDecoding: @abstract 素材视频解码结束。素材视频解码结束之后,代表合拍即将结束。合拍结束会调用 @selector(videoMixRecorder:didFinishRecordingToOutputFileAtURL:fileDuration:totalDuration); + @param recorder PLSVideoMixRecorder 实例 @param sampleMediaDuration 素材视频的时长 + @since v1.11.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder didFinishSampleMediaDecoding:(CMTime)sampleMediaDuration; -/** +/*! + @method videoMixRecorder:errorOccur: @abstract 发生错误回调 + @param recorder PLSVideoMixRecorder 实例 + @param error 错误信息 + @since v1.11.0 */ - (void)videoMixRecorder:(PLSVideoMixRecorder *__nonnull)recorder errorOccur:(NSError *__nonnull)error; @@ -169,49 +256,56 @@ #pragma mark - basic -/** - * @abstract 分屏视频录制的核心类。 - * - * @discussion 一个 PLSVideoMixRecorder 实例会包含了对视频源、音频源的控制,并且对流的操作及流状态的返回都是通过它来完成的。 +/*! + @class PLSVideoMixRecorder + @abstract 分屏视频录制的核心类。 + + @discussion 一个 PLSVideoMixRecorder 实例会包含了对视频源、音频源的控制,并且对流的操作及流状态的返回都是通过它来完成的。 */ @interface PLSVideoMixRecorder : NSObject -/** - @brief 返回代表当前会话的所有视频段文件的 asset +/*! + @method assetRepresentingAllFiles + @brief 获取代表当前会话的所有视频段文件的 asset + @return 返回代表当前会话的所有视频段文件的 asset @since v1.11.0 */ - (AVAsset *__nonnull)assetRepresentingAllFiles; -/** +/*! + @property videoConfiguration @brief 视频配置,只读 @since v1.11.0 */ @property (strong, nonatomic, readonly) PLSVideoMixConfiguration *__nonnull videoConfiguration; -/** +/*! + @property audioConfiguration @brief 音频配置,只读 @since v1.11.0 */ @property (strong, nonatomic, readonly) PLSAudioMixConfiguration *__nonnull audioConfiguration; -/** +/*! + @property previewView @brief camera 预览视图 @since v1.11.0 */ @property (strong, nonatomic, readonly) UIView *__nullable previewView; -/** +/*! + @property delegate @brief 代理对象 @since v1.11.0 */ @property (weak, nonatomic) id __nullable delegate; -/** +/*! @property delegateQueue @abstract 触发代理对象回调时所在的任务队列。 @@ -225,123 +319,136 @@ */ @property (strong, nonatomic) dispatch_queue_t __nullable delegateQueue; -/** +/*! + @property fillMode @brief previewView 中视频的填充方式,默认使用 PLVideoFillModePreserveAspectRatioAndFill @since v1.11.0 */ @property (readwrite, nonatomic) PLSVideoFillModeType fillMode; -/** +/*! + @property isRecording @brief PLSVideoMixRecorder 处于录制状态时为 true @since v1.11.0 */ @property (readonly, nonatomic) BOOL isRecording; -/** +/*! + @property outputFileType @brief 视频的文件类型,默认为 PLSFileTypeMPEG4(.mp4) @since v1.11.0 */ @property (assign, nonatomic) PLSFileType outputFileType; -/** +/*! + @method initWithVideoConfiguration:audioConfiguration: @abstract 初始化方法 -@param videoConfiguration 不能为空 -@param audioConfiguration 不能为空 + @param videoConfiguration 不能为空 + @param audioConfiguration 不能为空 -@since v1.11.0 + @return PLSVideoMixRecorder 实例 + @since v1.11.0 */ - (nonnull instancetype)initWithVideoConfiguration:(PLSVideoMixConfiguration *__nonnull)videoConfiguration audioConfiguration:(PLSAudioMixConfiguration *__nonnull)audioConfiguration; -/** +/*! + @property mergeVideoURL @brief 素材视频地址,必须设置。 正在录制的时候,不可设置。 如果设置之前已经存在录制文件,需要调用 resetRecording 方法将状态重置为初始状态 @since v1.11.0 */ @property (strong, nonatomic) NSURL *__nonnull mergeVideoURL; -/** +/*! + @property backgroundMonitorEnable @abstract 默认为 YES,即 SDK 内部根据监听到的 Application 前后台状态自动停止和开始录制视频 - @warning 设置为 YES 时,即 Application 进入后台,若当前为拍摄视频状态,SDK 内部会自动停止视频的录制,恢复到前台,SDK 内部自动启动视频的录制; - 设置为 NO 时,即 Application 进入后台,若当前为拍摄视频状态,SDK 内部会停止视频的录制,恢复到前台,SDK 内部不会自动启动视频的录制。 - 为什么设置为 NO,SDK 内部仍然要在 Application 进入后台时停止视频录制呢?原因是,开发者将该属性设置为 NO 后,可能在应用层忘记处理 - Application 进入后台时要调用 stopRecording 来停止视频的录制,进而出现 crash。所以,不管该属性是 YES 还是 NO,当 Application - 进入后台,SDK 内部都会调用 stopRecording 自动停止视频的录制。 + @warning 设置为 YES 时,即 Application 进入后台,若当前为拍摄视频状态,SDK 内部会自动停止视频的录制,恢复到前台,SDK 内部自动启动视频的录制;设置为 NO 时,即 Application 进入后台,若当前为拍摄视频状态,SDK 内部会停止视频的录制,恢复到前台,SDK 内部不会自动启动视频的录制。为什么设置为 NO,SDK 内部仍然要在 Application 进入后台时停止视频录制呢?原因是,开发者将该属性设置为 NO 后,可能在应用层忘记处理 Application 进入后台时要调用 stopRecording 来停止视频的录制,进而出现 crash。所以,不管该属性是 YES 还是 NO,当 Application进入后台,SDK 内部都会调用 stopRecording 自动停止视频的录制。 @since v1.12.0 */ @property (assign, nonatomic) BOOL backgroundMonitorEnable; -/** +/*! + @method startRecording @brief 开始录制视频,录制的视频的存放地址由 SDK 内部自动生成 @warning 获取所有录制的视频段的地址,可以使用 - (NSArray *__nullable)getAllFilesURL - @since v1.11.0 */ - (void)startRecording; -/** +/*! + @method startRecording: @brief 开始录制视频 @param fileURL 录制的视频的存放地址,该参数可以在外部设置,录制的视频会保存到该位置 - @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 - 获取所有录制的视频段的地址,可以使用 - (NSArray *__nullable)getAllFilesURL + @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。获取所有录制的视频段的地址,可以使用 - (NSArray *__nullable)getAllFilesURL @since v1.11.0 */ - (void)startRecording:(NSURL *_Nonnull)fileURL; -/** +/*! + @method stopRecording @brief 停止录制视频 @since v1.11.0 */ - (void)stopRecording; -/** +/*! + @method cancelRecording @brief 取消录制会停止视频录制并删除已经录制的视频段文件 @since v1.11.0 */ - (void)cancelRecording; -/** +/*! + @method resetRecording @brief 删除所有已经录制的视频、素材视频将seek到起始位置、在录制的时候、调用该方法会被忽略 @since v1.11.0 */ - (void)resetRecording; -/** +/*! + @method deleteLastFile @brief 删除上一个录制的视频段 @since v1.15.0 */ - (void)deleteLastFile; -/** +/*! + @method getAllFilesURL @brief 获取所有录制的视频段的地址 + @return 返回所有录制的视频段的地址 @since v1.11.0 */ - (NSArray *__nullable)getAllFilesURL; -/** +/*! + @method getFilesCount @brief 获取录制的视频段的总数目 + @return 返回录制的视频段的总数目 @since v1.11.0 */ - (NSInteger)getFilesCount; -/** +/*! + @method getTotalDuration @brief 获取所有录制的视频段加起来的总时长 + @return 返回所有录制的视频段加起来的总时长 @since v1.11.0 */ - (CGFloat)getTotalDuration; @@ -350,10 +457,14 @@ #pragma mark - Category (AudioSource) +/*! + @category PLSVideoMixRecorder (AudioSource) + @brief 录制音频参数 + */ @interface PLSVideoMixRecorder (AudioSource) - -/** +/*! + @property disableMicrophone @brief 是否禁用麦克风音频采集,正在录制的时候,设置不可用. 该属性等同于: PLSAudioMixConfiguration 的属性 disableMicrophone @@ -361,28 +472,32 @@ */ @property (assign, nonatomic) BOOL disableMicrophone; -/** +/*! + @property disableSample @brief 是否禁用素材视频的音频数据,正在录制的时候,设置不可用. 该属性等同于: PLSAudioMixConfiguration 的属性 disableSample @since v1.11.0 */ @property (assign, nonatomic) BOOL disableSample; -/** +/*! + @property microphoneVolume @brief 混音处理的时候,麦克风采集的音量大小. 该属性等同于: PLSAudioMixConfiguration 的属性 microphoneVolume @since v1.11.0 */ @property (assign, nonatomic) float microphoneVolume; -/** +/*! + @property sampleVolume @brief 混音处理的时候,素材视频的音量大小. 该属性等同于: PLSAudioMixConfiguration 的属性 sampleVolume @since v1.11.0 */ @property (assign, nonatomic) float sampleVolume; -/** +/*! + @property acousticEchoCancellationEnable @brief 麦克风采集是否启动回音消除,正在录制的时候,设置不可用. 该属性等同于: PLSAudioMixConfiguration 的属性 acousticEchoCancellationEnable @since v1.11.0 @@ -393,38 +508,40 @@ #pragma mark - Category (CameraSource) -/** - * @category PLSVideoMixRecorder(CameraSource) - * - * @discussion 与摄像头相关的接口 +/*! + @category PLSVideoMixRecorder(CameraSource) + + @brief 与摄像头相关的接口 @since v1.11.0 */ @interface PLSVideoMixRecorder (CameraSource) -/** +/*! + @property captureDevicePosition @brief default as AVCaptureDevicePositionBack @since v1.11.0 */ @property (assign, nonatomic) AVCaptureDevicePosition captureDevicePosition; -/** +/*! + @property torchOn @abstract default as NO. @since v1.11.0 */ @property (assign, nonatomic, getter=isTorchOn) BOOL torchOn; -/** - @property continuousAutofocusEnable +/*! + @property innerFocusViewShowEnable @abstract 手动对焦的视图动画。该属性默认开启。 @since v1.11.0 */ @property (assign, nonatomic) BOOL innerFocusViewShowEnable; -/** +/*! @property continuousAutofocusEnable @abstract 连续自动对焦。该属性默认开启。 @@ -432,7 +549,7 @@ */ @property (assign, nonatomic, getter=isContinuousAutofocusEnable) BOOL continuousAutofocusEnable; -/** +/*! @property touchToFocusEnable @abstract 手动点击屏幕进行对焦。该属性默认开启。 @@ -440,130 +557,162 @@ */ @property (assign, nonatomic, getter=isTouchToFocusEnable) BOOL touchToFocusEnable; -/** +/*! @property smoothAutoFocusEnabled @abstract 该属性适用于视频拍摄过程中用来减缓因自动对焦产生的镜头伸缩,使画面不因快速的对焦而产生抖动感。该属性默认开启。 */ @property (assign, nonatomic, getter=isSmoothAutoFocusEnabled) BOOL smoothAutoFocusEnabled; -/** +/*! + @property focusPointOfInterest @abstract default as (0.5, 0.5), (0,0) is top-left, (1,1) is bottom-right. @since v1.11.0 */ @property (assign, nonatomic) CGPoint focusPointOfInterest; -/** +/*! + @property videoZoomFactor @abstract 默认为 1.0,设置的数值需要小于等于 videoActiveForat.videoMaxZoomFactor,如果大于会设置失败 @since v1.11.0 */ @property (assign, nonatomic) CGFloat videoZoomFactor; -/** +/*! + @property videoFormats @brief videoFormats @since v1.11.0 */ @property (strong, nonatomic, readonly) NSArray *__nonnull videoFormats; -/** +/*! + @property videoActiveFormat @brief videoActiveFormat @since v1.11.0 */ @property (strong, nonatomic) AVCaptureDeviceFormat *__nonnull videoActiveFormat; -/** +/*! + @property sessionPreset @brief 采集的视频的 sessionPreset,默认为 AVCaptureSessionPreset1280x720 @since v1.11.0 */ @property (strong, nonatomic) NSString *__nonnull sessionPreset; -/** +/*! + @property videoFrameRate @brief 采集的视频数据的帧率,默认为 25 @since v1.11.0 */ @property (assign, nonatomic) NSUInteger videoFrameRate; -/** +/*! + @property previewMirrorFrontFacing @brief 前置预览是否开启镜像,默认为 YES @since v1.11.0 */ @property (assign, nonatomic) BOOL previewMirrorFrontFacing; -/** +/*! + @property previewMirrorRearFacing @brief 后置预览是否开启镜像,默认为 NO @since v1.11.0 */ @property (assign, nonatomic) BOOL previewMirrorRearFacing; -/** - * 前置摄像头,编码写入文件时是否开启镜像,默认 NO +/*! + @property streamMirrorFrontFacing + @brief 前置摄像头,编码写入文件时是否开启镜像,默认 NO @since v1.11.0 */ @property (assign, nonatomic) BOOL streamMirrorFrontFacing; -/** - * 后置摄像头,编码写入文件时是否开启镜像,默认 NO +/*! + @property streamMirrorRearFacing + @brief 后置摄像头,编码写入文件时是否开启镜像,默认 NO @since v1.11.0 */ @property (assign, nonatomic) BOOL streamMirrorRearFacing; -/** - * 预览的渲染队列 +/*! + @property renderQueue + @brief 预览的渲染队列 @since v1.11.0 */ @property (strong, nonatomic, readonly) dispatch_queue_t __nonnull renderQueue; -/** - * 预览的渲染 OpenGL context +/*! + @property renderContext + @brief 预览的渲染 OpenGL context @since v1.11.0 */ @property (strong, nonatomic, readonly) EAGLContext *__nonnull renderContext; -/** - * 切换前置/后置摄像头 +/*! + @method toggleCamera + @brief 切换前置/后置摄像头 */ - (void)toggleCamera; -/** - * 开启音视频采集 - * +/*! + @method toggleCamera: + @brief 切换前置/后置摄像头 + + @param completeBlock 切换相机完成回调 + + @since 2.0.0 + */ +- (void)toggleCamera:(void(^)(BOOL isFinish))completeBlock; + +/*! + @method startCaptureSession + @brief 开启音视频采集 + @since v1.11.0 */ - (void)startCaptureSession; -/** - * 停止音视频采集 - * +/*! + @method stopCaptureSession + @brief 停止音视频采集 + @since v1.11.0 */ - (void)stopCaptureSession; -/** - * 设置素材视频的起始时间点, 正在录制过程中设置无效 +/*! + @method setMergeMediaStartTime: + @brief 设置素材视频的起始时间点, 正在录制过程中设置无效 + + @param toTime 素材视频的起始时间点 @since v1.11.0 */ - (void)setMergeMediaStartTime:(CMTime)toTime; -/** - * 是否开启美颜 +/*! + @method setBeautifyModeOn: + @brief 是否开启美颜 + + @param beautifyModeOn 美颜开关 @since v1.11.0 */ -(void)setBeautifyModeOn:(BOOL)beautifyModeOn; -/** +/*! + @method setBeautify: @brief 设置对应 Beauty 的程度参数. @param beautify 范围从 0 ~ 1,0 为不美颜 @@ -572,38 +721,42 @@ */ -(void)setBeautify:(CGFloat)beautify; -/** - * 设置美白程度(注意:如果美颜不开启,设置美白程度参数无效) - * - * @param whiten 范围是从 0 ~ 1,0 为不美白 +/*! + @method setWhiten: + @brief 设置美白程度(注意:如果美颜不开启,设置美白程度参数无效) + + @param whiten 范围是从 0 ~ 1,0 为不美白 @since v1.11.0 */ -(void)setWhiten:(CGFloat)whiten; -/** - * 设置红润的程度参数.(注意:如果美颜不开启,设置美白程度参数无效) - * - * @param redden 范围是从 0 ~ 1,0 为不红润 +/*! + @method setRedden: + @brief 设置红润的程度参数.(注意:如果美颜不开启,设置美白程度参数无效) + + @param redden 范围是从 0 ~ 1,0 为不红润 @since v1.11.0 */ -(void)setRedden:(CGFloat)redden; -/** - * 开启水印 - * - * @param waterMarkImage 水印的图片 - * @param position 水印的位置 +/*! + @method setWaterMarkWithImage:position: + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 @since v1.11.0 */ -(void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position; -/** - * 移除水印 +/*! + @method clearWaterMark + @brief 移除水印 @since v1.11.0 */ diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h new file mode 100644 index 00000000..fb75125a --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoAsset.h @@ -0,0 +1,93 @@ +// +// PLShortVideoAsset.h +// PLShortVideoKit +// +// Created by 冯文秀 on 2017/9/26. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLShortVideoAsset + @brief PLShortVideoAsset 是一个处理 AVAsset 倍速播放的类 + + @since v1.6.0 + */ +@interface PLShortVideoAsset : NSObject + +/*! + @method initWithURL: + @brief 实例初始化方法 + + @param url 视频存放地址 + + @return PLShortVideoAsset 实例 + @since v1.6.0 + */ +- (instancetype _Nullable )initWithURL:(NSURL *_Nullable)url; + +/*! + @method initWithAsset: + @brief 实例初始化方法 + + @param asset 视频的 AVAsset 实例 + + @return PLShortVideoAsset 实例 + @since v1.6.0 + */ +- (instancetype _Nullable )initWithAsset:(AVAsset *_Nullable)asset; + +/*! + @method scaleTimeRange:toRateType: + @brief 返回倍速处理后的视频 + + @param timeRange 倍速处理时间段 + @param rateType 倍速处理的类型 + + @return 倍速处理后的 AVAsset 实例 + @since v1.8.0 + */ +- (AVAsset *_Nonnull)scaleTimeRange:(CMTimeRange)timeRange toRateType:(PLSVideoRecoderRateType)rateType; + +/*! + @method scaleAsset:timeRange:rateType: + @brief 返回倍速处理后的视频 + + @param sourceAsset 需要倍速处理的视频,为 nil 时,默认使用 PLShortVideoAsset 初始化传入的视频数据 + @param timeRange 倍速处理时间段 + @param rateType 倍速处理的类型 + + @return 倍速处理后的 AVAsset 实例 + @since v1.6.0 + */ +- (AVAsset *_Nonnull)scaleAsset:(AVAsset *_Nullable)sourceAsset timeRange:(CMTimeRange)timeRange rateType:(PLSVideoRecoderRateType)rateType __deprecated_msg("Method deprecated in v1.8.0. Use `scaleTimeRange: toRateType:`"); + +/*! + @method scaleTimeRanges:toRateTypes: + @brief 返回倍速处理后的视频. + + @discussion 将 timeRangeArray 第 n 个元素的 timeRange 按照 rateTypeArray 第 n 个元素的 rateType 进行变速, timeRangeArray 没有包含到的时间段按照原速处理, 两个数组的元素必须相等并且数组不能为空数组 + + @param timeRangeArray 倍速处理时间段数组,包含 NSValue(CMTimeRange) 元素的数组,时间段不能重复且单调递增 + @param rateTypeArray 倍速处理的类型数组,包含 NSNumber(PLSVideoRecoderRateType) 元素的数组 + + @return 倍速处理后的 AVAsset 实例 + @since v1.15.0 + */ +- (AVAsset *_Nonnull)scaleTimeRanges:(NSArray *)timeRangeArray toRateTypes:(NSArray *)rateTypeArray; + +/*! + @method appendAssetArray: + @brief 返回拼接好的视频 + + @param assetArray AVAsset 数组 + + @return 拼接之后的 AVAsset 实例 + @since v1.6.0 + */ +- (AVAsset *_Nonnull)appendAssetArray:(NSArray *_Nonnull)assetArray; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h new file mode 100644 index 00000000..a5af9c5e --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoEditor.h @@ -0,0 +1,439 @@ +// +// PLShortVideoEditor.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/7/10. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import "PLSEditPlayer.h" + +@class PLShortVideoEditor; +/*! + @protocol PLShortVideoEditorDelegate + @brief 视频编辑协议 + */ +@protocol PLShortVideoEditorDelegate + +@optional + +/*! + @method shortVideoEditor:didGetOriginPixelBuffer: + @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param editor PLShortVideoEditor 实例 + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef + + @since v1.5.0 + */ +- (CVPixelBufferRef)shortVideoEditor:(PLShortVideoEditor *)editor didGetOriginPixelBuffer:(CVPixelBufferRef)pixelBuffer __deprecated_msg("Method deprecated in v1.9.0. Use `shortVideoEditor: didGetOriginPixelBuffer: timestamp:`"); + +/*! + @method shortVideoEditor:didGetOriginPixelBuffer:timestamp + @brief 视频数据回调, pixelBuffer 类型为 kCVPixelFormatType_32BGRA + + @param editor PLShortVideoEditor 实例 + @param timestamp 视频帧的时间戳 + + @return 返回 kCVPixelFormatType_32BGRA 类型的 CVPixelBufferRef + + @since v1.9.0 + */ +- (CVPixelBufferRef)shortVideoEditor:(PLShortVideoEditor *)editor didGetOriginPixelBuffer:(CVPixelBufferRef)pixelBuffer timestamp:(CMTime)timestamp; + +/*! + @method shortVideoEditor:didReadyToPlayForAsset:timeRange + @brief 当前视频的播放时刻达到了视频开头 + + @param editor PLShortVideoEditor 实例 + @param asset 当前视频 + @param timeRange 当前视频的有效视频区域,对应 PLShortVideoEditor 的属性 @property (assign, nonatomic) CMTimeRange timeRange + + @since v1.9.0 + */ +- (void)shortVideoEditor:(PLShortVideoEditor *)editor didReadyToPlayForAsset:(AVAsset *)asset timeRange:(CMTimeRange)timeRange; + +/*! + @method shortVideoEditor:didReachEndForAsset:timeRange + @brief 当前视频的播放时刻达到了视频结尾 + + @param editor PLShortVideoEditor 实例 + @param asset 当前视频 + @param timeRange 当前视频的有效视频区域,对应 PLShortVideoEditor 的属性 @property (assign, nonatomic) CMTimeRange timeRange + + @since v1.9.0 + */ +- (void)shortVideoEditor:(PLShortVideoEditor *)editor didReachEndForAsset:(AVAsset *)asset timeRange:(CMTimeRange)timeRange; + +@end + +/*! + @class PLShortVideoEditor + @brief 视频编辑类 + + @since v1.1.0 + */ +@interface PLShortVideoEditor : NSObject + +/*! + @property completionBlock + @brief 编辑完成时的 block 回调 + + @since v1.1.0 + */ +@property (copy, nonatomic) void(^completionBlock)(NSURL *url); + +/*! + @property delegate + @brief 类型的代理 + + @since v1.5.0 + */ +@property (weak, nonatomic) id delegate; + +/*! + @property previewView + @brief 编辑时的预览视图 + + @since v1.5.0 + */ +@property (strong, nonatomic, readonly) UIView *previewView; + +/*! + @property fillMode + @brief 预览视图的填充方式 + + @since v1.1.0 + */ +@property (assign, nonatomic) PLSVideoFillModeType fillMode; + +/*! + @property loopEnabled + @brief 循环播放。设置为 YES,表示单曲循环。默认为 NO + + @since v1.5.0 + */ +@property (assign, nonatomic) BOOL loopEnabled; + +/*! + @property isEditing + @brief 处于编辑状态时为 YES + + @since v1.9.0 + */ +@property (assign, nonatomic, readonly) BOOL isEditing; + +/*! + @property timeRange + @brief 播放文件的 timeRange 范围内 [start, duration] 片段 + + @since v1.5.0 + */ +@property (assign, nonatomic) CMTimeRange timeRange; + +/*! + @property videoSize + @brief 通过该参数可以设置视频的预览分辨率 + + @since v1.5.0 + */ +@property (assign, nonatomic) CGSize videoSize; + +/*! + @property volume + @brief 原视频的音量 + + @since v1.5.0 + */ +@property (assign, nonatomic, readwrite) CGFloat volume; + +/*! + @property musicVolume + @brief 背景音乐的音量 + + @since v1.5.0 + */ +@property (nonatomic, readonly) CGFloat musicVolume; + +/*! + @property delayTimeForMusicToPlay + @brief 延迟背景音乐的播放,单位为毫秒,默认值为 0 + 建议使用 视频帧间隔*(视频帧率/2) * 1000 毫秒 + 比如:视频帧率为30帧/秒,延迟时间为 (1.0/30)*(30/2)*1000 = 500毫秒, + 即 delayTimeForMusicToPlay = 500 + + @since v1.8.0 + */ +@property (assign, nonatomic) CGFloat delayTimeForMusicToPlay; + +/*! + @method initWithURL: + @brief 使用 NSURL 初始化编辑实例 + + @return PLShortVideoEditor 实例 + @since v1.1.0 + */ +- (instancetype)initWithURL:(NSURL *)url; + +/*! + @method initWithAsset: + @brief 使用 AVAsset 初始化编辑实例 + + @return PLShortVideoEditor 实例 + @since v1.1.0 + */ +- (instancetype)initWithAsset:(AVAsset *)asset; + +/*! + @method initWithAsset:videoSize + @brief 使用 AVAsset 初始化编辑实例 + + @param asset 原视频,即被编辑的视频素材 + @param videoSize 编辑时的预览分辨率,当取值为 CGSizeZero 时,预览分辨率为原视频的分辨率,当取值为(width, height)时,预览分辨率为(width, height) + + @return PLShortVideoEditor 实例 + @since v1.5.0 + */ +- (instancetype)initWithAsset:(AVAsset *)asset videoSize:(CGSize)videoSize; + +/*! + @method initWithPlayerItem:videoSize + @brief 使用 AVPlayerItem 初始化编辑实例 + + @param playerItem 原视频,即被编辑的视频素材 + @param videoSize 编辑时的预览分辨率,当取值为 CGSizeZero 时,预览分辨率为原视频的分辨率,当取值为(width, height)时,预览分辨率为(width, height) + + @return PLShortVideoEditor 实例 + @since v1.11.0 + */ +- (instancetype)initWithPlayerItem:(AVPlayerItem *)playerItem videoSize:(CGSize)videoSize; + +/*! + @method startEditing + @brief 加载编辑信息,实时预览编辑效果 + + @since v1.1.0 + */ +- (void)startEditing; + +/*! + @method stopEditing + @brief 停止实时预览编辑效果 + + @since v1.1.0 + */ +- (void)stopEditing; + +/*! + @method replaceCurrentAssetWithAsset: + @brief 替换当前的 AVAsset 对象 + + @param asset 原视频,即被编辑的视频素材 + + @since v1.5.0 + */ +- (void)replaceCurrentAssetWithAsset:(AVAsset *)asset; + +/*! + @method currentTime + @brief 获取当前播放时刻 + + @return 当前播放的时刻 + @since v1.9.0 + */ +- (CMTime)currentTime; + +/*! + @method seekToTime:completionHandler + @brief seek 到视频的 time 时刻 + + @param time seek 的时间点 + @param completionHandler seek 操作完成的回调 + + @since v1.9.0 + */ +- (void)seekToTime:(CMTime)time completionHandler:(void (^)(BOOL finished))completionHandler; + +/*! + @method addFilter: + @brief 添加滤镜效果 + + @param colorImagePath 当前使用的滤镜的颜色表图的路径,当 colorImagePath 为 nil 时,表示移除滤镜。 + + @since v1.5.0 + */ +- (void)addFilter:(NSString *)colorImagePath; + +/*! + @method addMVLayerWithColor:alpha: + @brief 添加 MV 图层方法 1, 相当于 addMVLayerWithColor:colorURL alpha:alphaURL timeRange:kCMTimeRangeZero loopEnable:NO + + @param colorURL 彩色层视频的地址 + @param alphaURL 被彩色层当作透明层的视频的地址 + + @discussion 目前支持添加一层 MV 图层。当 colorURL = nil 和 alphaURL = nil 时,表示移除 MV 图层。 + + @since v1.5.0 + */ +- (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL; + +/*! + @method addMVLayerWithColor:alpha:timeRange:loopEnable + @brief 添加 MV 图层方法 2 + + @param colorURL 彩色层视频的地址 + @param alphaURL 被彩色层当作透明层的视频的地址 + @param timeRange 选取 MV 文件的时间段, 如果选取整个 MV,直接传入 kCMTimeRangeZero 即可 + @param loopEnable 当 MV 时长(timeRange.duration)小于视频时长时,是否循环播放 MV + + @since v1.14.0 + */ +- (void)addMVLayerWithColor:(NSURL *)colorURL alpha:(NSURL *)alphaURL timeRange:(CMTimeRange)timeRange loopEnable:(BOOL)loopEnable; + +/*! + @method addMusic:timeRange:volume + @brief 添加背景音乐 1 + + @param musicURL 当前使用的背景音乐的地址 + @param timeRange 当前使用的背景音乐的有效时间区域(start, duration),如果想使用整段音乐,可以将其设置为 kCMTimeRangeZero 或者 (kCMTimeZero, duration) + @param volume 当前使用的背景音乐的音量 + + @warning 默认循环播放当前背景音乐 + + @since v1.5.0 + */ +- (void)addMusic:(NSURL *)musicURL timeRange:(CMTimeRange)timeRange volume:(NSNumber *)volume; + +/*! + @method addMusic:timeRange:volume:loopEnable + @brief 添加背景音乐 2 + + @param musicURL 当前使用的背景音乐的地址 + @param timeRange 当前使用的背景音乐的有效时间区域(start, duration),如果想使用整段音乐,可以将其设置为 kCMTimeRangeZero 或者 (kCMTimeZero, duration) + @param volume 当前使用的背景音乐的音量 + @param loopEnable 当前使用的背景音乐是否循环播放 + + @since v1.11.0 + */ +- (void)addMusic:(NSURL *)musicURL timeRange:(CMTimeRange)timeRange volume:(NSNumber *)volume loopEnable:(BOOL)loopEnable; + +/*! + @method updateMusic:volume + @brief 更新背景音乐 + + @param timeRange 使用 kCMTimeRangeZero 时,表示不更新背景音乐的播放时间区域 + @param volume 使用 nil 时,表示不更新背景音乐的音量 + + @discussion + 1. 只更新 timeRange 时,[xxxObj updateMusic:timeRange volume:nil] + 2. 只更新 volume 时,[xxxObj updateMusic:kCMTimeRangeZero volume:volume] + + @since v1.5.0 + */ +- (void)updateMusic:(CMTimeRange)timeRange volume:(NSNumber *)volume; + +/*! + @method updateMultiMusics: + @brief 更新多个背景音效,相当于 updateMultiMusics:multiMusicsSettings keepMoviePlayerStatus:NO + + @param multiMusicsSettings 多个背景音效的设置信息。每个元素都为字典,信息由 PLSAudioSettingsKey 配置 + + @since v1.11.0 + */ +- (void)updateMultiMusics:(NSArray *)multiMusicsSettings; + +/*! + @method updateMultiMusics:keepMoviePlayerStatus + @brief 更新多个背景音效 2 + + @param multiMusicsSettings 多个背景音效的设置信息。每个元素都为字典,信息由 PLSAudioSettingsKey 配置 + @param keepStatus 添加多个背景音乐之后视频播放器是否保持当前状态,如果传 YES,视频播放器将不做任何处理。如果传入 NO,视频播放器将重新开始播放 + + @since v1.16.0 + */ +- (void)updateMultiMusics:(NSArray *)multiMusicsSettings keepMoviePlayerStatus:(BOOL)keepStatus; + +/*! + @method setWaterMarkWithImage:position + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + + @since v1.5.0 + */ +- (void)setWaterMarkWithImage:(UIImage *)waterMarkImage position:(CGPoint)position; + +/*! + @method setWaterMarkWithImage:position:size + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + + @since v1.14.0 + */ +- (void)setWaterMarkWithImage:(UIImage *)waterMarkImage position:(CGPoint)position size:(CGSize)size; + +/*! + @method setWaterMarkWithImage:position:size:waterMarkType:alpha:rotateDegree + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + @param type 水印的类型 + @param alpha 水印的透明度 (0 ~ 1) + @param degree 水印旋转角度 (单位:度) + + @since v1.15.0 + */ +- (void)setWaterMarkWithImage:(UIImage *)waterMarkImage position:(CGPoint)position size:(CGSize)size waterMarkType:(PLSWaterMarkType)type alpha:(CGFloat)alpha rotateDegree:(CGFloat)degree; + +/*! + @method setGifWaterMarkWithData:position:size:alpha:rotateDegree + @brief 开启水印,此方法只能设置 gif 水印 + + @param gifData gif 图片数据 + @param position 水印的位置 + @param size 水印的大小,如果为 CGSizeZero,则使用水印图片的实际大小 + @param alpha 水印的透明度 (0 ~ 1) + @param degree 水印旋转角度 (单位:度) + + @since v1.15.0 + */ +- (void)setGifWaterMarkWithData:(NSData *)gifData position:(CGPoint)position size:(CGSize)size alpha:(CGFloat)alpha rotateDegree:(CGFloat)degree; + +/*! + @method clearWaterMark + @brief 移除水印 + + @since v1.5.0 + */ +- (void)clearWaterMark; + +/*! + @method rotateVideoLayer + @brief 旋转视频的方向,能将竖屏视频旋转为横屏视频,横屏视频旋转为竖屏视频 + + @return PLSPreviewOrientation 当前视频的方向 + + @since v1.7.0 + */ +- (PLSPreviewOrientation)rotateVideoLayer; + +/*! + @method resetVideoLayerOrientation + @brief 重置视频的旋转方向,视频的方向被置为视频的原始方向 + + @since v1.7.0 + */ +- (void)resetVideoLayerOrientation; + +@end + + diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoKit.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoKit.h similarity index 100% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoKit.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoKit.h diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h new file mode 100644 index 00000000..8b734ecf --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoKitEnv.h @@ -0,0 +1,68 @@ +// +// PLShortVideoKitEnv.h +// PLShortVideoKit +// +// Created by suntongmian on 2017/11/27. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import "PLSTypeDefines.h" + +/*! + @class PLShortVideoKitEnv + @brief 初始化 ShortVideoKit 运行环境 + */ +@interface PLShortVideoKitEnv : NSObject + +/*! + @method initEnv + @brief 初始化 ShortVideoKit 的运行环境,需要在 -application:didFinishLaunchingWithOptions: 方法下调用该方法, + + @warning 不调用该方法将导致 PLShortVideoKitEnv 对象无法初始化 + */ ++(void)initEnv; + +/*! + @method isInited + @brief 判断当前环境是否已经初始化 + + @return 已初始化返回 YES,否则为 NO + */ ++(BOOL)isInited; + +/*! + @method enableFileLogging + @abstract 开启SDK内部写文件日志功能,以方便SDK支持团队定位您所遇到的问题。 + + @note 日志文件存放位置为 App Container/Library/Caches/Pili-ShortVideo/Logs + */ ++ (void)enableFileLogging; + +/*! + @method setLogLevel: + @abstract 设置SDK内部输出日志的级别,默认为 PLShortVideoLogLevelWarning 级别。该方法设置的输出级别会分别同步到控制台与文件日志中。 + + @warning 请确保不要在线上产品开启 PLShortVideoLogLevelVerbose 级别输出,这将影响产品性能。 + */ ++ (void)setLogLevel:(PLShortVideoLogLevel)logLevel; + +/*! + @method deviceID + @brief 获取设备 ID. 默认为 UUID + + @return 返回当前设备 ID + */ ++ (NSString *)deviceID; + +/*! + @method setDeviceID: + @brief 设置设备 ID + + @param deviceID 设备 ID + + */ ++ (void)setDeviceID:(NSString *)deviceID; + +@end diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h new file mode 100644 index 00000000..9c648972 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoRecorder.h @@ -0,0 +1,906 @@ +// +// PLShortVideoRecorder.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/1. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import +#import +#import "PLSVideoConfiguration.h" +#import "PLSAudioConfiguration.h" +#import "PLSTypeDefines.h" + +@class PLShortVideoRecorder; + +/*! + @protocol PLShortVideoRecorderDelegate + @brief 短视频录制协议 + + @since v1.0.0 + */ +@protocol PLShortVideoRecorderDelegate + +@optional +#pragma mark -- 摄像头/麦克风权限变化的回调 +/*! + @method shortVideoRecorder:didGetCameraAuthorizationStatus: + @abstract 摄像头授权状态发生变化的回调 + + @param recorder PLShortVideoRecorder 实例 + @param status 相机授权状态 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didGetCameraAuthorizationStatus:(PLSAuthorizationStatus)status; + +/*! + @method shortVideoRecorder:didGetMicrophoneAuthorizationStatus: + @abstract 麦克风授权状态发生变化的回调 + + @param recorder PLShortVideoRecorder 实例 + @param status 麦克风授权状态 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didGetMicrophoneAuthorizationStatus:(PLSAuthorizationStatus)status; + +#pragma mark -- 摄像头对焦位置的回调 +/*! + @method shortVideoRecorderDidFocusAtPoint: + @abstract 摄像头对焦位置的回调 + + @param point 相机当前焦点 + + @since v1.6.0 + */ +- (void)shortVideoRecorderDidFocusAtPoint:(CGPoint)point __deprecated_msg("Method deprecated in v1.9.0. Use `shortVideoRecorder: didFocusAtPoint:`");; + +/*! + @method shortVideoRecorder:didFocusAtPoint: + @abstract 摄像头对焦位置的回调 + + @param recorder PLShortVideoRecorder 实例 + @param point 相机当前焦点 + + @since v1.9.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didFocusAtPoint:(CGPoint)point; + +#pragma mark -- 摄像头/麦克风采集数据的回调 +/*! + @method shortVideoRecorder:pixelBuffer: + @abstract 获取到摄像头原数据时的回调, 便于开发者做滤镜等处理,需要注意的是这个回调在 camera 数据的输出线程,请不要做过于耗时的操作,否则可能会导致帧率下降 + + @param recorder PLShortVideoRecorder 实例 + @param pixelBuffer 视频帧数据 + + @since v1.0.0 + */ +- (CVPixelBufferRef __nonnull)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder cameraSourceDidGetPixelBuffer:(CVPixelBufferRef __nonnull)pixelBuffer; + +/*! + @method shortVideoRecorder:microphoneSourceDidGetSampleBuffer: + @abstract 获取到麦克风原数据时的回调,需要注意的是这个回调在 microphone 数据的输出线程,请不要做过于耗时的操作,否则可能阻塞该线程影响音频输出或其他未知问题 + + @param recorder PLShortVideoRecorder 实例 + @param sampleBuffer 音频帧数据 + + @since v1.0.1 + */ +- (CMSampleBufferRef __nonnull)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder microphoneSourceDidGetSampleBuffer:(CMSampleBufferRef __nonnull)sampleBuffer; + +#pragma mark -- 视频录制动作的回调 +/*! + @method shortVideoRecorder:didStartRecordingToOutputFileAtURL: + @abstract 开始录制一段视频时 + + @param recorder PLShortVideoRecorder 实例 + @param fileURL 录制文件的存放地址 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didStartRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL; + +/*! + @method shortVideoRecorder:didRecordingToOutputFileAtURL:fileDuration:totalDuration: + @abstract 正在录制的过程中。在完成该段视频录制前会一直回调,可用来更新所有视频段加起来的总时长 totalDuration UI。 + + @param recorder PLShortVideoRecorder 实例 + @param fileURL 当前正在录制的文件存放地址 + @param fileDuration 当前正在录制的文件时长 + @param totalDuration 所有录制文件的总时长 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; + +/*! + @method shortVideoRecorder:didDeleteFileAtURL:fileDuration:totalDuration: + @abstract 删除了某一段视频 + + @param recorder PLShortVideoRecorder 实例 + @param fileURL 当前删除的文件存放地址 + @param fileDuration 当前删除的文件时长 + @param totalDuration 删除当前文件之后剩余录制文件的总时长 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didDeleteFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; + +/*! + @method shortVideoRecorder:didFinishRecordingToOutputFileAtURL:fileDuration:totalDuration: + @abstract 完成一段视频的录制时 + + @param recorder PLShortVideoRecorder 实例 + @param fileURL 当前录制完成的文件存放地址 + @param fileDuration 当前录制完成的文件时长 + @param totalDuration 所有录制文件的总时长 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didFinishRecordingToOutputFileAtURL:(NSURL *__nonnull)fileURL fileDuration:(CGFloat)fileDuration totalDuration:(CGFloat)totalDuration; + +/*! + @method shortVideoRecorder:didFinishRecordingMaxDuration: + @abstract 在达到指定的视频录制时间 maxDuration 后,如果再调用 [PLShortVideoRecorder startRecording],那么会立即执行该回调。该回调功能是用于页面跳转 + + @param recorder PLShortVideoRecorder 实例 + @param maxDuration 设置的最大录制时长 + + @since v1.0.0 + */ +- (void)shortVideoRecorder:(PLShortVideoRecorder *__nonnull)recorder didFinishRecordingMaxDuration:(CGFloat)maxDuration; + +@end + +#pragma mark - basic + +/*! + @class PLShortVideoRecorder + @abstract 短视频录制的核心类。 + + @discussion 一个 PLShortVideoRecorder 实例会包含了对视频源、音频源的控制,并且对流的操作及流状态的返回都是通过它来完成的。 + */ +@interface PLShortVideoRecorder : NSObject + +/*! + @method assetRepresentingAllFiles + @brief 获取代表当前会话的所有视频段文件的 asset + + @return 返回代表当前会话的所有视频段文件的 asset + @since v1.0.0 + */ +- (AVAsset *__nonnull)assetRepresentingAllFiles; + +/*! + @property maxDuration + @brief 视频录制的最大时长,单位为秒。默认为10秒 + + @since v1.0.0 + */ +@property (assign, nonatomic) CGFloat maxDuration; + +/*! + @property minDuration + @brief 视频录制的最短时间,单位为秒。默认为2秒 + + @since v1.0.0 + */ +@property (assign, nonatomic) CGFloat minDuration; + +/*! + @property videoConfiguration + @brief 视频配置,只读 + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) PLSVideoConfiguration *__nonnull videoConfiguration; + +/*! + @property audioConfiguration + @brief 音频配置,只读 + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) PLSAudioConfiguration *__nonnull audioConfiguration; + +/*! + @property previewView + @brief 摄像头的预览视图 + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) UIView *__nullable previewView; + +/*! + @property adaptationRecording + @brief 根据设备的方向自动确定竖屏、横屏拍摄。默认为 NO,不启用自动确定 + + @since v1.3.0 + */ +@property (assign, nonatomic) BOOL adaptationRecording; + +/*! + @property deviceOrientation + @brief 获取当前设备的旋转方向 + + @discussion 当 adaptationRecording 为YES时,获取设备方向的回调 deviceOrientationBlock 才有效。 + 拍摄时可根据 deviceOrientation 做 UI 效果来标明当前拍摄的方向是竖屏还是横屏。 + PLSPreviewOrientationPortrait 竖屏拍摄 + PLSPreviewOrientationPortraitUpsideDown 倒立拍摄 + PLSPreviewOrientationLandscapeRight 右横屏拍摄 + PLSPreviewOrientationLandscapeLeft 左横屏拍摄 + + @since v1.3.0 + */ +@property (copy, nonatomic) void(^ _Nullable deviceOrientationBlock)(PLSPreviewOrientation deviceOrientation); + +/*! + @property delegate + @brief 代理对象 + + @since v1.0.0 + */ +@property (weak, nonatomic) id __nullable delegate; + +/*! + @property delegateQueue + @abstract 触发代理对象回调时所在的任务队列。 + + @discussion 默认情况下该值为 nil,此时代理方法都会通过 main queue 异步执行回调。如果你期望可以所有的回调在自己创建或者其他非主线程调用, + 可以设置改 delegateQueue 属性。 + + @see PLShortVideoRecorderDelegate + @see delegate + + @since v1.0.0 + */ +@property (strong, nonatomic) dispatch_queue_t __nullable delegateQueue; + +/*! + @property fillMode + @brief previewView 中视频的填充方式,默认使用 PLVideoFillModePreserveAspectRatioAndFill + + @since v1.0.0 + */ +@property (readwrite, nonatomic) PLSVideoFillModeType fillMode; + +/*! + @property isRecording + @brief PLShortVideoRecorder 处于录制状态时为 true + + @since v1.0.0 + */ +@property (readonly, nonatomic) BOOL isRecording; + +/*! + @property captureEnabled + @brief 是否开启音视频采集 + + @since v1.2.0 + */ +@property (assign, nonatomic, readonly) BOOL captureEnabled; + +/*! + @property recoderRate + @brief 视频拍摄速率值,默认使用 PLSVideoRecoderRateNormal,isRecording 为 YES 时,设置该值无效 + + @since v1.4.0 + */ +@property (readwrite, nonatomic) PLSVideoRecoderRateType recoderRate; + +/*! + @property outputFileType + @brief 视频的文件类型,默认为 PLSFileTypeMPEG4(.mp4) + + @since v1.6.0 + */ +@property (assign, nonatomic) PLSFileType outputFileType; + +/*! + @property catpuredView + @brief 指定捕捉某个 View 的画面,将 View 画面录制为视频 + + @since v1.11.0 + */ +@property (strong, nonatomic) UIView *_Nullable catpuredView; + +/*! + @method initWithCatpuredViewVideoConfiguration:audioConfiguration: + @brief 指定捕捉某个 View 的画面,将 View 画面录制为视频时的初始化方法 + + @discussion catpuredViewVideoConfiguration 必须要设置,用来配置视频信息。 + audioConfiguration 设置为 nil 时,不采集音频。 + + @param catpuredViewVideoConfiguration 视频采集和编码参数 + @param audioConfiguration 音频采集和编码参数 + + @return 返回 PLShortVideoRecorder 实例 + @since v1.11.0 + */ + +- (nonnull instancetype)initWithCatpuredViewVideoConfiguration:(PLSVideoConfiguration *_Nonnull)catpuredViewVideoConfiguration audioConfiguration:(PLSAudioConfiguration *_Nullable)audioConfiguration; + +/*! + @method initWithVideoConfiguration:audioConfiguration: + @abstract 初始化方法 + + @discussion videoConfiguration 设置为 nil 时,不采集视频。 + audioConfiguration 设置为 nil 时,不采集音频。 + + @param videoConfiguration 视频采集和编码参数 + @param audioConfiguration 音频采集和编码参数 + + @since v1.0.0 + @return 返回 PLShortVideoRecorder 实例 + */ +- (nonnull instancetype)initWithVideoConfiguration:(PLSVideoConfiguration *_Nullable)videoConfiguration audioConfiguration:(PLSAudioConfiguration *_Nullable)audioConfiguration; + +/*! + @method initWithVideoConfiguration:audioConfiguration:captureEnabled: + @abstract 初始化方法 + + @param videoConfiguration 视频采集和编码参数 + @param audioConfiguration 音频采集和编码参数 + @param captureEnabled 是否启用音视频采集 + + @since v1.2.0 + + @discussion 是否使用 SDK 内部的音视频采集,默认为 YES,当设置为 NO 时,可通过以下两个接口导入音视频数据 + - (void)writePixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer timeStamp:(CMTime)timeStamp; + - (void)writeAudioBuffer:(AudioBuffer *_Nonnull)audioBuffer asbd:(AudioStreamBasicDescription *_Nonnull)asbd timeStamp:(CMTime)timeStamp; + @return 返回 PLShortVideoRecorder 实例 + */ +- (nonnull instancetype)initWithVideoConfiguration:(PLSVideoConfiguration *__nonnull)videoConfiguration audioConfiguration:(PLSAudioConfiguration *__nonnull)audioConfiguration captureEnabled:(BOOL)captureEnabled; + +/*! + @method writePixelBuffer:timeStamp + @abstract 写入视频数据,当 captureEnabled 为 NO 时,可通过该接口导入视频数据 + + @param pixelBuffer kCVPixelFormatType_32BGRA 格式的 CVPixelBufferRef + @param timeStamp pixelBuffer 对应的时间戳 + + @warning 目前仅支持 kCVPixelFormatType_32BGRA 格式的 pixelBuffer + + @since v1.2.0 + */ +- (void)writePixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer timeStamp:(CMTime)timeStamp; + +/*! + @method writeSampleBuffer: + @abstract 写入音频数据,当 captureEnabled 为 NO 时,可通过该接口导入音频数据 + + @param sampleBuffer 音频数据帧 + + @since v1.2.0 + */ +- (void)writeSampleBuffer:(CMSampleBufferRef _Nonnull)sampleBuffer; + +/*! + @method insertVideo: + @abstract 插入视频,支持任意位置,通过该接口传入,成为 PLShortVideoRecorder 当前视频数组的下一个视频段 + + @param videoURL 插入的视频存放地址 + + @warning PLShortVideoRecorder 初始化后调用,当视频时长加上视频数组中的所有视频段时长,超过视频设置的最大时长 maxDuration 时,则传值无效 + + @since v1.7.0 + */ +- (void)insertVideo:(NSURL *_Nonnull)videoURL; + +/*! + @method startRecording + @brief 开始录制视频,录制的视频的存放地址由 SDK 内部自动生成 + + @warning 获取所有录制的视频段的地址,可以使用 - (NSArray *__nullable)getAllFilesURL + + @since v1.0.0 + */ +- (void)startRecording; + +/*! + @method startRecording: + @brief 开始录制视频 + + @param fileURL 录制的视频的存放地址,该参数可以在外部设置,录制的视频会保存到该位置 + + @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 + 获取所有录制的视频段的地址,可以使用 - (NSArray *__nullable)getAllFilesURL + + @since v1.8.0 + */ +- (void)startRecording:(NSURL *_Nonnull)fileURL; + +/*! + @method stopRecording + @brief 停止录制视频 + + @since v1.0.0 + */ +- (void)stopRecording; + +/*! + @method cancelRecording + @brief 取消录制会停止视频录制并删除已经录制的视频段文件 + + @since v1.0.0 +*/ +- (void)cancelRecording; + +/*! + @method deleteLastFile + @brief 删除上一个录制的视频段 + + @since v1.0.0 + */ +- (void)deleteLastFile; + +/*! + @method deleteAllFiles + @brief 删除所有录制的视频段 + + @since v1.0.0 + */ +- (void)deleteAllFiles; + +/*! + @method getAllFilesURL + @brief 获取所有录制的视频段的地址 + + @return 返回当前录制完成的所有视频段地址 + @since v1.0.0 + */ +- (NSArray *__nullable)getAllFilesURL; + +/*! + @method getFilesCount + @brief 获取录制的视频段的总数目 + + @return 返回当前录制完成的是视频段总数 + @since v1.0.0 + */ +- (NSInteger)getFilesCount; + +/*! + @method getTotalDuration + @brief 获取所有录制的视频段加起来的总时长 + + @return 返回所有录制的视频段加起来的总时长 + @since v1.0.0 + */ +- (CGFloat)getTotalDuration; + +/*! + @method getScreenShotWithCompletionHandler: + @brief 实时截图, 异步返回截图结果 image. 在 handler 内部调用 self,请使用 __weak typeof(self) weakSelf = self, 避免循环引用, 因为 SDK 内部对 handle 执行了 copy 操作 + + @param handler 截图完成的回调 + + @since v1.9.0 + */ +- (void)getScreenShotWithCompletionHandler:(void(^_Nullable)(UIImage * _Nullable image))handler; + +@end + +#pragma mark - PLShortVideoRecorder (backgroundMonitor) + +/*! + @category PLShortVideoRecorder (backgroundMonitor) + @brief 退后台的操作 + */ +@interface PLShortVideoRecorder (backgroundMonitor) + +/*! + @property backgroundMonitorEnable + @abstract 默认为 YES,即 SDK 内部根据监听到的 Application 前后台状态自动停止和开始录制视频 + + @warning 设置为 YES 时,即 Application 进入后台,若当前为拍摄视频状态,SDK 内部会自动停止视频的录制,恢复到前台,SDK 内部自动启动视频的录制; + 设置为 NO 时,即 Application 进入后台,若当前为拍摄视频状态,SDK 内部会停止视频的录制,恢复到前台,SDK 内部不会自动启动视频的录制。 + 为什么设置为 NO,SDK 内部仍然要在 Application 进入后台时停止视频录制呢?原因是,开发者将该属性设置为 NO 后,可能在应用层忘记处理 + Application 进入后台时要调用 stopRecording 来停止视频的录制,进而出现 crash。所以,不管该属性是 YES 还是 NO,当 Application + 进入后台,SDK 内部都会调用 stopRecording 自动停止视频的录制。 + + @since v1.11.0 + */ +@property (assign, nonatomic) BOOL backgroundMonitorEnable; + +@end + +#pragma mark -- PLShortVideoRecorder (mixAudio) + +/*! + @category PLShortVideoRecorder (mixAudio) + @brief 添加背景音乐操作 + */ +@interface PLShortVideoRecorder (mixAudio) + +/*! + @method mixAudio: + @abstract 设置录制时的背景音乐 + + @param audioURL 音乐文件存放地址 + + @warning PLShortVideoRecorder 初始化后调用,audioURL 为音频 URL + + @since v1.7.0 + */ +- (void)mixAudio:(NSURL *_Nullable)audioURL; + +/*! + @method mixAudio:playEnable: + @abstract 设置录制时的背景音乐 + + @warning PLShortVideoRecorder 初始化后调用,audioURL 为音频 URL + + @param audioURL 音频 URL + @param playEnable 音频添加后是否立即播放 + + @since v1.11.0 + */ +- (void)mixAudio:(NSURL *_Nullable)audioURL playEnable:(BOOL)playEnable; + +/*! + @method mixAudio:startTime:volume:playEnable: + @abstract 设置录制时的背景音乐 + + @warning PLShortVideoRecorder 初始化后调用,audioURL 为音频 URL + + @param audioURL 音频 URL + @param startTime 音频开始播放的位置 + @param volume 音频的音量 + @param playEnable 音频添加后是否立即播放 + + @since v1.11.0 + */ +- (void)mixAudio:(NSURL *_Nullable)audioURL startTime:(NSTimeInterval)startTime volume:(CGFloat)volume playEnable:(BOOL)playEnable; + +/*! + @method mixWithMusicVolume:videoVolume:completionHandler: + @brief 获取添加背景音乐录制完成后的 audioMix + + @warning 设置背景音乐后有效 + + @param musicVolume 背景音乐音量,范围 0 ~ 1 + @param videoVolume 原视频音量,范围 0 ~ 1 + @param completionHandler 获取 composition 及 audioMix + + @since v1.7.0 + */ +- (void)mixWithMusicVolume:(float)musicVolume videoVolume:(float)videoVolume completionHandler:(void (^_Nonnull)(AVMutableComposition * _Nullable composition, AVAudioMix * _Nullable audioMix, NSError * _Nullable error))completionHandler; +@end + +#pragma mark - Category (Info) + +/*! + @category PLShortVideoRecorder (Info) + @abstract SDK 信息相关 + + @since v1.0.0 + */ +@interface PLShortVideoRecorder (Info) + +/*! + @method versionInfo + @abstract PLShortVideoRecorder 的 SDK 版本。 + + @return 返回 SDK 版本信息 + @since v1.0.0 + */ ++ (NSString *__nonnull)versionInfo; + +/*! + @method checkAuthentication: + @abstract SDK 授权状态查询 + + @param resultBlock 授权状态查询完成之后的回调 + + @since v1.16.1 + */ ++ (void)checkAuthentication:(void(^ __nonnull)(PLSAuthenticationResult result))resultBlock;; + +@end + +#pragma mark - Category (Dubber) + +/*! + @category PLShortVideoRecorder (Dubber) + @abstract 视频配音 + + @since v1.6.0 + */ +@interface PLShortVideoRecorder (Dubber) + +/*! + @method mixAsset:timeRange: + @brief 纯音频录制时,将录制的纯音频 AVAsset *audio = [self.recorder assetRepresentingAllFiles] 与 asset 混合。 + + @param asset AVAsset 对象文件 + @param timeRange asset 的截取时间段 + + @since v1.6.0 + */ +- (AVAsset *_Nullable)mixAsset:(AVAsset *_Nullable)asset timeRange:(CMTimeRange)timeRange; + +@end + +#pragma mark - Category (CameraSource) + +/*! + @category PLShortVideoRecorder(CameraSource) + @discussion 与摄像头相关的接口 + + @since v1.0.0 + */ +@interface PLShortVideoRecorder (CameraSource) + +/*! + @property captureSession + @brief 只读变量,给有特殊需求的开发者使用 + + @since v1.15.0 + */ +@property (readonly, nonatomic) AVCaptureSession *_Nullable captureSession; + +/*! + @property captureDeviceInput + @brief 视频采集输入源,只读变量,给有特殊需求的开发者使用 + + @since v1.11.1 + */ +@property (readonly, nonatomic) AVCaptureDeviceInput *_Nullable captureDeviceInput; + +/*! + @property captureDevicePosition + @brief default as AVCaptureDevicePositionBack + + @since v1.0.0 + */ +@property (assign, nonatomic) AVCaptureDevicePosition captureDevicePosition; + +/*! + @property videoOrientation + @brief 开启 camera 时的采集摄像头的旋转方向,默认为 AVCaptureVideoOrientationPortrait + + @since v1.0.0 + */ +@property (assign, nonatomic) AVCaptureVideoOrientation videoOrientation; + +/*! + @property torchOn + @abstract default as NO. + + @since v1.0.0 +*/ +@property (assign, nonatomic, getter=isTorchOn) BOOL torchOn; + +/*! + @property continuousAutofocusEnable + @abstract 手动对焦的视图动画。该属性默认开启。 + + @since v1.6.0 + */ +@property (assign, nonatomic) BOOL innerFocusViewShowEnable; + +/*! + @property continuousAutofocusEnable + @abstract 连续自动对焦。该属性默认开启。 + + @since v1.0.0 + */ +@property (assign, nonatomic, getter=isContinuousAutofocusEnable) BOOL continuousAutofocusEnable; + +/*! + @property touchToFocusEnable + @abstract 手动点击屏幕进行对焦。该属性默认开启。 + + @since v1.0.0 + */ +@property (assign, nonatomic, getter=isTouchToFocusEnable) BOOL touchToFocusEnable; + +/*! + @property smoothAutoFocusEnabled + @abstract 该属性适用于视频拍摄过程中用来减缓因自动对焦产生的镜头伸缩,使画面不因快速的对焦而产生抖动感。该属性默认开启。 + */ +@property (assign, nonatomic, getter=isSmoothAutoFocusEnabled) BOOL smoothAutoFocusEnabled; + +/*! + @property focusPointOfInterest + @abstract default as (0.5, 0.5), (0,0) is top-left, (1,1) is bottom-right. + + @since v1.0.0 + */ +@property (assign, nonatomic) CGPoint focusPointOfInterest; + +/*! + @property videoZoomFactor + @abstract 默认为 1.0,设置的数值需要小于等于 videoActiveForat.videoMaxZoomFactor,如果大于会设置失败 + + @since v1.0.0 + */ +@property (assign, nonatomic) CGFloat videoZoomFactor; + +/*! + @property videoFormats + @brief videoFormats + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) NSArray *__nonnull videoFormats; + +/*! + @property videoActiveFormat + @brief videoActiveFormat + + @since v1.0.0 + */ +@property (strong, nonatomic) AVCaptureDeviceFormat *__nonnull videoActiveFormat; + +/*! + @property sessionPreset + @brief 采集的视频的 sessionPreset,默认为 AVCaptureSessionPreset1280x720 + + @since v1.0.0 + */ +@property (strong, nonatomic) NSString *__nonnull sessionPreset; + +/*! + @property videoFrameRate + @brief 采集的视频数据的帧率,默认为 25 + + @since v1.0.0 + */ +@property (assign, nonatomic) NSUInteger videoFrameRate; + +/*! + @property previewMirrorFrontFacing + @brief 前置预览是否开启镜像,默认为 YES + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL previewMirrorFrontFacing; + +/*! + @property previewMirrorRearFacing + @brief 后置预览是否开启镜像,默认为 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL previewMirrorRearFacing; + +/*! + @property streamMirrorFrontFacing + @brief 前置摄像头,编码写入文件时是否开启镜像,默认 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL streamMirrorFrontFacing; + +/*! + @property streamMirrorRearFacing + @brief 后置摄像头,编码写入文件时是否开启镜像,默认 NO + + @since v1.0.0 + */ +@property (assign, nonatomic) BOOL streamMirrorRearFacing; + +/*! + @property renderQueue + @brief 预览的渲染队列 + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) dispatch_queue_t __nonnull renderQueue; + +/*! + @property renderContext + @brief 预览的渲染 OpenGL context + + @since v1.0.0 + */ +@property (strong, nonatomic, readonly) EAGLContext *__nonnull renderContext; + +/*! + @method toggleCamera + @brief 切换前置/后置摄像头 + */ +- (void)toggleCamera; + +/*! + @method toggleCamera: + @brief 切换前置/后置摄像头 + + @param completeBlock 切换相机完成回调 + + @since 2.0.0 + */ +- (void)toggleCamera:(void(^)(BOOL isFinish))completeBlock; + +/*! + @method startCaptureSession + @brief 开启音视频采集 + + @since v1.0.0 + */ +- (void)startCaptureSession; + +/*! + @method stopCaptureSession + @brief 停止音视频采集 + + @since v1.0.0 + */ +- (void)stopCaptureSession; + +/*! + @method setBeautifyModeOn: + @brief 是否开启美颜 + + @param beautifyModeOn 美颜开关 + + @since v1.0.0 + */ +-(void)setBeautifyModeOn:(BOOL)beautifyModeOn; + +/*! + @method setBeautify: + @brief 设置对应 Beauty 的程度参数. + + @param beautify 范围从 0 ~ 1,0 为不美颜 + + @since v1.0.0 + */ +-(void)setBeautify:(CGFloat)beautify; + +/*! + @method setWhiten: + @brief 设置美白程度(注意:如果美颜不开启,设置美白程度参数无效) + + @param whiten 范围是从 0 ~ 1,0 为不美白 + + @since v1.0.0 + */ +-(void)setWhiten:(CGFloat)whiten; + +/*! + @method setRedden: + @brief 设置红润的程度参数.(注意:如果美颜不开启,设置美白程度参数无效) + + @param redden 范围是从 0 ~ 1,0 为不红润 + + @since v1.0.0 + */ + +-(void)setRedden:(CGFloat)redden; + +/*! + @method setWaterMarkWithImage:position: + @brief 开启水印 + + @param waterMarkImage 水印的图片 + @param position 水印的位置 + + @since v1.0.0 + */ +-(void)setWaterMarkWithImage:(UIImage *__nonnull)waterMarkImage position:(CGPoint)position; + +/*! + @method clearWaterMark + @brief 移除水印 + + @since v1.0.0 + */ +-(void)clearWaterMark; + +/*! + @method reloadvideoConfiguration: + @brief 重新配置视频的参数 + + @since v1.0.0 + */ +- (void)reloadvideoConfiguration:(PLSVideoConfiguration *__nonnull)videoConfiguration; + +@end + diff --git a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h similarity index 77% rename from Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h rename to Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h index 76c22fa4..f2b4e809 100644 --- a/Pod/Library/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoTranscoder.h @@ -13,19 +13,23 @@ #import "PLSTypeDefines.h" /*! - * @abstract 视频转码 - * @discussion 对视频进行转码处理 + @class PLShortVideoTranscoder + @abstract 视频转码 + + @discussion 对视频进行转码处理 */ @interface PLShortVideoTranscoder : NSObject -/** +/*! + @property isExportMovieToPhotosAlbum @brief 将视频导出到相册,默认为 NO @since v1.4.0 */ @property (assign, nonatomic) BOOL isExportMovieToPhotosAlbum; -/** +/*! + @property outputURL @abstract 视频转码后的地址 @warning 生成 URL 需使用 [NSURL fileURLWithPath:fileName] 方式,让 URL 的 scheme 合法(file://,http://,https:// 等)。 @@ -34,23 +38,27 @@ */ @property (strong, nonatomic) NSURL *outputURL; -/** +/*! + @property outputFileType @abstract 视频转码后的格式,默认为 PLSFileTypeMPEG4(.mp4) @since v1.0.5 */ @property (assign, nonatomic) PLSFileType outputFileType; -/** +/*! + @property outputFilePreset @abstract 转码后视频的质量,默认为 PLSFilePresetHighestQuality @since v1.0.5 */ @property (assign, nonatomic) PLSFilePreset outputFilePreset; -/** +/*! + @property bitrate @abstract 转码后视频的码率,默认为 6000 * 1000 bps,对应 PLSFilePresetHighestQuality - @warn 只设置 outputFilePreset,不设置 bitrate,内部 bitrate 默认值如下: + + @warning 只设置 outputFilePreset,不设置 bitrate,内部 bitrate 默认值如下: PLSFilePresetLowQuality, 默认对应 700 * 1000 bps PLSFilePresetMediumQuality, 默认对应 3000 * 1000 bps PLSFilePresetHighestQuality, 默认对应 6000 * 1000 bps @@ -64,21 +72,24 @@ */ @property (assign, nonatomic) float bitrate; -/** +/*! + @property progress @abstract 转码的进度 @since v1.0.5 */ @property (assign, nonatomic, readonly) float progress; -/** +/*! + @property timeRange @abstract 设置需要转码的视频时间段,默认为视频的总时长 @since v1.0.5 */ @property (assign, nonatomic) CMTimeRange timeRange; -/** +/*! + @property isAdjustVideoOrientation @abstract 调整视频方向,默认为 NO。设置为 YES,可调整视频方向,生成的视频不需要通过视频角度信息和分辨率来获取实际分辨率。 比如 iPhone 相机拍摄的视频 (1920x1080, 90度, 纵向),播放器播放预览分辨率为 1080x1920。 @@ -86,7 +97,8 @@ */ @property (assign, nonatomic) BOOL isAdjustVideoOrientation; -/** +/*! + @property rotateOrientation @abstract 视频旋转方向,默认为 PLSPreviewOrientationPortrait。 PLSPreviewOrientationPortrait = 0, 正立 0度 PLSPreviewOrientationPortraitUpsideDown = 1, 180度 @@ -97,7 +109,8 @@ */ @property (assign, nonatomic) PLSPreviewOrientation rotateOrientation; -/** +/*! + @property videoSelectedRect @abstract 视频剪裁区域,默认为 CGRectZero,不剪裁. 如果不为 emptyRect,会覆盖 @property outputFilePreset, 有效范围 [CGRectZero ~ {0, 0, videoOriginWidth, videoOriginHeight}] @@ -105,7 +118,8 @@ */ @property (assign, nonatomic) CGRect videoSelectedRect; -/** +/*! + @property destVideoSize @abstract 导出视频的宽高,仅当 videoSelectedRect 不是 emptyRect 时,destVideoSize 才有效。默认为 CGSizeZero, 此时导出 视频的宽高为 videoSelectedRect.size. 每次设置 destVideoSize 的值的时候,bitrate 都会自动调整到合适的值。如果想 自定义输出码率,设置 destVideoSize 之后,需要再次设置 bitrate 的值 @@ -114,7 +128,8 @@ */ @property (assign, nonatomic) CGSize destVideoSize; -/** +/*! + @property videoFrameRate @abstract 导出视频的帧率,默认 0,有效范围 [0 ~ 原视频帧率],当为 0 的时候,导出视频帧率等于原视频帧率, 当设置的帧率大于原视频帧率时,会被自动调整为原视频帧率 @@ -122,64 +137,75 @@ */ @property (assign, nonatomic) float videoFrameRate; -/** +/*! + @property completionBlock @abstract 视频转码完成的 block @since v1.0.5 */ @property (copy, nonatomic) void(^completionBlock)(NSURL *url); -/** +/*! + @property failureBlock @abstract 视频转码失败的 block @since v1.0.5 */ @property (copy, nonatomic) void(^failureBlock)(NSError* error); -/** +/*! + @property processingBlock @abstract 视频转码进度的 block,可在该 block 中刷新转码进度条 UI @since v1.0.5 */ @property (copy, nonatomic) void(^processingBlock)(float progress); -/** - * 使用 AVAsset 初始化转码对象 - * - * @param asset 送去转码的视频 +/*! + @method initWithAsset: + @brief 使用 AVAsset 初始化转码对象 + + @param asset 送去转码的视频 + @return PLShortVideoTranscoder 实例 @since v1.0.5 */ - (id)initWithAsset:(AVAsset *)asset; -/** - * 使用 NSURL 初始化转码对象 - * - * @param url 送去转码的视频 +/*! + @method initWithURL: + @brief 使用 NSURL 初始化转码对象 + + @param url 送去转码的视频 + @return PLShortVideoTranscoder 实例 @since v1.0.5 */ - (id)initWithURL:(NSURL *)url; -/** - * 在初始化转码对象 PLShortVideoTranscoder 并设置好转码参数后,执行该方法启动转码流程 - * +/*! + @method startTranscoding + @brief 在初始化转码对象 PLShortVideoTranscoder 并设置好转码参数后,执行该方法启动转码流程 @since v1.0.5 */ - (void)startTranscoding; -/** - * 取消转码流程 - * +/*! + @method cancelTranscoding + @brief 取消转码流程 @since v1.0.5 */ - (void)cancelTranscoding; -/** - * 返回 AVAsset 在 bounds 大小的 view 中播放,有视频部分的 frame - * +/*! + @method videoDisplay:bounds:rotate: + @brief 返回 AVAsset 在 bounds 大小的 view 中播放,有视频部分的 frame + + @param asset AVAsset 实例 + @param bounds 预览 view 的大小 + @param previewOrientation 预览的方法 @since v1.13.0 */ diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h new file mode 100644 index 00000000..60b02214 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Headers/PLShortVideoUploader.h @@ -0,0 +1,155 @@ +// +// PLShortVideoUploader.h +// PLShortVideoKit +// +// Created by suntongmian on 17/3/7. +// Copyright © 2017年 Pili Engineering, Qiniu Inc. All rights reserved. +// + +#import +#import "PLSUploaderConfiguration.h" +#import "PLSUploaderResponseInfo.h" + + +@class PLShortVideoUploader; +@class ALAsset; +@class PHAsset; + +/*! + @protocol PLShortVideoUploaderDelegate + @brief 文件上传协议 + + @since v1.0.4 + */ +@protocol PLShortVideoUploaderDelegate + +@optional + +/*! + @method shortVideoUploader:uploadKeyuploadPercent: + @abstract 上传进度回调 + @discussion 一个 PLShortVideoUploader 实例实现视频上传功能。 + + @param uploader PLShortVideoUploader 实例 + @param uploadKey 上传的 key 值 + @param uploadPercent 上传进度 + + @since v1.0.4 + */ +- (void)shortVideoUploader:(PLShortVideoUploader * _Nonnull)uploader uploadKey:(NSString * _Nullable)uploadKey uploadPercent:(float)uploadPercent; + +/*! + @method shortVideoUploader:completeInfo:uploadKey:resp: + @abstract 上传结果回调 + + @param uploader PLShortVideoUploader 实例 + @param info 上传完成信息 + @param uploadKey 上传的 key 值 + @param resp 上传完成的返回信息 + + @since v1.0.4 + */ +- (void)shortVideoUploader:(PLShortVideoUploader * _Nonnull)uploader completeInfo:(PLSUploaderResponseInfo * _Nonnull)info uploadKey:(NSString * _Nonnull)uploadKey resp:(NSDictionary * _Nullable)resp; + +@end + +/*! + @class PLShortVideoUploader + @abstract 短视频录制的上传功能核心类。 + + @discussion 一个 PLShortVideoUploader 实例实现段视频上传功能。 + */ +@interface PLShortVideoUploader : NSObject + +/*! + @property cancelUpload + @brief 取消/继续上传,YES 为取消上传,NO 为继续上传,默认为 NO + + @since v1.0.4 + */ +@property (nonatomic, assign, readonly, getter=isCancelUpload)BOOL cancelUpload; + +/*! + @property uploadPercent + @brief 上传进度 + + @since v1.0.4 + */ +@property (nonatomic, assign, readonly)float uploadPercent; + +/*! + @property uploadConfig + @brief 上传配置参数 + @see PLSUploaderConfiguration类 + + @since v1.0.4 + */ +@property (nonatomic, strong, readonly)PLSUploaderConfiguration * _Nonnull uploadConfig; + +/*! + @property delegate + @brief 代理对象,用于告知上传状态改变或其他行为,对象需实现 PLSUploadDelegate 协议 + + @since v1.0.4 + */ +@property (nonatomic, weak, nullable) id delegate; + +/*! + @method sharedUploader: + @abstract 创建 PLShortVideoUploader 单例对象 + + @return PLShortVideoUploader 实例 + + @since v1.0.4 + */ ++ (instancetype _Nullable)sharedUploader:(PLSUploaderConfiguration * _Nonnull)config; + +/*! + @method initWithConfiguration: + @abstract 初始化 PLShortVideoUploader + + @return PLShortVideoUploader 实例 + + @since v1.0.4 + */ +- (instancetype _Nullable)initWithConfiguration:(PLSUploaderConfiguration * _Nonnull)config; + +/*! + @method uploadVideoFile: + @abstract 上传视频文件 + + @param videoPath 上传的视频文件存放地址 + + @since v1.0.4 + */ +- (void)uploadVideoFile:(NSString * _Nonnull)videoPath; + +/*! + @method uploadVideoALAsset: + @abstract 上传 ALAsset 类视频资源文件 + + @param asset 上传的 ALAsset 视频文件 + + @since v1.0.5 + */ +- (void)uploadVideoALAsset:(ALAsset * _Nonnull)asset; + +/*! + @method uploadVideoPHAsset: + @abstract 上传 PHAsset 类视频资源文件 + + @param asset 上传的 PHAsset 视频文件 + + @since v1.0.5 + */ +- (void)uploadVideoPHAsset:(PHAsset * _Nonnull)asset; + +/*! + @method cancelUploadVidoFile + @abstract 取消上传视频 + + @since v1.0.4 + */ +- (void)cancelUploadVidoFile; + +@end diff --git a/Pod/Library/PLShortVideoKit.framework/Info.plist b/Pod/Library/Profession/PLShortVideoKit.framework/Info.plist similarity index 65% rename from Pod/Library/PLShortVideoKit.framework/Info.plist rename to Pod/Library/Profession/PLShortVideoKit.framework/Info.plist index 20ef18fd..0b737a94 100644 Binary files a/Pod/Library/PLShortVideoKit.framework/Info.plist and b/Pod/Library/Profession/PLShortVideoKit.framework/Info.plist differ diff --git a/Pod/Library/Profession/PLShortVideoKit.framework/Modules/module.modulemap b/Pod/Library/Profession/PLShortVideoKit.framework/Modules/module.modulemap new file mode 100644 index 00000000..d6c2ef59 --- /dev/null +++ b/Pod/Library/Profession/PLShortVideoKit.framework/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module PLShortVideoKit { + umbrella header "PLShortVideoKit.h" + + export * + module * { export * } +} diff --git a/Pod/Library/PLShortVideoKit.framework/PLShortVideoKit b/Pod/Library/Profession/PLShortVideoKit.framework/PLShortVideoKit similarity index 84% rename from Pod/Library/PLShortVideoKit.framework/PLShortVideoKit rename to Pod/Library/Profession/PLShortVideoKit.framework/PLShortVideoKit index 11737a34..788b8a32 100644 Binary files a/Pod/Library/PLShortVideoKit.framework/PLShortVideoKit and b/Pod/Library/Profession/PLShortVideoKit.framework/PLShortVideoKit differ diff --git a/Pod/Library/Profession/libMuseProcessor.a b/Pod/Library/Profession/libMuseProcessor.a new file mode 100644 index 00000000..ed5e2127 Binary files /dev/null and b/Pod/Library/Profession/libMuseProcessor.a differ diff --git a/README.md b/README.md index 96d8492e..88e2b8fd 100644 --- a/README.md +++ b/README.md @@ -1,125 +1,81 @@ -# PLShortVideoKit - -PLShortVideoKit 是七牛推出的一款适用于 iOS 平台的短视频 SDK,提供了包括美颜、滤镜、水印、断点录制、分段回删、视频编辑、混音特效、MV 特效、本地/云端存储在内的多种功能,支持高度定制以及二次开发。 - -# 1 功能列表 -短视频 SDK 的功能,主要分为 4 大块:拍摄、编辑、转码、上传。 - -## 1.1 视频拍摄 -| 功能点 | 版本 | -| ------------------- | -------- | -| 摄像头采集 | 1.0.0(+) | -| 麦克风采集 | 1.0.0(+) | -| 静音功能 | 1.0.0(+) | -| 实时美颜 | 1.0.0(+) | -| 贴纸特效 | 1.0.0(+) | -| 大眼/瘦脸 | 1.0.0(+) | -| 闪光灯开关 | 1.0.0(+) | -| 第三方美颜接口 | 1.0.0(+) | -| 第三方滤镜接口 | 1.0.0(+) | -| 自定义拍摄时长 | 1.0.0(+) | -| 自定义分辨率 | 1.0.0(+) | -| 自定义视频帧率 | 1.0.0(+) | -| 自定义视频码率 | 1.0.0(+) | -| 支持 1:1 正方形录制 | 1.0.0(+) | -| 断点拍摄(多段录制) | 1.0.0(+) | -| 回删视频 | 1.0.0(+) | -| H.264 硬编 | 1.0.0(+) | -| AAC 硬编 | 1.0.0(+) | -| 输出 mp4 文件 | 1.0.0(+) | -| 支持 ARM7, ARM64 及模拟器 | 1.0.0(+) | -| 实时滤镜 | 1.0.0(+) | -| 实时水印 | 1.0.0(+) | -| 手动对焦 | 1.0.0(+) | -| 自动对焦 | 1.0.0(+) | -| 曝光调节 | 1.0.0(+) | -| 横屏拍摄 | 1.3.0(+) | -| 倍速拍摄 | 1.4.0(+) | -| AR 特效拍摄 | 1.6.0(+) | -| 录制背景音乐 | 1.7.0(+) | -| 视频草稿 | 1.7.0(+) | -| 拍摄时截图 | 1.9.0(+) | -| 分段特效 | 1.11.0(+)| -| 多视频合并 | 1.11.0(+)| -| 素材视频合拍 | 1.11.0(+)| -| 分段变速 | 1.15.0(+) | -| GIF 水印 | 1.15.0(+) | -| 图片、GIF 图和视频混排 | 1.16.0(+) | - -### 1.1.1 录屏 -| 功能点 | 版本 | -| --------------------- | --------- | -| 外部导入音视频数据 | 1.2.0(+) | - -## 1.2 视频编辑 -### 1.2.1 视频剪辑 -| 功能点 | 版本 | -| ------ | -------- | -| 关键帧预览 | 1.0.2(+) | -| 剪辑指定区间 | 1.0.2(+) | -| 截取封面 | 1.0.2(+) | -| 视频分割 | 1.10.0(+) | - -### 1.2.2 视频特效 -| 功能点 | 版本 | 备注 | -| ----- | -------- |-------- | -| 滤镜 | 1.0.0(+) | 无 | -| 水印 | 1.0.0(+) | 无 | -| 贴纸特效 | 1.0.0(+) | 基于面部识别,需要额外付费 | -| 大眼/瘦脸 | 1.0.0(+) | 基于面部识别,需要额外付费 | -| MV 特效 | 1.5.0(+) | 无 | -| 时光倒流特效 | 1.5.0(+) | 无 | -| 配音 | 1.6.0(+) | 无 | -| 变速 | 1.6.0(+) | 无 | -| 旋转 | 1.7.0(+) | 无 | -| 视频首帧作为滤镜封面图 | 1.7.0(+) | 无 | -| 文字特效 | 1.7.0(+) | 无 | -| 视频涂鸦 | 1.7.0(+) | 无 | -| 视频贴纸 | 1.7.0(+) | 无 | -| 抖音特效 | 1.9.0(+) | 需要额外付费 | -| 分段特效 | 1.11.0(+) | 无 | - -### 1.2.3 音频特效 -| 功能点 | 版本 | -| ---------- | -------- | -| 音频混合 | 1.0.3(+) | -| 截取音频片段 | 1.0.3(+) | -| 调节原声/背景声音量 | 1.0.3(+) | -| 多重混音 | 1.11.0(+) | 无 | - -### 1.2.4 视频合成 -| 功能点 | 版本 | -| ---------------- | -------- | -| 制作 GIF 动图 | 1.3.0(+) | -| 多视频拼接 | 1.4.0(+) | -| 片头片尾 MV 拼接 | 1.4.0(+) | -| 图片合成视频 | 1.7.0(+) | -| 多个视频合并 | 1.11.0(+) | -| 图片、GIF 图和视频混排| 1.16.0(+) | - -### 1.2.5 视频转码 -| 功能点 | 版本 | -| ---- | -------- | -| 画面剪裁 | 1.1.0(+) | -| 码率变换 | 1.1.0(+) | - -### 1.2.6 文字动画生成视频文件 -| 功能点 | 版本 | -| ------------------ | -------- | -| 文字动画生成视频文件 | 1.10.0(+) | - -## 1.3 视频上传 -| 功能点 | 版本 | -| ---- | -------- | -| 上传云端 | 1.0.4(+) | -| 断点续传 | 1.1.0(+) | - -## 2. 设备以及系统要求 +# 1 产品简介 +七牛短视频 SDK,方便开发者快速实现短视频拍摄、剪辑、编辑、合成、分发功能。我们提供 80+ 功能供开发使用,申请 **0 元体验**可联系销售或[填写表单](https://jinshuju.net/f/IeOD89?ref=www.qiniu.com)获得产品试用权限。 +# 2 多版本功能分布 +短视频 SDK 主要区分基础版、进阶版、专业版 3 个版本,不同版本的功能区别见如下表格 + +| 功能 | 子功能 | 基础版 | 进阶版 | 专业版 | +| :----------------------------------------------------------- | :----------------------------------------------------------- | :---------------------: | :---------------------: | :----------------------: | +| **用户交互界面** | **提供了一套完整的UI交互源码,可复用或自定义** | ✓ | ✓ | ✓ | +| **视频拍摄录制** | **摄像头采集** | ✓ | ✓ | ✓ | +| | **麦克风采集** | ✓ | ✓ | ✓ | +| | **视频采集参数定义**
*支持最高 1080P 拍摄,支持自定义视频采集源、采集画面的分辨率、采集画面的长宽比等参数* | ✓ | ✓ | ✓ | +| | **音频采集参数定义**
*支持自定义音频采集源、音频格式、音频声道、音频采样率等参数* | ✓ | ✓ | ✓ | +| | **视频编码参数定义**
*支持自定义编码视频的码率、帧率、分辨率、H.264 编码方式等参数* | ✓ | ✓ | ✓ | +| | **音频编码参数定义**
*支持自定义编码音频的码率、采样率、声道数、AAC 编码方式等参数* | ✓ | ✓ | ✓ | +| | **拍摄时长设置**
*支持设置实际拍摄过程中的最大、最小拍摄时长* | ✓ | ✓ | ✓ | +| | **摄像头切换**
*支持切换前后摄像头进行拍摄* | ✓ | ✓ | ✓ | +| | **闪光灯设置**
*支持开关闪光灯用于拍摄时的补光* | ✓ | ✓ | ✓ | +| | **曝光调节**
*支持调整曝光度参数* | ✓ | ✓ | ✓ | +| | **画面对焦**
*支持手动对焦和自动对焦* | ✓ | ✓ | ✓ | +| | **焦距调节**
*支持手动调节画面焦距进行放大、缩小* | ✓ | ✓ | ✓ | +| | **画面镜像**
*支持设置是否镜像预览画面和编码画面* | ✓ | ✓ | ✓ | +| | **横屏拍摄**
*支持根据设备的方向自动确定竖屏、横屏拍摄* | ✓ | ✓ | ✓ | +| | **分段拍摄**
*支持拍摄过程中实现连续多次拍摄、断点续拍、回删* | ✓ | ✓ | ✓ | +| | **变速拍摄**
*支持设置拍摄时的快/慢速率,目前支持 5 种拍摄速率* | ✗ | ✓ | ✓ | +| | **音频录制**
*支持纯音频录制* | ✓ | ✓ | ✓ | +| | **音频录制(图片特效)**
*支持音频录制的过程中,增加图片旋转效果,输出为 mp4 文件* | ✗ | ✓ | ✓ | +| | **背景音乐**
*支持拍摄前选择本地文件作为背景音乐* | ✗ | ✓ | ✓ | +| | **实时截图**
*支持拍摄时实时截图拍照保存到本地* | ✓ | ✓ | ✓ | +| | **静音功能**
*支持静音拍摄* | ✓ | ✓ | ✓ | +| | **分屏拍摄(合拍)**
*可以根据素材视频(或图片)进行合拍,生成双画面视频* | ✗ | ✗ | ✓ | +| | **屏幕录制(全屏) / View 录制(局部)**
*支持对整个屏幕或部分区域进行录制,实现整体或局部的录制效果* | ✗ | ✓
全屏 | ✓
全屏+局部 | +| | **外部导入**
*支持外部音视频裸数据导入,生成 mp4 文件* | ✗ | ✗ | ✓ | +| | **前后台切换**
*根据监听到 Application 的前后台状态自动停止和开始录制视频,默认从后台进入前台自动开始录制* | ✓ | ✓ | ✓ | +| | **实时水印**
*支持拍摄时添加静态水印,支持设置水印位置、大小、透明度,设置作用时间范围* | ✗ | ✓ | ✓ | +| | **实时美颜**
*支持拍摄时启用美颜功能,支持设置美颜、美白、红润 3 种效果并调节强度* | ✓ | ✓ | ✓ | +| | **实时滤镜**
*支持拍摄时启用滤镜功能,支持自由调节多种滤镜效果(33 种)* | ✓
提供 10 种滤镜效果 | ✓
提供 10 种滤镜效果 | ✓
提供 33 种滤镜效果 | +| | **实时预览**
*支持实时本地预览* | ✓ | ✓ | ✓ | +| | **草稿箱**
*支持将当前录制的片段与设置项存入草稿箱* | ✓ | ✓ | ✓ | +| **视频剪辑合成** | **视频导入**
*支持本地视频快速导入后编辑* | ✓ | ✓ | ✓ | +| | **编辑预览**
*支持编辑时实时预览本地效果* | ✓ | ✓ | ✓ | +| | **视频剪辑**
*支持按照给定的时间范围生成一个 mp4 文件* | ✓ | ✓ | ✓ | +| | **视频剪裁**
*支持按照视频画面大小(原比例、指定区域)精确裁剪视频生成一个 mp4 文件* | ✗ | ✗ | ✓ | +| | **视频转码**
*支持按照给定的目标旋转角度、码率、帧率等参数,生成一个 mp4 文件* | ✓ | ✓ | ✓ | +| | **视频拼接**
*基础功能:支持设置多个视频按照前后顺序导入拼接生成一个 mp4 文件*
*高级功能:支持设置多个视频的时间范围按照前后顺序导入拼接生成一个 mp4 文件(先分割后拼接)* | ✗ | ✓
基础功能 | ✓
基础功能 + 高级功能 | +| | **视频合成**
*支持设置多个视频合并为一个视频,支持设置每一个视频的位置、大小、开始播放时间等* | ✗ | ✗ | ✓ | +| | **GIF动画**
*支持基于多个图片或视频直接导出GIF动图* | ✗ | ✓ | ✓ | +| | **图片拼接**
*支持设置多个图片按照前后顺序导入拼接生成一个 mp4 文件* | ✗ | ✓ | ✓ | +| | **图片 & GIF 图 & 视频混拼**
*支持设置多个视频和图片按照前后顺序导入拼接生成一个 mp4 文件* | ✗ | ✗ | ✓ | +| **视频编辑处理** | **滤镜特效**
*支持给视频文件添加滤镜效果,默认支持33种滤镜效果* | ✗ | ✓
提供 10 种滤镜效果 | ✓
提供 33 种滤镜效果 | +| | **贴纸特效**
*支持给视频文件添加静态贴纸,并且能够自由设置贴纸大小、位置、旋转角度,支持设置特效显示的时间范围,可以自定义素材或使用供应商提供的收费素材* | ✗ | ✓ | ✓ | +| | **水印特效**
*支持给视频文件添加静态、动态水印,并且能够自由设置水印的大小、位置、透明度、旋转角度,支持设置特效显示的时间范围,可以自定义素材或使用供应商提供的收费素材* | ✗ | ✓ | ✓ | +| | **时间特效**
*支持对视频文件进行整体变速、分段变速,支持5种变速效果(极慢、慢、正常、快、极快)*
*支持1种倒放操作(即时光倒流特效)* | ✗ | ✓
变速 | ✓
变速+倒序 | +| | **字幕特效**
*支持给视频文件添加文字特效,支持设置文字内容,字体大小,字体颜色,透明度,旋转,位置等,支持设置特效显示的时间范围* | ✗ | ✓ | ✓ | +| | **MV特效**
*支持给视频文件添加 MV 效果,默认提供 4 种 MV 特效,MV 特效素材需要客户自行按要求制作* | ✗ | ✗ | ✓ | +| | **涂鸦特效**
*支持画笔尺寸和颜色调整,支持设置特效显示的时间范围* | ✗ | ✓ | ✓ | +| | **基础转场**
*支持在视频图片片段之间,增加淡入淡出效果* | ✗ | ✓ | ✓ | +| | **过场字幕**
*支持在视频之间增加转场字幕,支持定义转场字幕的背景色、持续时间、支持文字和图片特效,支持旋转、放大、位置移动、淡入淡出 4 种效果* | ✗ | ✗ | ✓ | +| | **混音特效**
*支持给视频文件添加多个背景音乐,支持调整视频原声、背景音乐音量,支持设置多个背景音乐有效时间区域* | ✗ | ✓
支持单音频混音 | ✓
支持多音频混音 | +| | **旋转特效**
*支持设置视频左右上下旋转,实时预览旋转效果* | ✗ | ✓ | ✓ | +| **视频播放** | **播放器SDK** | ✓ | ✓ | ✓ | +| **上传分发** | **视频上传** | ✓ | ✓ | ✓ | +| | **断点续传** | ✓ | ✓ | ✓ | +| | **上传加速** | ✓ | ✓ | ✓ | +| **接口扩展** | **扩展接口支持对接第三方美颜特效等增值能力** | ✓ | ✓ | ✓ | +| **增值能力**
(需要客户单独选购,在视频拍摄或视频编辑阶段增加) | **高级美颜**
*拍摄设置大眼、瘦脸、V脸、下巴调整、短脸、小鼻效果,并支持调节强度* | ✓ | ✓ | ✓ | +| | **人脸贴纸**
*支持人脸识别,进行人脸 2D、3D 贴纸操作* | ✓ | ✓ | ✓ | +| | **手势识别**
*可以对拍摄的人物的特定手势进行识别,配合其他特效*| ✓ | ✓ | ✓ | +| | **AR 特效**
*支持拍摄时设置AR特效* | ✓ | ✓ | ✓ | +| | **变声混响**
*拍摄时对录制的人音进行变声(如萝莉、大叔)和混响效果等操作(如KTV、会堂)* | ✓ | ✓ | ✓ | +| | **类抖音特效**
*滤镜效果,支持抖动、幻觉、灵魂出窍等数种抖音特效* | ✓ | ✓ | ✓ | +| | **背景抠图**
*将画面中的绿色元素(比如纯绿背景)抠除,替换成其他的元素,比如动态背景/PPT 等* | ✓ | ✓ | ✓ | + +# 3 设备以及系统要求 - 设备要求:搭载 iOS 系统的设备 - 系统要求:iOS 8.0 及其以上 -## 3. 安装方法 +# 4 安装方法 [CocoaPods](https://cocoapods.org/) 是针对 Objective-C 的依赖管理工具,它能够将使用类似 PLShortVideoKit 的第三方库的安装过程变得非常简单和自动化,你能够用下面的命令来安装它: @@ -127,17 +83,22 @@ PLShortVideoKit 是七牛推出的一款适用于 iOS 平台的短视频 SDK, $ sudo gem install cocoapods ``` -### Podfile +## 4.1 Podfile 为了使用 CoacoaPods 集成 PLShortVideoKit 到你的 Xcode 工程当中,你需要编写你的 `Podfile` +## 4.2 专业版安装 +**如果你购买的是七牛专业版本的短视频 SDK,请使用下面的安装方式:** + +### 4.2.1 Podfile 添加专业版 + ```ruby target 'TargetName' do pod 'PLShortVideoKit' end ``` -#### Warnings +### 4.2.2 Warnings **在使用了七牛的推流或连麦 SDK 的工程中,集成该短视频 SDK 会出现美颜库导致的符号冲突问题 duplicate symbol _OBJC_CLASS_ MuseProcessor,解决方法如下** @@ -146,22 +107,80 @@ target 'TargetName' do pod 'PLShortVideoKit/ex-libMuseProcessor' end ``` +### 4.2.3 运行 pod +然后,运行如下的命令: + +```bash +$ pod install +``` +## 4.3 进阶版安装 +**如果你购买的是七牛进阶版本的短视频 SDK,请使用下面的安装方式:** + +### 4.3.1 Podfile 添加进阶版 + +```ruby +target 'TargetName' do +pod 'PLShortVideoKit', :podspec => 'https://raw.githubusercontent.com/pili-engineering/PLShortVideoKit/master/PLShortVideoKit-Advanced.podspec' +end +``` + +### 4.3.2 Warnings + +**在使用了七牛的推流或连麦 SDK 的工程中,集成该短视频 SDK 会出现美颜库导致的符号冲突问题 duplicate symbol _OBJC_CLASS_ MuseProcessor,解决方法如下** + +```ruby +target 'TargetName' do +pod 'PLShortVideoKit/ex-libMuseProcessor', :podspec => 'https://raw.githubusercontent.com/pili-engineering/PLShortVideoKit/master/PLShortVideoKit-Advanced.podspec' +end +``` +### 4.3.3 运行 pod +然后,运行如下的命令: + +```bash +$ pod install +``` + +## 4.4 基础版安装 +**如果你购买的是七牛基础版本的短视频 SDK,请使用下面的安装方式:** +### 4.4.1 Podfile 添加基础版 + +```ruby +target 'TargetName' do +pod 'PLShortVideoKit', :podspec => 'https://raw.githubusercontent.com/pili-engineering/PLShortVideoKit/master/PLShortVideoKit-Basic.podspec' +end +``` + +### 4.4.2 Warnings + +**在使用了七牛的推流或连麦 SDK 的工程中,集成该短视频 SDK 会出现美颜库导致的符号冲突问题 duplicate symbol _OBJC_CLASS_ MuseProcessor,解决方法如下** + +```ruby +target 'TargetName' do +pod 'PLShortVideoKit/ex-libMuseProcessor', :podspec => 'https://raw.githubusercontent.com/pili-engineering/PLShortVideoKit/master/PLShortVideoKit-Basic.podspec' +end +``` +### 4.4.3 运行 pod 然后,运行如下的命令: ```bash $ pod install ``` -## 4. PLShortVideoKit 文档 +## 4.5 Warning +- Podfile 中添加 PLShortVideoKit 时如果不指定 podspec,默认安装的是 **专业版** 的短视频 SDK +- 如果你安装的七牛短视频 SDK 版本和你购买的七牛短视频 SDK 版本不一致,比如购买的基础版,但是使用的是进阶版或者专业版的短视频 SDK,会引起你的 App 产生 crash 。**请一定安装和你购买匹配的短视频 SDK 版本** + + +# 5 PLShortVideoKit 文档 请参考开发者中心文档:[PLShortVideoKit 文档](https://developer.qiniu.com/pili/sdk/3733/short-video-ios-sdk) -## 5. 声明 +# 6 声明 本短视频 SDK 需授权方可使用,可通过 400-808-9176 转 2 号线联系七牛商务咨询,或者 [通过工单](https://support.qiniu.com/?ref=developer.qiniu.com) 联系七牛的技术支持。 -## 6. 反馈及意见 +# 7 反馈及意见 当你遇到任何问题时,可以通过在 GitHub 的 repo 提交 issues 来反馈问题,请尽可能的描述清楚遇到的问题,如果有错误信息也一同附带,并且在 Labels 中指明类型为 bug 或者其他。 diff --git a/ReleaseNotes/release-notes-2.0.0.md b/ReleaseNotes/release-notes-2.0.0.md new file mode 100644 index 00000000..a41dfd29 --- /dev/null +++ b/ReleaseNotes/release-notes-2.0.0.md @@ -0,0 +1,30 @@ +# PLShortVideoKit Release Notes for 2.0.0 + +### 简介 +PLShortVideoKit 是七牛推出的一款适用于 iOS 平台的短视频 SDK,提供了包括美颜、滤镜、水印、断点录制、分段回删、视频编辑、混音特效、MV 特效、本地/云端存储在内的多种功能,支持高度定制以及二次开发。 + +### 版本 +- 发布 PLShortVideoKit.framework + +### 功能 +- 视频编辑 PLShortVideoEditor 在暂停的时候改变 fillMode,支持即时效果刷新 +- 视频拍摄 PLShortVideoRecorder 添加新的相机切换接口,支持设置相机切换完成回调 + +### 优化 +- 优化视频编辑 PLShortVideoEditor 对 1080P 及以上视频进行编辑, 在 iOS 12 系统上内存占用较大的问题 + +### 缺陷 +- 修复视频拍摄 PLShortVideoRecorder 添加背景音乐的时候,自适应横屏拍摄失效的问题 +- 修复视频编辑 PLShortVideoEditor 原视频设置为非循环播放,背景音乐仍然循环播放的问题 +- 修复视频编辑 PLShortVideoEditor 使用 initWithPlayerItem: 方法初始化 crash 的问题 +- 修复视频编辑 PLShortVideoEditor 的 timeRange 设置为 kCMTimeRangeZero 时,设置背景音乐不生效的问题 +- 修复视频导出 AVAssetExportSession 不设置 PLSAudioSettingsKey,音量设置无效的问题 +- 修复视频导出 AVAssetExportSession 添加 MV 的时候,存在内存泄漏的问题 +- 修复视频导出 AVAssetExportSession 完成进度回调可能会从 99% 到 0 的问题 + + +### 注意事项 +- 七牛短视频 SDK 自 v2.0.0 版本起, 划分为基础版、进阶版、专业版。不同版本 SDK 可以使用的功能点数量有差别,请按照购买的 License 版本使用对应的短视频 SDK 版本。 +- 若需要使用 PLShortVideoKit.framework 中的内置滤镜,则必须将 PLShortVideoKit.bundle 导入项目中。若需要增删、替换滤镜资源可操作 PLShortVideoKit.bundle 中的 colorFilter 文件夹。 +- 抖音特效,需要联系七牛商务获取 appkey 和资源文件。具体使用可参看 PLShortVideoKitDemo。 +