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

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

Issue 834423003: Disable Camera2 API for devices with legacy hardware support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/base/android/java/src/org/chromium/media/VideoCaptureFactory.java
diff --git a/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java b/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java
index 87d0efd5ba40f90040396bc216cefabdf5af0067..ae6018df908b16031a52bfed8a9ebc28cf4f2740 100644
--- a/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java
+++ b/media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java
@@ -96,7 +96,7 @@ class VideoCaptureFactory {
@CalledByNative
static VideoCapture createVideoCapture(
Context context, int id, long nativeVideoCaptureDeviceAndroid) {
- if (isLReleaseOrLater()) {
+ if (isLReleaseOrLater() && !VideoCaptureCamera2.isLegacyDevice(context, id)) {
return new VideoCaptureCamera2(context,
id,
nativeVideoCaptureDeviceAndroid);
@@ -118,7 +118,7 @@ class VideoCaptureFactory {
@CalledByNative
static String getDeviceName(int id, Context appContext) {
- if (isLReleaseOrLater()) {
+ if (isLReleaseOrLater() && !VideoCaptureCamera2.isLegacyDevice(appContext, id)) {
return VideoCaptureCamera2.getName(id, appContext);
}
return (ChromiumCameraInfo.isSpecialCamera(id))
@@ -128,7 +128,7 @@ class VideoCaptureFactory {
@CalledByNative
static VideoCapture.CaptureFormat[] getDeviceSupportedFormats(Context appContext, int id) {
- if (isLReleaseOrLater()) {
+ if (isLReleaseOrLater() && !VideoCaptureCamera2.isLegacyDevice(appContext, id)) {
return VideoCaptureCamera2.getDeviceSupportedFormats(appContext, id);
}
return ChromiumCameraInfo.isSpecialCamera(id)

Powered by Google App Engine
This is Rietveld 408576698