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

Side by Side Diff: media/capture/video/android/video_capture_device_android.cc

Issue 2482983002: MediaSettingsRange: s/long/double/ in MediaSettingsRange.idl and PhotoCapabilities.idl (Closed)
Patch Set: s/float/double/ in fake_video_capture_device.* Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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 zoom = settings->has_zoom ? settings->zoom : 0.0;
572 const int height = settings->has_height ? settings->height : 0;
573 const int zoom = settings->has_zoom ? settings->zoom : 0;
574 572
575 const PhotoCapabilities::AndroidMeteringMode focus_mode = 573 const PhotoCapabilities::AndroidMeteringMode focus_mode =
576 settings->has_focus_mode 574 settings->has_focus_mode
577 ? ToAndroidMeteringMode(settings->focus_mode) 575 ? ToAndroidMeteringMode(settings->focus_mode)
578 : PhotoCapabilities::AndroidMeteringMode::NOT_SET; 576 : PhotoCapabilities::AndroidMeteringMode::NOT_SET;
579 577
580 const PhotoCapabilities::AndroidMeteringMode exposure_mode = 578 const PhotoCapabilities::AndroidMeteringMode exposure_mode =
581 settings->has_exposure_mode 579 settings->has_exposure_mode
582 ? ToAndroidMeteringMode(settings->exposure_mode) 580 ? ToAndroidMeteringMode(settings->exposure_mode)
583 : PhotoCapabilities::AndroidMeteringMode::NOT_SET; 581 : PhotoCapabilities::AndroidMeteringMode::NOT_SET;
584 582
583 const double width = settings->has_width ? settings->width : 0.0;
584 const double height = settings->has_height ? settings->height : 0.0;
585
585 std::vector<float> points_of_interest_marshalled; 586 std::vector<float> points_of_interest_marshalled;
586 for (const auto& point : settings->points_of_interest) { 587 for (const auto& point : settings->points_of_interest) {
587 points_of_interest_marshalled.push_back(point->x); 588 points_of_interest_marshalled.push_back(point->x);
588 points_of_interest_marshalled.push_back(point->y); 589 points_of_interest_marshalled.push_back(point->y);
589 } 590 }
590 ScopedJavaLocalRef<jfloatArray> points_of_interest = 591 ScopedJavaLocalRef<jfloatArray> points_of_interest =
591 base::android::ToJavaFloatArray(env, points_of_interest_marshalled); 592 base::android::ToJavaFloatArray(env, points_of_interest_marshalled);
592 593
593 const int exposure_compensation = 594 const double exposure_compensation = settings->has_exposure_compensation
594 settings->has_exposure_compensation ? settings->exposure_compensation : 0; 595 ? settings->exposure_compensation
596 : 0.0;
595 597
596 const PhotoCapabilities::AndroidMeteringMode white_balance_mode = 598 const PhotoCapabilities::AndroidMeteringMode white_balance_mode =
597 settings->has_white_balance_mode 599 settings->has_white_balance_mode
598 ? ToAndroidMeteringMode(settings->white_balance_mode) 600 ? ToAndroidMeteringMode(settings->white_balance_mode)
599 : PhotoCapabilities::AndroidMeteringMode::NOT_SET; 601 : PhotoCapabilities::AndroidMeteringMode::NOT_SET;
600 602
601 const int iso = settings->has_iso ? settings->iso : 0; 603 const double iso = settings->has_iso ? settings->iso : 0.0;
602 604
603 const PhotoCapabilities::AndroidFillLightMode fill_light_mode = 605 const PhotoCapabilities::AndroidFillLightMode fill_light_mode =
604 settings->has_fill_light_mode 606 settings->has_fill_light_mode
605 ? ToAndroidFillLightMode(settings->fill_light_mode) 607 ? ToAndroidFillLightMode(settings->fill_light_mode)
606 : PhotoCapabilities::AndroidFillLightMode::NOT_SET; 608 : PhotoCapabilities::AndroidFillLightMode::NOT_SET;
607 609
610 const double color_temperature =
611 settings->has_color_temperature ? settings->color_temperature : 0.0;
612
608 Java_VideoCapture_setPhotoOptions( 613 Java_VideoCapture_setPhotoOptions(
609 env, j_capture_, zoom, static_cast<int>(focus_mode), 614 env, j_capture_, zoom, static_cast<int>(focus_mode),
610 static_cast<int>(exposure_mode), width, height, points_of_interest, 615 static_cast<int>(exposure_mode), width, height, points_of_interest,
611 settings->has_exposure_compensation, exposure_compensation, 616 settings->has_exposure_compensation, exposure_compensation,
612 static_cast<int>(white_balance_mode), iso, 617 static_cast<int>(white_balance_mode), iso,
613 settings->has_red_eye_reduction, settings->red_eye_reduction, 618 settings->has_red_eye_reduction, settings->red_eye_reduction,
614 static_cast<int>(fill_light_mode), 619 static_cast<int>(fill_light_mode), color_temperature);
615 settings->has_color_temperature ? settings->color_temperature : 0);
616 620
617 callback.Run(true); 621 callback.Run(true);
618 } 622 }
619 623
620 } // namespace media 624 } // namespace media
OLDNEW
« no previous file with comments | « media/capture/video/android/photo_capabilities.cc ('k') | media/capture/video/fake_video_capture_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698