| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 photo_capabilities->height->max = 1080; | 191 photo_capabilities->height->max = 1080; |
| 192 photo_capabilities->height->min = 240; | 192 photo_capabilities->height->min = 240; |
| 193 photo_capabilities->width = mojom::Range::New(); | 193 photo_capabilities->width = mojom::Range::New(); |
| 194 photo_capabilities->width->current = capture_format_.frame_size.width(); | 194 photo_capabilities->width->current = capture_format_.frame_size.width(); |
| 195 photo_capabilities->width->max = 1920; | 195 photo_capabilities->width->max = 1920; |
| 196 photo_capabilities->width->min = 320; | 196 photo_capabilities->width->min = 320; |
| 197 photo_capabilities->zoom = mojom::Range::New(); | 197 photo_capabilities->zoom = mojom::Range::New(); |
| 198 photo_capabilities->zoom->current = current_zoom_; | 198 photo_capabilities->zoom->current = current_zoom_; |
| 199 photo_capabilities->zoom->max = kMaxZoom; | 199 photo_capabilities->zoom->max = kMaxZoom; |
| 200 photo_capabilities->zoom->min = kMinZoom; | 200 photo_capabilities->zoom->min = kMinZoom; |
| 201 photo_capabilities->focus_mode = mojom::MeteringMode::UNAVAILABLE; | 201 photo_capabilities->focus_mode = mojom::MeteringMode::NONE; |
| 202 photo_capabilities->exposure_mode = mojom::MeteringMode::UNAVAILABLE; | 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::UNAVAILABLE; | 207 photo_capabilities->white_balance_mode = mojom::MeteringMode::NONE; |
| 208 photo_capabilities->fill_light_mode = mojom::FillLightMode::NONE; |
| 208 callback.Run(std::move(photo_capabilities)); | 209 callback.Run(std::move(photo_capabilities)); |
| 209 } | 210 } |
| 210 | 211 |
| 211 void FakeVideoCaptureDevice::SetPhotoOptions(mojom::PhotoSettingsPtr settings, | 212 void FakeVideoCaptureDevice::SetPhotoOptions(mojom::PhotoSettingsPtr settings, |
| 212 SetPhotoOptionsCallback callback) { | 213 SetPhotoOptionsCallback callback) { |
| 213 if (settings->has_zoom) | 214 if (settings->has_zoom) |
| 214 current_zoom_ = std::max(kMinZoom, std::min(settings->zoom, kMaxZoom)); | 215 current_zoom_ = std::max(kMinZoom, std::min(settings->zoom, kMaxZoom)); |
| 215 callback.Run(true); | 216 callback.Run(true); |
| 216 } | 217 } |
| 217 | 218 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 // Don't accumulate any debt if we are lagging behind - just post the next | 317 // Don't accumulate any debt if we are lagging behind - just post the next |
| 317 // frame immediately and continue as normal. | 318 // frame immediately and continue as normal. |
| 318 const base::TimeTicks next_execution_time = | 319 const base::TimeTicks next_execution_time = |
| 319 std::max(current_time, expected_execution_time + frame_interval); | 320 std::max(current_time, expected_execution_time + frame_interval); |
| 320 const base::TimeDelta delay = next_execution_time - current_time; | 321 const base::TimeDelta delay = next_execution_time - current_time; |
| 321 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 322 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 322 FROM_HERE, base::Bind(next_capture, next_execution_time), delay); | 323 FROM_HERE, base::Bind(next_capture, next_execution_time), delay); |
| 323 } | 324 } |
| 324 | 325 |
| 325 } // namespace media | 326 } // namespace media |
| OLD | NEW |