OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/capture/video/linux/video_capture_device_linux.h" | 5 #include "media/capture/video/linux/video_capture_device_linux.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 9 #include <list> |
| 10 |
| 11 #include "base/bind.h" |
| 12 #include "base/strings/stringprintf.h" |
| 13 #include "build/build_config.h" |
| 14 #include "media/capture/video/linux/v4l2_capture_delegate.h" |
| 15 |
7 #if defined(OS_OPENBSD) | 16 #if defined(OS_OPENBSD) |
8 #include <sys/videoio.h> | 17 #include <sys/videoio.h> |
9 #else | 18 #else |
10 #include <linux/videodev2.h> | 19 #include <linux/videodev2.h> |
11 #endif | 20 #endif |
12 | 21 |
13 #include <list> | |
14 | |
15 #include "base/bind.h" | |
16 #include "base/strings/stringprintf.h" | |
17 #include "media/capture/video/linux/v4l2_capture_delegate.h" | |
18 | |
19 namespace media { | 22 namespace media { |
20 | 23 |
21 // USB VID and PID are both 4 bytes long. | 24 // USB VID and PID are both 4 bytes long. |
22 static const size_t kVidPidSize = 4; | 25 static const size_t kVidPidSize = 4; |
23 | 26 |
24 // /sys/class/video4linux/video{N}/device is a symlink to the corresponding | 27 // /sys/class/video4linux/video{N}/device is a symlink to the corresponding |
25 // USB device info directory. | 28 // USB device info directory. |
26 static const char kVidPathTemplate[] = | 29 static const char kVidPathTemplate[] = |
27 "/sys/class/video4linux/%s/device/../idVendor"; | 30 "/sys/class/video4linux/%s/device/../idVendor"; |
28 static const char kPidPathTemplate[] = | 31 static const char kPidPathTemplate[] = |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ; | 142 return V4L2_CID_POWER_LINE_FREQUENCY_50HZ; |
140 case media::PowerLineFrequency::FREQUENCY_60HZ: | 143 case media::PowerLineFrequency::FREQUENCY_60HZ: |
141 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ; | 144 return V4L2_CID_POWER_LINE_FREQUENCY_60HZ; |
142 default: | 145 default: |
143 // If we have no idea of the frequency, at least try and set it to AUTO. | 146 // If we have no idea of the frequency, at least try and set it to AUTO. |
144 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO; | 147 return V4L2_CID_POWER_LINE_FREQUENCY_AUTO; |
145 } | 148 } |
146 } | 149 } |
147 | 150 |
148 } // namespace media | 151 } // namespace media |
OLD | NEW |