react-native-camera icon indicating copy to clipboard operation
react-native-camera copied to clipboard

Android: add RecordOptions.fps support when using Camera2Api

Open tamnnn opened this issue 4 years ago • 0 comments

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'

tamnnn avatar Jun 05 '21 02:06 tamnnn