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

Unified Diff: media/capture/video/android/java/src/org/chromium/media/VideoCaptureFactory.java

Issue 1714913002: Reland: Move VideoCapture* files from media/base/android/... to media/capture/video/android/java/... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp-gn files and added a capture_jni_registrar 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
Index: media/capture/video/android/java/src/org/chromium/media/VideoCaptureFactory.java
diff --git a/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureFactory.java
similarity index 86%
rename from media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java
rename to media/capture/video/android/java/src/org/chromium/media/VideoCaptureFactory.java
index 7c70c9d072be100c85f1f9c69d44951707bd1fe5..c88f9f7d582429300afd07c74a31d79a3e7e766e 100644
--- a/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java
+++ b/media/capture/video/android/java/src/org/chromium/media/VideoCaptureFactory.java
@@ -25,14 +25,13 @@ import org.chromium.base.annotations.JNINamespace;
@JNINamespace("media")
@SuppressWarnings("deprecation")
class VideoCaptureFactory {
-
// Internal class to encapsulate camera device id manipulations.
static class ChromiumCameraInfo {
// Special devices have more cameras than usual. Those devices are
// identified by model & device. Currently only the Tango is supported.
// Note that these devices have no Camera.CameraInfo.
private static final String[][] SPECIAL_DEVICE_LIST = {
- {"Peanut", "peanut"},
+ {"Peanut", "peanut"},
};
private static int sNumberOfSystemCameras = -1;
private static final String TAG = "cr.media";
@@ -71,11 +70,10 @@ class VideoCaptureFactory {
!= PackageManager.PERMISSION_GRANTED) {
sNumberOfSystemCameras = 0;
Log.w(TAG, "Missing android.permission.CAMERA permission, "
- + "no system camera available.");
+ + "no system camera available.");
} else {
if (isLReleaseOrLater()) {
- sNumberOfSystemCameras =
- VideoCaptureCamera2.getNumberOfCameras(appContext);
+ sNumberOfSystemCameras = VideoCaptureCamera2.getNumberOfCameras(appContext);
} else {
sNumberOfSystemCameras = VideoCaptureAndroid.getNumberOfCameras();
if (isSpecialDevice()) {
@@ -98,18 +96,13 @@ class VideoCaptureFactory {
static VideoCapture createVideoCapture(
Context context, int id, long nativeVideoCaptureDeviceAndroid) {
if (isLReleaseOrLater() && !VideoCaptureCamera2.isLegacyDevice(context, id)) {
- return new VideoCaptureCamera2(context,
- id,
- nativeVideoCaptureDeviceAndroid);
+ return new VideoCaptureCamera2(context, id, nativeVideoCaptureDeviceAndroid);
}
if (!ChromiumCameraInfo.isSpecialCamera(id)) {
- return new VideoCaptureAndroid(context,
- id,
- nativeVideoCaptureDeviceAndroid);
+ return new VideoCaptureAndroid(context, id, nativeVideoCaptureDeviceAndroid);
}
- return new VideoCaptureTango(context,
- ChromiumCameraInfo.toSpecialCameraId(id),
- nativeVideoCaptureDeviceAndroid);
+ return new VideoCaptureTango(
+ context, ChromiumCameraInfo.toSpecialCameraId(id), nativeVideoCaptureDeviceAndroid);
}
@CalledByNative
@@ -122,8 +115,7 @@ class VideoCaptureFactory {
if (isLReleaseOrLater()) {
return VideoCaptureCamera2.getCaptureApiType(id, appContext);
} else if (ChromiumCameraInfo.isSpecialCamera(id)) {
- return VideoCaptureTango.getCaptureApiType(
- ChromiumCameraInfo.toSpecialCameraId(id));
+ return VideoCaptureTango.getCaptureApiType(ChromiumCameraInfo.toSpecialCameraId(id));
} else {
return VideoCaptureAndroid.getCaptureApiType(id);
}
@@ -146,7 +138,7 @@ class VideoCaptureFactory {
}
return ChromiumCameraInfo.isSpecialCamera(id)
? VideoCaptureTango.getDeviceSupportedFormats(
- ChromiumCameraInfo.toSpecialCameraId(id))
+ ChromiumCameraInfo.toSpecialCameraId(id))
: VideoCaptureAndroid.getDeviceSupportedFormats(id);
}

Powered by Google App Engine
This is Rietveld 408576698