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

Unified Diff: media/video/capture/file_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/file_video_capture_device_factory.cc
diff --git a/media/video/capture/file_video_capture_device_factory.cc b/media/video/capture/file_video_capture_device_factory.cc
index 772f4f61c57aee942d2f9baee6d918d661405cc2..ae7845064e958f1d8bf40bc2fa73407e49863a37 100644
--- a/media/video/capture/file_video_capture_device_factory.cc
+++ b/media/video/capture/file_video_capture_device_factory.cc
@@ -25,8 +25,8 @@ base::FilePath GetFilePathFromCommandLine() {
}
scoped_ptr<VideoCaptureDevice> FileVideoCaptureDeviceFactory::Create(
- scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
const VideoCaptureDevice::Name& device_name) {
+ DCHECK(thread_checker_.CalledOnValidThread());
#if defined(OS_WIN)
return scoped_ptr<VideoCaptureDevice>(new FileVideoCaptureDevice(
base::FilePath(base::SysUTF8ToWide(device_name.name()))));
@@ -38,6 +38,7 @@ scoped_ptr<VideoCaptureDevice> FileVideoCaptureDeviceFactory::Create(
void FileVideoCaptureDeviceFactory::GetDeviceNames(
VideoCaptureDevice::Names* const device_names) {
+ DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(device_names->empty());
base::FilePath command_line_file_path = GetFilePathFromCommandLine();
#if defined(OS_WIN)
@@ -54,6 +55,7 @@ void FileVideoCaptureDeviceFactory::GetDeviceNames(
void FileVideoCaptureDeviceFactory::GetDeviceSupportedFormats(
const VideoCaptureDevice::Name& device,
VideoCaptureFormats* supported_formats) {
+ DCHECK(thread_checker_.CalledOnValidThread());
base::File file =
FileVideoCaptureDevice::OpenFileForRead(GetFilePathFromCommandLine());
VideoCaptureFormat capture_format;

Powered by Google App Engine
This is Rietveld 408576698