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

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

Issue 2164473002: ImageCapture: wire PhotoCapabilities' ISO, width, height and PhotoSettings' width and height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng@ comments Created 4 years, 5 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 void FakeVideoCaptureDevice::StopAndDeAllocate() { 175 void FakeVideoCaptureDevice::StopAndDeAllocate() {
176 DCHECK(thread_checker_.CalledOnValidThread()); 176 DCHECK(thread_checker_.CalledOnValidThread());
177 client_.reset(); 177 client_.reset();
178 } 178 }
179 179
180 void FakeVideoCaptureDevice::GetPhotoCapabilities( 180 void FakeVideoCaptureDevice::GetPhotoCapabilities(
181 GetPhotoCapabilitiesCallback callback) { 181 GetPhotoCapabilitiesCallback callback) {
182 mojom::PhotoCapabilitiesPtr photo_capabilities = 182 mojom::PhotoCapabilitiesPtr photo_capabilities =
183 mojom::PhotoCapabilities::New(); 183 mojom::PhotoCapabilities::New();
184 photo_capabilities->iso = mojom::Range::New();
185 photo_capabilities->iso->current = 100;
186 photo_capabilities->iso->max = 100;
187 photo_capabilities->iso->min = 100;
188 photo_capabilities->height = mojom::Range::New();
189 photo_capabilities->height->current = capture_format_.frame_size.height();
190 photo_capabilities->height->max = 1080;
191 photo_capabilities->height->min = 240;
192 photo_capabilities->width = mojom::Range::New();
193 photo_capabilities->width->current = capture_format_.frame_size.width();
194 photo_capabilities->width->max = 1920;
195 photo_capabilities->width->min = 320;
196 photo_capabilities->focus_mode = mojom::FocusMode::UNAVAILABLE;
184 photo_capabilities->zoom = mojom::Range::New(); 197 photo_capabilities->zoom = mojom::Range::New();
185 photo_capabilities->zoom->current = current_zoom_; 198 photo_capabilities->zoom->current = current_zoom_;
186 photo_capabilities->zoom->max = kMaxZoom; 199 photo_capabilities->zoom->max = kMaxZoom;
187 photo_capabilities->zoom->min = kMinZoom; 200 photo_capabilities->zoom->min = kMinZoom;
188 photo_capabilities->focus_mode = mojom::FocusMode::UNAVAILABLE; 201 photo_capabilities->focus_mode = mojom::FocusMode::UNAVAILABLE;
189 callback.Run(std::move(photo_capabilities)); 202 callback.Run(std::move(photo_capabilities));
190 } 203 }
191 204
192 void FakeVideoCaptureDevice::SetPhotoOptions(mojom::PhotoSettingsPtr settings, 205 void FakeVideoCaptureDevice::SetPhotoOptions(mojom::PhotoSettingsPtr settings,
193 SetPhotoOptionsCallback callback) { 206 SetPhotoOptionsCallback callback) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // Don't accumulate any debt if we are lagging behind - just post the next 310 // Don't accumulate any debt if we are lagging behind - just post the next
298 // frame immediately and continue as normal. 311 // frame immediately and continue as normal.
299 const base::TimeTicks next_execution_time = 312 const base::TimeTicks next_execution_time =
300 std::max(current_time, expected_execution_time + frame_interval); 313 std::max(current_time, expected_execution_time + frame_interval);
301 const base::TimeDelta delay = next_execution_time - current_time; 314 const base::TimeDelta delay = next_execution_time - current_time;
302 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 315 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
303 FROM_HERE, base::Bind(next_capture, next_execution_time), delay); 316 FROM_HERE, base::Bind(next_capture, next_execution_time), delay);
304 } 317 }
305 318
306 } // namespace media 319 } // namespace media
OLDNEW
« no previous file with comments | « media/capture/video/android/video_capture_device_android.cc ('k') | media/capture/video/fake_video_capture_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698