Chromium Code Reviews| Index: media/capture/video/android/photo_capabilities.cc |
| diff --git a/media/capture/video/android/photo_capabilities.cc b/media/capture/video/android/photo_capabilities.cc |
| index 27c7d92c1b11bba1d1f54f32d318117fd344961f..abe039e20f37801cab99b51d6aaa0e8f74f4e5d4 100644 |
| --- a/media/capture/video/android/photo_capabilities.cc |
| +++ b/media/capture/video/android/photo_capabilities.cc |
| @@ -145,11 +145,29 @@ PhotoCapabilities::AndroidMeteringMode PhotoCapabilities::getWhiteBalanceMode() |
| object_)); |
| } |
| -PhotoCapabilities::AndroidFillLightMode PhotoCapabilities::getFillLightMode() |
| - const { |
| +std::vector<PhotoCapabilities::AndroidFillLightMode> |
| +PhotoCapabilities::getFillLightModes() const { |
| + DCHECK(!object_.is_null()); |
| + |
| + JNIEnv* env = AttachCurrentThread(); |
| + std::vector<AndroidFillLightMode> modes; |
| + static_assert( |
| + std::is_same<int, |
| + std::underlying_type<AndroidFillLightMode>::type>::value, |
| + "AndroidFillLightMode underlying type should be int"); |
| + |
| + base::android::ScopedJavaLocalRef<jintArray> jni_modes = |
| + Java_PhotoCapabilities_getFillLightModes(env, object_); |
| + if (!jni_modes.obj()) |
| + return modes; |
| + base::android::JavaIntArrayToIntVector( |
| + env, jni_modes.obj(), reinterpret_cast<std::vector<int>*>(&modes)); |
|
Reilly Grant (use Gerrit)
2017/03/31 20:13:09
base::android::ScopedJavaLocalRef<jintArray> jni_m
mcasas
2017/03/31 21:14:47
Done.
|
| + return modes; |
| +} |
| + |
| +bool PhotoCapabilities::getTorch() const { |
| DCHECK(!object_.is_null()); |
| - return static_cast<AndroidFillLightMode>( |
| - Java_PhotoCapabilities_getFillLightMode(AttachCurrentThread(), object_)); |
| + return Java_PhotoCapabilities_getTorch(AttachCurrentThread(), object_); |
| } |
| bool PhotoCapabilities::getRedEyeReduction() const { |