完成ios端参数处理,ios端基本可用

This commit is contained in:
zher52 2021-10-11 21:58:33 +08:00
parent 02fa78b9e3
commit bf248c7fc4
3 changed files with 12 additions and 11 deletions

View File

@ -35,6 +35,7 @@
*/
- (AVCaptureVideoPreviewLayer *)previewLayer;
+ (instancetype) createFromOption:(SGRecordOptions*)options;
/**

View File

@ -44,12 +44,12 @@ typedef void(^PropertyChangeBlock)(AVCaptureDevice *captureDevice);
@end
@implementation SGRecordManager
- (instancetype)init {
self = [super init];
if (self) {
self.maxRecordTime = self.options.duration.intValue;
}
return self;
+ (instancetype) createFromOption:(SGRecordOptions*)options{
SGRecordManager *manager =[[SGRecordManager alloc] init];
manager.options = options;
manager.maxRecordTime = manager.options.duration.floatValue;
return manager;
}
#pragma mark -
@ -198,8 +198,8 @@ typedef void(^PropertyChangeBlock)(AVCaptureDevice *captureDevice);
//
if ([_recordSession canAddOutput:self.videoOutput]) {
[_recordSession addOutput:self.videoOutput];
_cx = self.options.width;
_cy = self.options.height;
_cx = self.options.width.intValue;
_cy = self.options.height.intValue;
}
//
if ([_recordSession canAddOutput:self.audioOutput]) {

View File

@ -16,7 +16,8 @@
#import "UIButton+Convenience.h"
#import "SGRecordOptions.h"
#import "SGMotionManager.h"
#define WEAKSELF __weak typeof(self) weakSelf = self;
#define STRONGSELF __strong typeof(weakSelf) strongSelf = weakSelf;
#define TIMER_INTERVAL 0.5 //
#define RECORD_TIME 0.5 //
@interface SGRecordViewController ()<SGRecordEngineDelegate,UIGestureRecognizerDelegate,SGMotionManagerDeviceOrientationDelegate>
@ -160,8 +161,7 @@
#pragma mark - setget
- (SGRecordManager *)recordManger {
if (!_recordManger) {
_recordManger = [[SGRecordManager alloc] init];
_recordManger.options = self.options;
_recordManger = [SGRecordManager createFromOption: self.options];
_recordManger.delegate = self;
}
return _recordManger;