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

Side by Side Diff: media/capture/video/fake_video_capture_device.cc

Issue 2375543004: ImageCapture: wire |colorTemperature| set/get for Linux/Cros (Closed)
Patch Set: Created 4 years, 2 months 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) 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698