OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "extensions/browser/api/webcam_private/v4l2_webcam.h" | 5 #include "extensions/browser/api/webcam_private/v4l2_webcam.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <linux/uvcvideo.h> | 9 #include <linux/uvcvideo.h> |
10 #include <linux/videodev2.h> | 10 #include <linux/videodev2.h> |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 #include <sys/ioctl.h> | 12 #include <sys/ioctl.h> |
13 #include <unistd.h> | 13 #include <unistd.h> |
14 | 14 |
| 15 #include "base/macros.h" |
15 #include "base/posix/eintr_wrapper.h" | 16 #include "base/posix/eintr_wrapper.h" |
16 | 17 |
17 #define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE+32) | 18 #define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE+32) |
18 #define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE+33) | 19 #define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE+33) |
19 #define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE+34) | 20 #define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE+34) |
20 | 21 |
21 // GUID of the Extension Unit for Logitech CC3300e motor control: | 22 // GUID of the Extension Unit for Logitech CC3300e motor control: |
22 // {212de5ff-3080-2c4e-82d9-f587d00540bd} | 23 // {212de5ff-3080-2c4e-82d9-f587d00540bd} |
23 #define UVC_GUID_LOGITECH_CC3000E_MOTORS \ | 24 #define UVC_GUID_LOGITECH_CC3000E_MOTORS \ |
24 {0x21, 0x2d, 0xe5, 0xff, 0x30, 0x80, 0x2c, 0x4e, \ | 25 {0x21, 0x2d, 0xe5, 0xff, 0x30, 0x80, 0x2c, 0x4e, \ |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 if (!SetWebcamParameter(fd_.get(), V4L2_CID_ZOOM_ABSOLUTE, kDefaultZoom)) { | 198 if (!SetWebcamParameter(fd_.get(), V4L2_CID_ZOOM_ABSOLUTE, kDefaultZoom)) { |
198 callback.Run(false); | 199 callback.Run(false); |
199 return; | 200 return; |
200 } | 201 } |
201 } | 202 } |
202 | 203 |
203 callback.Run(true); | 204 callback.Run(true); |
204 } | 205 } |
205 | 206 |
206 } // namespace extensions | 207 } // namespace extensions |
OLD | NEW |