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

Unified Diff: media/video/capture/android/video_capture_device_factory_android.cc

Issue 611283002: Android Video Capture: Added static methods for device & capabilities enumeration using Camera2 API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 6 years, 1 month 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 | « media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/android/video_capture_device_factory_android.cc
diff --git a/media/video/capture/android/video_capture_device_factory_android.cc b/media/video/capture/android/video_capture_device_factory_android.cc
index 010c1949eb65338e83dd56249138f869aba5987f..befa57686c345a61df9eb7179aab82f3f5166678 100644
--- a/media/video/capture/android/video_capture_device_factory_android.cc
+++ b/media/video/capture/android/video_capture_device_factory_android.cc
@@ -58,15 +58,16 @@ void VideoCaptureDeviceFactoryAndroid::GetDeviceNames(
JNIEnv* env = AttachCurrentThread();
- int num_cameras = Java_VideoCaptureFactory_getNumberOfCameras(
- env, base::android::GetApplicationContext());
+ const jobject context = base::android::GetApplicationContext();
+ const int num_cameras = Java_VideoCaptureFactory_getNumberOfCameras(env,
+ context);
DVLOG(1) << "VideoCaptureDevice::GetDeviceNames: num_cameras=" << num_cameras;
if (num_cameras <= 0)
return;
for (int camera_id = num_cameras - 1; camera_id >= 0; --camera_id) {
base::android::ScopedJavaLocalRef<jstring> device_name =
- Java_VideoCaptureFactory_getDeviceName(env, camera_id);
+ Java_VideoCaptureFactory_getDeviceName(env, camera_id, context);
if (device_name.obj() == NULL)
continue;
@@ -89,7 +90,8 @@ void VideoCaptureDeviceFactoryAndroid::GetDeviceSupportedFormats(
return;
JNIEnv* env = AttachCurrentThread();
base::android::ScopedJavaLocalRef<jobjectArray> collected_formats =
- Java_VideoCaptureFactory_getDeviceSupportedFormats(env, id);
+ Java_VideoCaptureFactory_getDeviceSupportedFormats(env,
+ base::android::GetApplicationContext(), id);
if (collected_formats.is_null())
return;
« no previous file with comments | « media/base/android/java/src/org/chromium/media/VideoCaptureFactory.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698