1.IOS改变摄像机倍数:修改AVCaptureDevice对象的videoZoomFactor值
注:在设置前要通知AVCaptureSession对象,使用beginConfiguration方法,设置后,使用commitConfiguration方法提交。
AVCaptureSession *session = [[AVCaptureSession alloc] init];
AVCaptureDevice *camera = [AVCaptureDevice
defaultDeviceWithMediaType:AVMediaTypeVideo];
[session beginConfiguration];
camera.videoZoomFactor = 3.0;
[session commitConfiguration];
但是使用这种会卡屏,如果想连贯性,可以使用锁:
NSError *error;
AVCaptureDevice *camera = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
[camera lockForConfiguration:&error];
camera.videoZoomFactor = zoom;
[camera unlockForConfiguration];
这样会连贯起来,譬如通过手势缩放来改变摄像头变焦倍数。
2.BitCode
今天真机编译时,报了一个错,是bitcode的错误“(xxx.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)”
去网上查了下,是因为我引用的第三方库不支持bitcode,