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

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

Issue 1291933002: File video capture device supports MJPEG format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address kcwu@ Created 5 years, 4 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/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 1d7ae1264300dae28b89711e4b52f6ffcc25f3cd..2258f1d53d01b4d4f96db32000690f379cc9912d 100644
--- a/media/capture/video/file_video_capture_device_factory.cc
+++ b/media/capture/video/file_video_capture_device_factory.cc
@@ -63,13 +63,16 @@ void FileVideoCaptureDeviceFactory::GetDeviceSupportedFormats(
const VideoCaptureDevice::Name& device,
VideoCaptureFormats* supported_formats) {
DCHECK(thread_checker_.CalledOnValidThread());
- base::File file =
+ scoped_ptr<base::MemoryMappedFile> mapped_file =
FileVideoCaptureDevice::OpenFileForRead(GetFilePathFromCommandLine());
- if (!file.IsValid())
+ if (!mapped_file->IsValid())
kcwu 2015/08/14 11:50:04 OpenFileForRead() may return nullptr
henryhsu 2015/08/17 02:39:33 Done.
return;
VideoCaptureFormat capture_format;
- FileVideoCaptureDevice::ParseFileAndExtractVideoFormat(&file,
- &capture_format);
+ int frame_size;
+ if (FileVideoCaptureDevice::ParseFileAndExtractVideoFormat(
+ mapped_file.get(), &capture_format, &frame_size) < 0) {
+ return;
+ }
supported_formats->push_back(capture_format);
}

Powered by Google App Engine
This is Rietveld 408576698