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

Side by Side Diff: media/video/capture/file_video_capture_device_factory.cc

Issue 366593003: Mac VideoCapture: return empty GetModel() for non-USB non-built-in cameras. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FakeVCD and FileVCD specify AVFoundation API type. Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/file_video_capture_device_factory.h" 5 #include "media/video/capture/file_video_capture_device_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "media/base/media_switches.h" 10 #include "media/base/media_switches.h"
(...skipping 27 matching lines...) Expand all
38 38
39 void FileVideoCaptureDeviceFactory::GetDeviceNames( 39 void FileVideoCaptureDeviceFactory::GetDeviceNames(
40 VideoCaptureDevice::Names* const device_names) { 40 VideoCaptureDevice::Names* const device_names) {
41 DCHECK(thread_checker_.CalledOnValidThread()); 41 DCHECK(thread_checker_.CalledOnValidThread());
42 DCHECK(device_names->empty()); 42 DCHECK(device_names->empty());
43 base::FilePath command_line_file_path = GetFilePathFromCommandLine(); 43 base::FilePath command_line_file_path = GetFilePathFromCommandLine();
44 #if defined(OS_WIN) 44 #if defined(OS_WIN)
45 device_names->push_back(VideoCaptureDevice::Name( 45 device_names->push_back(VideoCaptureDevice::Name(
46 base::SysWideToUTF8(command_line_file_path.value()), 46 base::SysWideToUTF8(command_line_file_path.value()),
47 kFileVideoCaptureDeviceName)); 47 kFileVideoCaptureDeviceName));
48 #elif defined(OS_MACOSX)
49 device_names->push_back(VideoCaptureDevice::Name(
50 command_line_file_path.value(),
51 kFileVideoCaptureDeviceName,
52 VideoCaptureDevice::Name::AVFOUNDATION));
48 #else 53 #else
49 device_names->push_back(VideoCaptureDevice::Name( 54 device_names->push_back(VideoCaptureDevice::Name(
50 command_line_file_path.value(), 55 command_line_file_path.value(),
51 kFileVideoCaptureDeviceName)); 56 kFileVideoCaptureDeviceName));
52 #endif 57 #endif
53 } 58 }
54 59
55 void FileVideoCaptureDeviceFactory::GetDeviceSupportedFormats( 60 void FileVideoCaptureDeviceFactory::GetDeviceSupportedFormats(
56 const VideoCaptureDevice::Name& device, 61 const VideoCaptureDevice::Name& device,
57 VideoCaptureFormats* supported_formats) { 62 VideoCaptureFormats* supported_formats) {
58 DCHECK(thread_checker_.CalledOnValidThread()); 63 DCHECK(thread_checker_.CalledOnValidThread());
59 base::File file = 64 base::File file =
60 FileVideoCaptureDevice::OpenFileForRead(GetFilePathFromCommandLine()); 65 FileVideoCaptureDevice::OpenFileForRead(GetFilePathFromCommandLine());
61 VideoCaptureFormat capture_format; 66 VideoCaptureFormat capture_format;
62 FileVideoCaptureDevice::ParseFileAndExtractVideoFormat(&file, 67 FileVideoCaptureDevice::ParseFileAndExtractVideoFormat(&file,
63 &capture_format); 68 &capture_format);
64 supported_formats->push_back(capture_format); 69 supported_formats->push_back(capture_format);
65 } 70 }
66 71
67 } // namespace media 72 } // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/fake_video_capture_device_factory.cc ('k') | media/video/capture/mac/avfoundation_glue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698