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

Unified Diff: webrtc/api/java/android/org/webrtc/CameraEnumerator.java

Issue 2015143004: CameraEnumerationAndroid: Remove Enumerator class (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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
Index: webrtc/api/java/android/org/webrtc/CameraEnumerator.java
diff --git a/webrtc/api/java/android/org/webrtc/CameraEnumerator.java b/webrtc/api/java/android/org/webrtc/CameraEnumerator.java
index 04edba83790c259d74c7565f62b4676be08b25f3..90d9487ba3ccfa91facc8ccb7880d19d5b2f4a5d 100644
--- a/webrtc/api/java/android/org/webrtc/CameraEnumerator.java
+++ b/webrtc/api/java/android/org/webrtc/CameraEnumerator.java
@@ -19,27 +19,24 @@ import java.util.ArrayList;
import java.util.List;
@SuppressWarnings("deprecation")
-public class CameraEnumerator implements CameraEnumerationAndroid.Enumerator {
+public class CameraEnumerator {
private final static String TAG = "CameraEnumerator";
// Each entry contains the supported formats for corresponding camera index. The formats for all
// cameras are enumerated on the first call to getSupportedFormats(), and cached for future
// reference.
- private List<List<CaptureFormat>> cachedSupportedFormats;
+ private static List<List<CaptureFormat>> cachedSupportedFormats;
- @Override
- public List<CaptureFormat> getSupportedFormats(int cameraId) {
- synchronized (this) {
- if (cachedSupportedFormats == null) {
- cachedSupportedFormats = new ArrayList<List<CaptureFormat>>();
- for (int i = 0; i < CameraEnumerationAndroid.getDeviceCount(); ++i) {
- cachedSupportedFormats.add(enumerateFormats(i));
- }
+ public static synchronized List<CaptureFormat> getSupportedFormats(int cameraId) {
+ if (cachedSupportedFormats == null) {
+ cachedSupportedFormats = new ArrayList<List<CaptureFormat>>();
+ for (int i = 0; i < CameraEnumerationAndroid.getDeviceCount(); ++i) {
+ cachedSupportedFormats.add(enumerateFormats(i));
}
}
return cachedSupportedFormats.get(cameraId);
}
- private List<CaptureFormat> enumerateFormats(int cameraId) {
+ private static List<CaptureFormat> enumerateFormats(int cameraId) {
Logging.d(TAG, "Get supported formats for camera index " + cameraId + ".");
final long startTimeMs = SystemClock.elapsedRealtime();
final android.hardware.Camera.Parameters parameters;

Powered by Google App Engine
This is Rietveld 408576698