| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 photo_capabilities->zoom->min = kMinZoom; | 200 photo_capabilities->zoom->min = kMinZoom; |
| 201 photo_capabilities->focus_mode = mojom::MeteringMode::NONE; | 201 photo_capabilities->focus_mode = mojom::MeteringMode::NONE; |
| 202 photo_capabilities->exposure_mode = mojom::MeteringMode::NONE; | 202 photo_capabilities->exposure_mode = mojom::MeteringMode::NONE; |
| 203 photo_capabilities->exposure_compensation = mojom::Range::New(); | 203 photo_capabilities->exposure_compensation = mojom::Range::New(); |
| 204 photo_capabilities->exposure_compensation->current = 0; | 204 photo_capabilities->exposure_compensation->current = 0; |
| 205 photo_capabilities->exposure_compensation->max = 0; | 205 photo_capabilities->exposure_compensation->max = 0; |
| 206 photo_capabilities->exposure_compensation->min = 0; | 206 photo_capabilities->exposure_compensation->min = 0; |
| 207 photo_capabilities->white_balance_mode = mojom::MeteringMode::NONE; | 207 photo_capabilities->white_balance_mode = mojom::MeteringMode::NONE; |
| 208 photo_capabilities->fill_light_mode = mojom::FillLightMode::NONE; | 208 photo_capabilities->fill_light_mode = mojom::FillLightMode::NONE; |
| 209 photo_capabilities->red_eye_reduction = false; | 209 photo_capabilities->red_eye_reduction = false; |
| 210 photo_capabilities->color_temperature = mojom::Range::New(); |
| 211 photo_capabilities->color_temperature->current = 0; |
| 212 photo_capabilities->color_temperature->max = 0; |
| 213 photo_capabilities->color_temperature->min = 0; |
| 210 callback.Run(std::move(photo_capabilities)); | 214 callback.Run(std::move(photo_capabilities)); |
| 211 } | 215 } |
| 212 | 216 |
| 213 void FakeVideoCaptureDevice::SetPhotoOptions(mojom::PhotoSettingsPtr settings, | 217 void FakeVideoCaptureDevice::SetPhotoOptions(mojom::PhotoSettingsPtr settings, |
| 214 SetPhotoOptionsCallback callback) { | 218 SetPhotoOptionsCallback callback) { |
| 215 if (settings->has_zoom) | 219 if (settings->has_zoom) |
| 216 current_zoom_ = std::max(kMinZoom, std::min(settings->zoom, kMaxZoom)); | 220 current_zoom_ = std::max(kMinZoom, std::min(settings->zoom, kMaxZoom)); |
| 217 callback.Run(true); | 221 callback.Run(true); |
| 218 } | 222 } |
| 219 | 223 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 // Don't accumulate any debt if we are lagging behind - just post the next | 322 // Don't accumulate any debt if we are lagging behind - just post the next |
| 319 // frame immediately and continue as normal. | 323 // frame immediately and continue as normal. |
| 320 const base::TimeTicks next_execution_time = | 324 const base::TimeTicks next_execution_time = |
| 321 std::max(current_time, expected_execution_time + frame_interval); | 325 std::max(current_time, expected_execution_time + frame_interval); |
| 322 const base::TimeDelta delay = next_execution_time - current_time; | 326 const base::TimeDelta delay = next_execution_time - current_time; |
| 323 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 327 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 324 FROM_HERE, base::Bind(next_capture, next_execution_time), delay); | 328 FROM_HERE, base::Bind(next_capture, next_execution_time), delay); |
| 325 } | 329 } |
| 326 | 330 |
| 327 } // namespace media | 331 } // namespace media |
| OLD | NEW |