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