| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/capture/video/android/video_capture_device_android.h" | 5 #include "media/capture/video/android/video_capture_device_android.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 Java_VideoCapture_getPhotoCapabilities(env, j_capture_.obj())); | 168 Java_VideoCapture_getPhotoCapabilities(env, j_capture_.obj())); |
| 169 | 169 |
| 170 // TODO(mcasas): Manual member copying sucks, consider adding typemapping from | 170 // TODO(mcasas): Manual member copying sucks, consider adding typemapping from |
| 171 // PhotoCapabilities to mojom::PhotoCapabilitiesPtr, https://crbug.com/622002. | 171 // PhotoCapabilities to mojom::PhotoCapabilitiesPtr, https://crbug.com/622002. |
| 172 mojom::PhotoCapabilitiesPtr photo_capabilities = | 172 mojom::PhotoCapabilitiesPtr photo_capabilities = |
| 173 mojom::PhotoCapabilities::New(); | 173 mojom::PhotoCapabilities::New(); |
| 174 photo_capabilities->zoom = mojom::Range::New(); | 174 photo_capabilities->zoom = mojom::Range::New(); |
| 175 photo_capabilities->zoom->current = caps.getCurrentZoom(); | 175 photo_capabilities->zoom->current = caps.getCurrentZoom(); |
| 176 photo_capabilities->zoom->max = caps.getMaxZoom(); | 176 photo_capabilities->zoom->max = caps.getMaxZoom(); |
| 177 photo_capabilities->zoom->min = caps.getMinZoom(); | 177 photo_capabilities->zoom->min = caps.getMinZoom(); |
| 178 photo_capabilities->focus_mode = caps.getAutoFocusInUse() |
| 179 ? mojom::FocusMode::AUTO |
| 180 : mojom::FocusMode::MANUAL; |
| 178 callback.Run(std::move(photo_capabilities)); | 181 callback.Run(std::move(photo_capabilities)); |
| 179 } | 182 } |
| 180 | 183 |
| 181 void VideoCaptureDeviceAndroid::SetPhotoOptions( | 184 void VideoCaptureDeviceAndroid::SetPhotoOptions( |
| 182 mojom::PhotoSettingsPtr settings, | 185 mojom::PhotoSettingsPtr settings, |
| 183 SetPhotoOptionsCallback callback) { | 186 SetPhotoOptionsCallback callback) { |
| 184 JNIEnv* env = AttachCurrentThread(); | 187 JNIEnv* env = AttachCurrentThread(); |
| 185 if (settings->has_zoom) | 188 if (settings->has_zoom) |
| 186 Java_VideoCapture_setZoom(env, j_capture_.obj(), settings->zoom); | 189 Java_VideoCapture_setZoom(env, j_capture_.obj(), settings->zoom); |
| 187 callback.Run(true); | 190 callback.Run(true); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 const tracked_objects::Location& from_here, | 290 const tracked_objects::Location& from_here, |
| 288 const std::string& reason) { | 291 const std::string& reason) { |
| 289 { | 292 { |
| 290 base::AutoLock lock(lock_); | 293 base::AutoLock lock(lock_); |
| 291 state_ = kError; | 294 state_ = kError; |
| 292 } | 295 } |
| 293 client_->OnError(from_here, reason); | 296 client_->OnError(from_here, reason); |
| 294 } | 297 } |
| 295 | 298 |
| 296 } // namespace media | 299 } // namespace media |
| OLD | NEW |