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

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

Issue 2787933002: ImageCapture: separate fillLightMode, redEyeReduction and Torch (Closed)
Patch Set: corrected setOptions.html Created 3 years, 9 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/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 {

Powered by Google App Engine
This is Rietveld 408576698