1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| - (void)doSetFrameRate:(int32_t)frameRate { if (![self supportsVideoFrameRate:frameRate]) { // NSLog(@"CameraCaptureFilter not support framerate %d", newFrameRate); return; } AVCaptureDevice *videoDevice = _device; if ([videoDevice lockForConfiguration:NULL]) { [videoDevice setActiveVideoMinFrameDuration:CMTimeMake(1, frameRate)]; [videoDevice setActiveVideoMaxFrameDuration:CMTimeMake(1, frameRate)]; [videoDevice unlockForConfiguration]; _frameRate = frameRate; _cameraJustChanged = YES; } }
|