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

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: Created 6 years, 2 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/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 c1847e6d40ae806c0b55a5d0e815384ff5ac6f23..90212d5158aa215580f988e8b0fcb4e78e671155 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;

Powered by Google App Engine
This is Rietveld 408576698