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

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

Issue 10035054: Merge VideoCaptureDevice::Capability with media::VideoCaptureCapability (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix a namespace issue Created 8 years, 7 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/video/capture/fake_video_capture_device.h" 5 #include "media/video/capture/fake_video_capture_device.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 void FakeVideoCaptureDevice::Allocate(int width, 54 void FakeVideoCaptureDevice::Allocate(int width,
55 int height, 55 int height,
56 int frame_rate, 56 int frame_rate,
57 EventHandler* observer) { 57 EventHandler* observer) {
58 if (state_ != kIdle) { 58 if (state_ != kIdle) {
59 return; // Wrong state. 59 return; // Wrong state.
60 } 60 }
61 61
62 observer_ = observer; 62 observer_ = observer;
63 Capability current_settings; 63 VideoCaptureCapability current_settings;
64 current_settings.color = kI420; 64 current_settings.color = VideoCaptureCapability::kI420;
65 current_settings.expected_capture_delay = 0;
66 current_settings.interlaced = false;
65 if (width > 320) { // VGA 67 if (width > 320) { // VGA
66 current_settings.width = 640; 68 current_settings.width = 640;
67 current_settings.height = 480; 69 current_settings.height = 480;
68 current_settings.frame_rate = 30; 70 current_settings.frame_rate = 30;
69 } else { // QVGA 71 } else { // QVGA
70 current_settings.width = 320; 72 current_settings.width = 320;
71 current_settings.height = 240; 73 current_settings.height = 240;
72 current_settings.frame_rate = 30; 74 current_settings.frame_rate = 30;
73 } 75 }
74 76
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 base::Time::Now()); 126 base::Time::Now());
125 // Reschedule next CaptureTask. 127 // Reschedule next CaptureTask.
126 capture_thread_.message_loop()->PostDelayedTask( 128 capture_thread_.message_loop()->PostDelayedTask(
127 FROM_HERE, 129 FROM_HERE,
128 base::Bind(&FakeVideoCaptureDevice::OnCaptureTask, 130 base::Bind(&FakeVideoCaptureDevice::OnCaptureTask,
129 base::Unretained(this)), 131 base::Unretained(this)),
130 base::TimeDelta::FromMilliseconds(kFakeCaptureTimeoutMs)); 132 base::TimeDelta::FromMilliseconds(kFakeCaptureTimeoutMs));
131 } 133 }
132 134
133 } // namespace media 135 } // namespace media
OLDNEW
« no previous file with comments | « content/renderer/media/video_capture_module_impl.cc ('k') | media/video/capture/linux/video_capture_device_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698