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

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

Issue 2024843002: Refactor VideoCapturerAndroid tests in WebRTC. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Reorder imports to match Java style guide Created 4 years, 6 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/VideoCapturerAndroid.java
diff --git a/webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java b/webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java
index 4a5ae1534121d923c52c92513cb6bc732e794919..f40f7e672863010e872481371dbfb2ca2f53c3c5 100644
--- a/webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java
+++ b/webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java
@@ -10,15 +10,14 @@
package org.webrtc;
+import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
+
import android.content.Context;
import android.os.Handler;
import android.os.SystemClock;
import android.view.Surface;
import android.view.WindowManager;
-import org.webrtc.CameraEnumerationAndroid.CaptureFormat;
-import org.webrtc.Logging;
-
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.HashSet;
@@ -199,7 +198,7 @@ public class VideoCapturerAndroid implements
// Helper function to retrieve the current camera id synchronously. Note that the camera id might
// change at any point by switchCamera() calls.
- int getCurrentCameraId() {
+ private int getCurrentCameraId() {
synchronized (cameraIdLock) {
return id;
}
@@ -223,7 +222,7 @@ public class VideoCapturerAndroid implements
if (cameraName == null || cameraName == "") {
this.id = 0;
} else {
- this.id = getCameraIndex(cameraName);
+ this.id = CameraEnumerationAndroid.getCameraIndex(cameraName);
}
this.eventsHandler = eventsHandler;
isCapturingToTexture = captureToTexture;
@@ -240,18 +239,6 @@ public class VideoCapturerAndroid implements
}
}
- // Returns the camera index for camera with name |deviceName|, or throws IllegalArgumentException
- // if no such camera can be found.
- private static int getCameraIndex(String deviceName) {
- Logging.d(TAG, "getCameraIndex: " + deviceName);
- for (int i = 0; i < android.hardware.Camera.getNumberOfCameras(); ++i) {
- if (deviceName.equals(CameraEnumerationAndroid.getDeviceName(i))) {
- return i;
- }
- }
- throw new IllegalArgumentException("No such camera: " + deviceName);
- }
-
private boolean maybePostOnCameraThread(Runnable runnable) {
return maybePostDelayedOnCameraThread(0 /* delayMs */, runnable);
}
« no previous file with comments | « webrtc/api/java/android/org/webrtc/CameraEnumerationAndroid.java ('k') | webrtc/api/java/src/org/webrtc/VideoCapturer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698