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

Unified Diff: media/video/capture/fake_video_capture_device_factory.cc

Issue 294893006: VideoCaptureDeviceFactory: Change device enumeration to callback + QTKit enumerates in UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: QTKit/AVFoundation Factory create of inexistent device and associated unit tests Created 6 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 side-by-side diff with in-line comments
Download patch
Index: media/video/capture/fake_video_capture_device_factory.cc
diff --git a/media/video/capture/fake_video_capture_device_factory.cc b/media/video/capture/fake_video_capture_device_factory.cc
index fc11d479721d5f3a5a096272c1767b168503e964..5183dc0e9fa103c608d350cdc92554cb93b0fde6 100644
--- a/media/video/capture/fake_video_capture_device_factory.cc
+++ b/media/video/capture/fake_video_capture_device_factory.cc
@@ -14,8 +14,8 @@ FakeVideoCaptureDeviceFactory::FakeVideoCaptureDeviceFactory()
}
scoped_ptr<VideoCaptureDevice> FakeVideoCaptureDeviceFactory::Create(
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
const VideoCaptureDevice::Name& device_name) {
+ DCHECK(thread_checker_.CalledOnValidThread());
for (int n = 0; n < number_of_devices_; ++n) {
std::string possible_id = base::StringPrintf("/dev/video%d", n);
if (device_name.id().compare(possible_id) == 0)
@@ -26,6 +26,7 @@ scoped_ptr<VideoCaptureDevice> FakeVideoCaptureDeviceFactory::Create(
void FakeVideoCaptureDeviceFactory::GetDeviceNames(
VideoCaptureDevice::Names* const device_names) {
+ DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(device_names->empty());
for (int n = 0; n < number_of_devices_; ++n) {
VideoCaptureDevice::Name name(base::StringPrintf("fake_device_%d", n),
@@ -37,6 +38,7 @@ void FakeVideoCaptureDeviceFactory::GetDeviceNames(
void FakeVideoCaptureDeviceFactory::GetDeviceSupportedFormats(
const VideoCaptureDevice::Name& device,
VideoCaptureFormats* supported_formats) {
+ DCHECK(thread_checker_.CalledOnValidThread());
const int frame_rate = 1000 / FakeVideoCaptureDevice::kFakeCaptureTimeoutMs;
const gfx::Size supported_sizes[] = {gfx::Size(320, 240),
gfx::Size(640, 480),

Powered by Google App Engine
This is Rietveld 408576698