| 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" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "media/audio/fake_audio_input_stream.h" | 12 #include "media/audio/fake_audio_input_stream.h" |
| 13 #include "media/base/video_frame.h" | 13 #include "media/base/video_frame.h" |
| 14 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
| 15 #include "third_party/skia/include/core/SkCanvas.h" | 15 #include "third_party/skia/include/core/SkCanvas.h" |
| 16 #include "third_party/skia/include/core/SkPaint.h" | 16 #include "third_party/skia/include/core/SkPaint.h" |
| 17 | 17 |
| 18 namespace media { | 18 namespace media { |
| 19 | 19 |
| 20 static const int kFakeCaptureTimeoutMs = 50; | 20 static const int kFakeCaptureTimeoutMs = 50; |
| 21 static const int kFakeCaptureBeepCycle = 10; // Visual beep every 0.5s. | 21 static const int kFakeCaptureBeepCycle = 20; // Visual beep every 1s. |
| 22 static const int kFakeCaptureCapabilityChangePeriod = 30; | 22 static const int kFakeCaptureCapabilityChangePeriod = 30; |
| 23 enum { kNumberOfFakeDevices = 2 }; | 23 enum { kNumberOfFakeDevices = 2 }; |
| 24 | 24 |
| 25 bool FakeVideoCaptureDevice::fail_next_create_ = false; | 25 bool FakeVideoCaptureDevice::fail_next_create_ = false; |
| 26 base::subtle::Atomic32 FakeVideoCaptureDevice::number_of_devices_ = | 26 base::subtle::Atomic32 FakeVideoCaptureDevice::number_of_devices_ = |
| 27 kNumberOfFakeDevices; | 27 kNumberOfFakeDevices; |
| 28 | 28 |
| 29 // static | 29 // static |
| 30 size_t FakeVideoCaptureDevice::NumberOfFakeDevices(void) { | 30 size_t FakeVideoCaptureDevice::NumberOfFakeDevices(void) { |
| 31 return number_of_devices_; | 31 return number_of_devices_; |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 fake_frame_.reset(new uint8[fake_frame_size]); | 250 fake_frame_.reset(new uint8[fake_frame_size]); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void FakeVideoCaptureDevice::PopulateFormatRoster() { | 253 void FakeVideoCaptureDevice::PopulateFormatRoster() { |
| 254 DCHECK_EQ(capture_thread_.message_loop(), base::MessageLoop::current()); | 254 DCHECK_EQ(capture_thread_.message_loop(), base::MessageLoop::current()); |
| 255 GetDeviceSupportedFormats(Name(), &format_roster_); | 255 GetDeviceSupportedFormats(Name(), &format_roster_); |
| 256 format_roster_index_ = 0; | 256 format_roster_index_ = 0; |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace media | 259 } // namespace media |
| OLD | NEW |