OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/fake_video_capture_device.h" | 5 #include "media/capture/video/fake_video_capture_device.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 void FakeVideoCaptureDevice::GetPhotoCapabilities( | 441 void FakeVideoCaptureDevice::GetPhotoCapabilities( |
442 GetPhotoCapabilitiesCallback callback) { | 442 GetPhotoCapabilitiesCallback callback) { |
443 DCHECK(thread_checker_.CalledOnValidThread()); | 443 DCHECK(thread_checker_.CalledOnValidThread()); |
444 photo_device_->GetPhotoCapabilities(std::move(callback)); | 444 photo_device_->GetPhotoCapabilities(std::move(callback)); |
445 } | 445 } |
446 | 446 |
447 void FakePhotoDevice::GetPhotoCapabilities( | 447 void FakePhotoDevice::GetPhotoCapabilities( |
448 VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) { | 448 VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) { |
449 mojom::PhotoCapabilitiesPtr photo_capabilities = | 449 mojom::PhotoCapabilitiesPtr photo_capabilities = |
450 mojom::PhotoCapabilities::New(); | 450 mojom::PhotoCapabilities::New(); |
| 451 |
| 452 photo_capabilities->white_balance_mode = mojom::MeteringMode::NONE; |
| 453 photo_capabilities->exposure_mode = mojom::MeteringMode::NONE; |
| 454 photo_capabilities->focus_mode = mojom::MeteringMode::NONE; |
| 455 |
| 456 photo_capabilities->exposure_compensation = mojom::Range::New(); |
| 457 photo_capabilities->color_temperature = mojom::Range::New(); |
451 photo_capabilities->iso = mojom::Range::New(); | 458 photo_capabilities->iso = mojom::Range::New(); |
452 photo_capabilities->iso->current = 100.0; | 459 photo_capabilities->iso->current = 100.0; |
453 photo_capabilities->iso->max = 100.0; | 460 photo_capabilities->iso->max = 100.0; |
454 photo_capabilities->iso->min = 100.0; | 461 photo_capabilities->iso->min = 100.0; |
455 photo_capabilities->iso->step = 0.0; | 462 photo_capabilities->iso->step = 0.0; |
| 463 |
| 464 photo_capabilities->brightness = media::mojom::Range::New(); |
| 465 photo_capabilities->contrast = media::mojom::Range::New(); |
| 466 photo_capabilities->saturation = media::mojom::Range::New(); |
| 467 photo_capabilities->sharpness = media::mojom::Range::New(); |
| 468 |
| 469 photo_capabilities->zoom = mojom::Range::New(); |
| 470 photo_capabilities->zoom->current = fake_device_state_->zoom; |
| 471 photo_capabilities->zoom->max = kMaxZoom; |
| 472 photo_capabilities->zoom->min = kMinZoom; |
| 473 photo_capabilities->zoom->step = kZoomStep; |
| 474 |
| 475 photo_capabilities->torch = false; |
| 476 |
| 477 photo_capabilities->red_eye_reduction = mojom::RedEyeReduction::NEVER; |
456 photo_capabilities->height = mojom::Range::New(); | 478 photo_capabilities->height = mojom::Range::New(); |
457 photo_capabilities->height->current = | 479 photo_capabilities->height->current = |
458 fake_device_state_->format.frame_size.height(); | 480 fake_device_state_->format.frame_size.height(); |
459 photo_capabilities->height->max = 1080.0; | 481 photo_capabilities->height->max = 1080.0; |
460 photo_capabilities->height->min = 96.0; | 482 photo_capabilities->height->min = 96.0; |
461 photo_capabilities->height->step = 1.0; | 483 photo_capabilities->height->step = 1.0; |
462 photo_capabilities->width = mojom::Range::New(); | 484 photo_capabilities->width = mojom::Range::New(); |
463 photo_capabilities->width->current = | 485 photo_capabilities->width->current = |
464 fake_device_state_->format.frame_size.width(); | 486 fake_device_state_->format.frame_size.width(); |
465 photo_capabilities->width->max = 1920.0; | 487 photo_capabilities->width->max = 1920.0; |
466 photo_capabilities->width->min = 96.0; | 488 photo_capabilities->width->min = 96.0; |
467 photo_capabilities->width->step = 1.0; | 489 photo_capabilities->width->step = 1.0; |
468 photo_capabilities->zoom = mojom::Range::New(); | 490 |
469 photo_capabilities->zoom->current = fake_device_state_->zoom; | |
470 photo_capabilities->zoom->max = kMaxZoom; | |
471 photo_capabilities->zoom->min = kMinZoom; | |
472 photo_capabilities->zoom->step = kZoomStep; | |
473 photo_capabilities->focus_mode = mojom::MeteringMode::NONE; | |
474 photo_capabilities->exposure_mode = mojom::MeteringMode::NONE; | |
475 photo_capabilities->exposure_compensation = mojom::Range::New(); | |
476 photo_capabilities->white_balance_mode = mojom::MeteringMode::NONE; | |
477 photo_capabilities->fill_light_mode = mojom::FillLightMode::NONE; | |
478 photo_capabilities->red_eye_reduction = false; | |
479 photo_capabilities->color_temperature = mojom::Range::New(); | |
480 photo_capabilities->brightness = media::mojom::Range::New(); | |
481 photo_capabilities->contrast = media::mojom::Range::New(); | |
482 photo_capabilities->saturation = media::mojom::Range::New(); | |
483 photo_capabilities->sharpness = media::mojom::Range::New(); | |
484 callback.Run(std::move(photo_capabilities)); | 491 callback.Run(std::move(photo_capabilities)); |
485 } | 492 } |
486 | 493 |
487 void FakeVideoCaptureDevice::SetPhotoOptions(mojom::PhotoSettingsPtr settings, | 494 void FakeVideoCaptureDevice::SetPhotoOptions(mojom::PhotoSettingsPtr settings, |
488 SetPhotoOptionsCallback callback) { | 495 SetPhotoOptionsCallback callback) { |
489 DCHECK(thread_checker_.CalledOnValidThread()); | 496 DCHECK(thread_checker_.CalledOnValidThread()); |
490 if (settings->has_zoom) { | 497 if (settings->has_zoom) { |
491 device_state_->zoom = | 498 device_state_->zoom = |
492 std::max(kMinZoom, std::min(settings->zoom, kMaxZoom)); | 499 std::max(kMinZoom, std::min(settings->zoom, kMaxZoom)); |
493 } | 500 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 int session_id) { | 649 int session_id) { |
643 DCHECK(thread_checker_.CalledOnValidThread()); | 650 DCHECK(thread_checker_.CalledOnValidThread()); |
644 if (session_id != current_session_id_) | 651 if (session_id != current_session_id_) |
645 return; | 652 return; |
646 | 653 |
647 frame_deliverer_->PaintAndDeliverNextFrame(elapsed_time_); | 654 frame_deliverer_->PaintAndDeliverNextFrame(elapsed_time_); |
648 BeepAndScheduleNextCapture(expected_execution_time); | 655 BeepAndScheduleNextCapture(expected_execution_time); |
649 } | 656 } |
650 | 657 |
651 } // namespace media | 658 } // namespace media |
OLD | NEW |