react-native-camera
react-native-camera copied to clipboard
Android: add RecordOptions.fps support when using Camera2Api
Adding Android Camera2 support for controlling fps through recordAsync(). The key for this to work was setting CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE.
Along with this, I made an attempt at implementing Camera2.getSupportedPreviewFpsRange() by making it into a wrapper call around mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES). I'm not sure if this is desired, and I mainly only did this to keep consistent with Camera1, so feel free to tell me to revert it.
Test Devices:
- Pixel 4: cameraType: 'front', 'back'; cameraId: '2' (NIR)
- Pixel 5: cameraType: 'front', 'back'
- iPhone XS: cameraType: 'front', 'back'