Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1652)

Unified Diff: webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java

Issue 2174343002: Fix a bug where Camera2 tried to start on FPS ranges multiplied by 1000. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Style Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/api/android/java/src/org/webrtc/Camera2Enumerator.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java
diff --git a/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java b/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java
index c3c912acd5bbdc922a0308850d31582f72ae2737..7473459e049b3fe1ec225fbd4f10c7411d9987bb 100644
--- a/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java
+++ b/webrtc/api/android/java/src/org/webrtc/Camera2Capturer.java
@@ -412,18 +412,16 @@ public class Camera2Capturer implements
return;
}
+ Range<Integer>[] fpsRanges =
+ cameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES);
+ fpsUnitFactor = Camera2Enumerator.getFpsUnitFactor(fpsRanges);
List<CaptureFormat.FramerateRange> framerateRanges =
- Camera2Enumerator.getSupportedFramerateRanges(cameraCharacteristics);
+ Camera2Enumerator.convertFramerates(fpsRanges, fpsUnitFactor);
List<Size> sizes = Camera2Enumerator.getSupportedSizes(cameraCharacteristics);
if (framerateRanges.isEmpty() || sizes.isEmpty()) {
reportError("No supported capture formats.");
}
-
- // Some LEGACY camera implementations use fps rates that are multiplied with 1000. Make sure
- // all values are multiplied with 1000 for consistency.
- this.fpsUnitFactor = (framerateRanges.get(0).max > 1000) ? 1 : 1000;
-
final CaptureFormat.FramerateRange bestFpsRange =
CameraEnumerationAndroid.getClosestSupportedFramerateRange(
framerateRanges, requestedFramerate);
« no previous file with comments | « no previous file | webrtc/api/android/java/src/org/webrtc/Camera2Enumerator.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698