Choosing the right AVCaptureSessionPreset for different devices

前端 未结 2 381
無奈伤痛
無奈伤痛 2021-01-27 03:57

I am a little confused which preset I should use for different devices. Currently I am using AVCaptureSessionPresetMedium for all devices. However, I want to take a

2条回答
  •  无人共我
    2021-01-27 04:32

    #ifdef __AVAILABILITY_INTERNAL__IPHONE_9_0_DEP__IPHONE_9_0
    CGFloat iOSVersion = [[[UIDevice currentDevice] systemVersion] integerValue];
    if (iOSVersion>=9 && [session canSetSessionPreset:AVCaptureSessionPreset3840x2160]) {
        session.sessionPreset = AVCaptureSessionPreset3840x2160;
    }
    #else
    // the code above won't compile in Xcode 6 and older
    #endif
    

    ...

提交回复
热议问题