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

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

Issue 2358093002: File Video Capture: allow IO operations from Device thread (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/file_video_capture_device_factory.cc
diff --git a/media/capture/video/file_video_capture_device_factory.cc b/media/capture/video/file_video_capture_device_factory.cc
index 0ead703662115d63c6419c94c8af87b99629807e..0a1570f3de4581af3cc1234f5ead86acee46d235 100644
--- a/media/capture/video/file_video_capture_device_factory.cc
+++ b/media/capture/video/file_video_capture_device_factory.cc
@@ -28,6 +28,7 @@ base::FilePath GetFilePathFromCommandLine() {
std::unique_ptr<VideoCaptureDevice> FileVideoCaptureDeviceFactory::CreateDevice(
const VideoCaptureDeviceDescriptor& device_descriptor) {
DCHECK(thread_checker_.CalledOnValidThread());
+ base::ThreadRestrictions::AssertIOAllowed();
#if defined(OS_WIN)
return std::unique_ptr<VideoCaptureDevice>(new FileVideoCaptureDevice(
base::FilePath(base::SysUTF8ToWide(device_descriptor.display_name))));
@@ -41,6 +42,8 @@ void FileVideoCaptureDeviceFactory::GetDeviceDescriptors(
VideoCaptureDeviceDescriptors* device_descriptors) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(device_descriptors->empty());
+ base::ThreadRestrictions::SetIOAllowed(true);
chfremer 2016/09/22 16:39:53 I believe this will work, but it feels a little ha
mcasas 2016/09/22 16:47:03 It is hacky, but the Video Capture thread is not o
+
const base::FilePath command_line_file_path = GetFilePathFromCommandLine();
device_descriptors->emplace_back(
#if defined(OS_WIN)
@@ -63,6 +66,7 @@ void FileVideoCaptureDeviceFactory::GetSupportedFormats(
const VideoCaptureDeviceDescriptor& device_descriptor,
VideoCaptureFormats* supported_formats) {
DCHECK(thread_checker_.CalledOnValidThread());
+ base::ThreadRestrictions::AssertIOAllowed();
VideoCaptureFormat capture_format;
if (!FileVideoCaptureDevice::GetVideoCaptureFormat(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698