Chromium Code Reviews| 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 561 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 562 #if DCHECK_IS_ON() | 562 #if DCHECK_IS_ON() |
| 563 { | 563 { |
| 564 base::AutoLock lock(lock_); | 564 base::AutoLock lock(lock_); |
| 565 DCHECK_EQ(kConfigured, state_); | 565 DCHECK_EQ(kConfigured, state_); |
| 566 DCHECK(got_first_frame_); | 566 DCHECK(got_first_frame_); |
| 567 } | 567 } |
| 568 #endif | 568 #endif |
| 569 JNIEnv* env = AttachCurrentThread(); | 569 JNIEnv* env = AttachCurrentThread(); |
| 570 | 570 |
| 571 const int width = settings->has_width ? settings->width : 0; | 571 const double width = settings->has_width ? settings->width : 0; |
| 572 const int height = settings->has_height ? settings->height : 0; | 572 const double height = settings->has_height ? settings->height : 0; |
| 573 const int zoom = settings->has_zoom ? settings->zoom : 0; | 573 const double zoom = settings->has_zoom ? settings->zoom : 0; |
| 574 | 574 |
| 575 const PhotoCapabilities::AndroidMeteringMode focus_mode = | 575 const PhotoCapabilities::AndroidMeteringMode focus_mode = |
| 576 settings->has_focus_mode | 576 settings->has_focus_mode |
| 577 ? ToAndroidMeteringMode(settings->focus_mode) | 577 ? ToAndroidMeteringMode(settings->focus_mode) |
| 578 : PhotoCapabilities::AndroidMeteringMode::NOT_SET; | 578 : PhotoCapabilities::AndroidMeteringMode::NOT_SET; |
| 579 | 579 |
| 580 const PhotoCapabilities::AndroidMeteringMode exposure_mode = | 580 const PhotoCapabilities::AndroidMeteringMode exposure_mode = |
| 581 settings->has_exposure_mode | 581 settings->has_exposure_mode |
| 582 ? ToAndroidMeteringMode(settings->exposure_mode) | 582 ? ToAndroidMeteringMode(settings->exposure_mode) |
| 583 : PhotoCapabilities::AndroidMeteringMode::NOT_SET; | 583 : PhotoCapabilities::AndroidMeteringMode::NOT_SET; |
| 584 | 584 |
| 585 std::vector<float> points_of_interest_marshalled; | 585 std::vector<float> points_of_interest_marshalled; |
| 586 for (const auto& point : settings->points_of_interest) { | 586 for (const auto& point : settings->points_of_interest) { |
| 587 points_of_interest_marshalled.push_back(point->x); | 587 points_of_interest_marshalled.push_back(point->x); |
| 588 points_of_interest_marshalled.push_back(point->y); | 588 points_of_interest_marshalled.push_back(point->y); |
| 589 } | 589 } |
| 590 ScopedJavaLocalRef<jfloatArray> points_of_interest = | 590 ScopedJavaLocalRef<jfloatArray> points_of_interest = |
| 591 base::android::ToJavaFloatArray(env, points_of_interest_marshalled); | 591 base::android::ToJavaFloatArray(env, points_of_interest_marshalled); |
| 592 | 592 |
| 593 const int exposure_compensation = | 593 const double exposure_compensation = |
| 594 settings->has_exposure_compensation ? settings->exposure_compensation : 0; | 594 settings->has_exposure_compensation ? settings->exposure_compensation : 0; |
| 595 | 595 |
| 596 const PhotoCapabilities::AndroidMeteringMode white_balance_mode = | 596 const PhotoCapabilities::AndroidMeteringMode white_balance_mode = |
| 597 settings->has_white_balance_mode | 597 settings->has_white_balance_mode |
| 598 ? ToAndroidMeteringMode(settings->white_balance_mode) | 598 ? ToAndroidMeteringMode(settings->white_balance_mode) |
| 599 : PhotoCapabilities::AndroidMeteringMode::NOT_SET; | 599 : PhotoCapabilities::AndroidMeteringMode::NOT_SET; |
| 600 | 600 |
| 601 const int iso = settings->has_iso ? settings->iso : 0; | 601 const double iso = settings->has_iso ? settings->iso : 0; |
|
Reilly Grant (use Gerrit)
2016/11/09 21:16:55
While you're changing this around can you make som
mcasas
2016/11/09 22:44:14
Done. I also moved |width| and |height| assignment
| |
| 602 | 602 |
| 603 const PhotoCapabilities::AndroidFillLightMode fill_light_mode = | 603 const PhotoCapabilities::AndroidFillLightMode fill_light_mode = |
| 604 settings->has_fill_light_mode | 604 settings->has_fill_light_mode |
| 605 ? ToAndroidFillLightMode(settings->fill_light_mode) | 605 ? ToAndroidFillLightMode(settings->fill_light_mode) |
| 606 : PhotoCapabilities::AndroidFillLightMode::NOT_SET; | 606 : PhotoCapabilities::AndroidFillLightMode::NOT_SET; |
| 607 | 607 |
| 608 Java_VideoCapture_setPhotoOptions( | 608 Java_VideoCapture_setPhotoOptions( |
| 609 env, j_capture_, zoom, static_cast<int>(focus_mode), | 609 env, j_capture_, zoom, static_cast<int>(focus_mode), |
| 610 static_cast<int>(exposure_mode), width, height, points_of_interest, | 610 static_cast<int>(exposure_mode), width, height, points_of_interest, |
| 611 settings->has_exposure_compensation, exposure_compensation, | 611 settings->has_exposure_compensation, exposure_compensation, |
| 612 static_cast<int>(white_balance_mode), iso, | 612 static_cast<int>(white_balance_mode), iso, |
| 613 settings->has_red_eye_reduction, settings->red_eye_reduction, | 613 settings->has_red_eye_reduction, settings->red_eye_reduction, |
| 614 static_cast<int>(fill_light_mode), | 614 static_cast<int>(fill_light_mode), |
| 615 settings->has_color_temperature ? settings->color_temperature : 0); | 615 settings->has_color_temperature ? settings->color_temperature : 0); |
| 616 | 616 |
| 617 callback.Run(true); | 617 callback.Run(true); |
| 618 } | 618 } |
| 619 | 619 |
| 620 } // namespace media | 620 } // namespace media |
| OLD | NEW |