OLD | NEW |
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/fake_video_capture_device_factory.h" | 5 #include "media/video/capture/fake_video_capture_device_factory.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "media/video/capture/fake_video_capture_device.h" | 8 #include "media/video/capture/fake_video_capture_device.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 19 matching lines...) Expand all Loading... |
30 DCHECK(device_names->empty()); | 30 DCHECK(device_names->empty()); |
31 for (int n = 0; n < number_of_devices_; ++n) { | 31 for (int n = 0; n < number_of_devices_; ++n) { |
32 VideoCaptureDevice::Name name(base::StringPrintf("fake_device_%d", n), | 32 VideoCaptureDevice::Name name(base::StringPrintf("fake_device_%d", n), |
33 base::StringPrintf("/dev/video%d", n) | 33 base::StringPrintf("/dev/video%d", n) |
34 #if defined(OS_LINUX) | 34 #if defined(OS_LINUX) |
35 , VideoCaptureDevice::Name::V4L2_SINGLE_PLANE | 35 , VideoCaptureDevice::Name::V4L2_SINGLE_PLANE |
36 #elif defined(OS_MACOSX) | 36 #elif defined(OS_MACOSX) |
37 , VideoCaptureDevice::Name::AVFOUNDATION | 37 , VideoCaptureDevice::Name::AVFOUNDATION |
38 #elif defined(OS_WIN) | 38 #elif defined(OS_WIN) |
39 , VideoCaptureDevice::Name::DIRECT_SHOW | 39 , VideoCaptureDevice::Name::DIRECT_SHOW |
| 40 #elif defined(OS_ANDROID) |
| 41 , VideoCaptureDevice::Name::API2_LEGACY |
40 #endif | 42 #endif |
41 ); | 43 ); |
42 device_names->push_back(name); | 44 device_names->push_back(name); |
43 } | 45 } |
44 } | 46 } |
45 | 47 |
46 void FakeVideoCaptureDeviceFactory::GetDeviceSupportedFormats( | 48 void FakeVideoCaptureDeviceFactory::GetDeviceSupportedFormats( |
47 const VideoCaptureDevice::Name& device, | 49 const VideoCaptureDevice::Name& device, |
48 VideoCaptureFormats* supported_formats) { | 50 VideoCaptureFormats* supported_formats) { |
49 DCHECK(thread_checker_.CalledOnValidThread()); | 51 DCHECK(thread_checker_.CalledOnValidThread()); |
50 const int frame_rate = 1000 / FakeVideoCaptureDevice::kFakeCaptureTimeoutMs; | 52 const int frame_rate = 1000 / FakeVideoCaptureDevice::kFakeCaptureTimeoutMs; |
51 const gfx::Size supported_sizes[] = {gfx::Size(320, 240), | 53 const gfx::Size supported_sizes[] = {gfx::Size(320, 240), |
52 gfx::Size(640, 480), | 54 gfx::Size(640, 480), |
53 gfx::Size(1280, 720), | 55 gfx::Size(1280, 720), |
54 gfx::Size(1920, 1080)}; | 56 gfx::Size(1920, 1080)}; |
55 supported_formats->clear(); | 57 supported_formats->clear(); |
56 for (size_t i = 0; i < arraysize(supported_sizes); ++i) { | 58 for (size_t i = 0; i < arraysize(supported_sizes); ++i) { |
57 supported_formats->push_back(VideoCaptureFormat(supported_sizes[i], | 59 supported_formats->push_back(VideoCaptureFormat(supported_sizes[i], |
58 frame_rate, | 60 frame_rate, |
59 media::PIXEL_FORMAT_I420)); | 61 media::PIXEL_FORMAT_I420)); |
60 } | 62 } |
61 } | 63 } |
62 | 64 |
63 } // namespace media | 65 } // namespace media |
OLD | NEW |