Index: media/capture/video/android/video_capture_device_android.cc |
diff --git a/media/capture/video/android/video_capture_device_android.cc b/media/capture/video/android/video_capture_device_android.cc |
index 320976116830970cf156ff0ea1769fcd97447789..97fb2a1da1dddf410f685f527c38faaabb4bae05 100644 |
--- a/media/capture/video/android/video_capture_device_android.cc |
+++ b/media/capture/video/android/video_capture_device_android.cc |
@@ -151,7 +151,9 @@ void VideoCaptureDeviceAndroid::TakePhoto(TakePhotoCallback callback) { |
std::unique_ptr<TakePhotoCallback> heap_callback( |
new TakePhotoCallback(std::move(callback))); |
const intptr_t callback_id = reinterpret_cast<intptr_t>(heap_callback.get()); |
- if (!Java_VideoCapture_takePhoto(env, j_capture_.obj(), callback_id)) |
+ if (!Java_VideoCapture_takePhoto(env, j_capture_.obj(), callback_id, |
+ next_photo_resolution_.width(), |
+ next_photo_resolution_.height())) |
return; |
{ |
@@ -171,6 +173,18 @@ void VideoCaptureDeviceAndroid::GetPhotoCapabilities( |
// PhotoCapabilities to mojom::PhotoCapabilitiesPtr, https://crbug.com/622002. |
mojom::PhotoCapabilitiesPtr photo_capabilities = |
mojom::PhotoCapabilities::New(); |
+ photo_capabilities->iso = mojom::Range::New(); |
+ photo_capabilities->iso->current = caps.getCurrentIso(); |
+ photo_capabilities->iso->max = caps.getMaxIso(); |
+ photo_capabilities->iso->min = caps.getMinIso(); |
+ photo_capabilities->height = mojom::Range::New(); |
+ photo_capabilities->height->current = caps.getCurrentHeight(); |
+ photo_capabilities->height->max = caps.getMaxHeight(); |
+ photo_capabilities->height->min = caps.getMinHeight(); |
+ photo_capabilities->width = mojom::Range::New(); |
+ photo_capabilities->width->current = caps.getCurrentWidth(); |
+ photo_capabilities->width->max = caps.getMaxWidth(); |
+ photo_capabilities->width->min = caps.getMinWidth(); |
photo_capabilities->zoom = mojom::Range::New(); |
photo_capabilities->zoom->current = caps.getCurrentZoom(); |
photo_capabilities->zoom->max = caps.getMaxZoom(); |
@@ -185,6 +199,14 @@ void VideoCaptureDeviceAndroid::SetPhotoOptions( |
mojom::PhotoSettingsPtr settings, |
SetPhotoOptionsCallback callback) { |
JNIEnv* env = AttachCurrentThread(); |
+ // |width| and /or|height| are kept for the next TakePhoto()s. |
Reilly Grant (use Gerrit)
2016/07/20 15:03:09
and/or |height|
mcasas
2016/07/20 23:35:24
Done.
|
+ if (settings->has_width || settings->has_height) |
+ next_photo_resolution_.SetSize(0, 0); |
+ if (settings->has_width) |
+ next_photo_resolution_.set_width(settings->width); |
+ if (settings->has_height) |
+ next_photo_resolution_.set_height(settings->height); |
+ |
if (settings->has_zoom) |
Java_VideoCapture_setZoom(env, j_capture_.obj(), settings->zoom); |
callback.Run(true); |