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

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

Issue 1702603002: AndroidVideoCapturer getSupportedFormats(): Change interface from JSON string to List/vector (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove logging from C++. Remove json from api.gyp. Created 4 years, 10 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 | « webrtc/api/api.gyp ('k') | webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/java/android/org/webrtc/CameraEnumerationAndroid.java
diff --git a/webrtc/api/java/android/org/webrtc/CameraEnumerationAndroid.java b/webrtc/api/java/android/org/webrtc/CameraEnumerationAndroid.java
index f465ce74be6fac8d83cf58e7cda5d001534e0b7e..02328385ada8b284104bfc8d399acef03738f5da 100644
--- a/webrtc/api/java/android/org/webrtc/CameraEnumerationAndroid.java
+++ b/webrtc/api/java/android/org/webrtc/CameraEnumerationAndroid.java
@@ -14,10 +14,6 @@ import static java.lang.Math.abs;
import static java.lang.Math.ceil;
import android.graphics.ImageFormat;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
import org.webrtc.Logging;
import java.util.Collections;
@@ -42,7 +38,9 @@ public class CameraEnumerationAndroid {
}
public static synchronized List<CaptureFormat> getSupportedFormats(int cameraId) {
- return enumerator.getSupportedFormats(cameraId);
+ final List<CaptureFormat> formats = enumerator.getSupportedFormats(cameraId);
+ Logging.d(TAG, "Supported formats for camera " + cameraId + ": " + formats);
+ return formats;
}
public static class CaptureFormat {
@@ -137,21 +135,6 @@ public class CameraEnumerationAndroid {
return getNameOfDevice(android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK);
}
- public static String getSupportedFormatsAsJson(int id) throws JSONException {
- List<CaptureFormat> formats = getSupportedFormats(id);
- JSONArray json_formats = new JSONArray();
- for (CaptureFormat format : formats) {
- JSONObject json_format = new JSONObject();
- json_format.put("width", format.width);
- json_format.put("height", format.height);
- json_format.put("framerate", (format.maxFramerate + 999) / 1000);
- json_formats.put(json_format);
- }
- Logging.d(TAG, "Supported formats for camera " + id + ": "
- + json_formats.toString(2));
- return json_formats.toString();
- }
-
// Helper class for finding the closest supported format for the two functions below.
private static abstract class ClosestComparator<T> implements Comparator<T> {
// Difference between supported and requested parameter.
« no previous file with comments | « webrtc/api/api.gyp ('k') | webrtc/api/java/android/org/webrtc/VideoCapturerAndroid.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698