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

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

Issue 2787933002: ImageCapture: separate fillLightMode, redEyeReduction and Torch (Closed)
Patch Set: 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..0b9ef778d2ae844265646f2c543f2dd664807472 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()) {
+ base::android::JavaIntArrayToIntVector(
+ env, jni_modes.obj(), reinterpret_cast<std::vector<int>*>(&modes));
+ }
+ 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 {
« no previous file with comments | « media/capture/video/android/photo_capabilities.h ('k') | media/capture/video/android/video_capture_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698