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/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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // Generate a synchronized beep sound if there is one audio input | 209 // Generate a synchronized beep sound if there is one audio input |
210 // stream created. | 210 // stream created. |
211 FakeAudioInputStream::BeepOnce(); | 211 FakeAudioInputStream::BeepOnce(); |
212 } | 212 } |
213 | 213 |
214 frame_count_++; | 214 frame_count_++; |
215 | 215 |
216 // Give the captured frame to the client. | 216 // Give the captured frame to the client. |
217 client_->OnIncomingCapturedFrame(fake_frame_.get(), | 217 client_->OnIncomingCapturedFrame(fake_frame_.get(), |
218 frame_size, | 218 frame_size, |
219 base::Time::Now(), | 219 base::TimeTicks::Now(), |
220 0, | 220 0, |
221 capture_format_); | 221 capture_format_); |
222 if (!(frame_count_ % kFakeCaptureCapabilityChangePeriod) && | 222 if (!(frame_count_ % kFakeCaptureCapabilityChangePeriod) && |
223 format_roster_.size() > 0U) { | 223 format_roster_.size() > 0U) { |
224 Reallocate(); | 224 Reallocate(); |
225 } | 225 } |
226 // Reschedule next CaptureTask. | 226 // Reschedule next CaptureTask. |
227 capture_thread_.message_loop()->PostDelayedTask( | 227 capture_thread_.message_loop()->PostDelayedTask( |
228 FROM_HERE, | 228 FROM_HERE, |
229 base::Bind(&FakeVideoCaptureDevice::OnCaptureTask, | 229 base::Bind(&FakeVideoCaptureDevice::OnCaptureTask, |
(...skipping 20 matching lines...) Expand all Loading... |
250 media::VideoCaptureFormat(gfx::Size(320, 240), 30, PIXEL_FORMAT_I420)); | 250 media::VideoCaptureFormat(gfx::Size(320, 240), 30, PIXEL_FORMAT_I420)); |
251 format_roster_.push_back( | 251 format_roster_.push_back( |
252 media::VideoCaptureFormat(gfx::Size(640, 480), 30, PIXEL_FORMAT_I420)); | 252 media::VideoCaptureFormat(gfx::Size(640, 480), 30, PIXEL_FORMAT_I420)); |
253 format_roster_.push_back( | 253 format_roster_.push_back( |
254 media::VideoCaptureFormat(gfx::Size(800, 600), 30, PIXEL_FORMAT_I420)); | 254 media::VideoCaptureFormat(gfx::Size(800, 600), 30, PIXEL_FORMAT_I420)); |
255 | 255 |
256 format_roster_index_ = 0; | 256 format_roster_index_ = 0; |
257 } | 257 } |
258 | 258 |
259 } // namespace media | 259 } // namespace media |
OLD | NEW |