Chromium Code Reviews| 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 "media/capture/video/linux/v4l2_capture_delegate.h" | 5 #include "media/capture/video/linux/v4l2_capture_delegate.h" |
| 6 | 6 |
| 7 #include <linux/version.h> | 7 #include <linux/version.h> |
| 8 #include <linux/videodev2.h> | 8 #include <linux/videodev2.h> |
| 9 #include <poll.h> | 9 #include <poll.h> |
| 10 #include <sys/fcntl.h> | 10 #include <sys/fcntl.h> |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 // Determines if |control_id| should be skipped, https://crbug.com/697885. | 177 // Determines if |control_id| should be skipped, https://crbug.com/697885. |
| 178 #if !defined(V4L2_CID_PAN_SPEED) | 178 #if !defined(V4L2_CID_PAN_SPEED) |
| 179 #define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 32) | 179 #define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 32) |
| 180 #endif | 180 #endif |
| 181 #if !defined(V4L2_CID_TILT_SPEED) | 181 #if !defined(V4L2_CID_TILT_SPEED) |
| 182 #define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 33) | 182 #define V4L2_CID_TILT_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 33) |
| 183 #endif | 183 #endif |
| 184 #if !defined(V4L2_CID_PANTILT_CMD) | 184 #if !defined(V4L2_CID_PANTILT_CMD) |
| 185 #define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34) | 185 #define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34) |
| 186 #endif | 186 #endif |
| 187 static bool IsBlacklistedControl(int control_id) { | 187 static bool IsBlacklistedControl(int control_id) { |
|
Pawel Osciak
2017/05/25 05:42:43
Would it perhaps be possible to have this list in
mcasas
2017/05/26 14:25:51
I ruled that out because, for the purpose of
unit
Pawel Osciak
2017/05/29 03:54:43
Acknowledged.
| |
| 188 switch (control_id) { | 188 switch (control_id) { |
| 189 case V4L2_CID_PAN_RELATIVE: | 189 case V4L2_CID_PAN_RELATIVE: |
| 190 case V4L2_CID_TILT_RELATIVE: | 190 case V4L2_CID_TILT_RELATIVE: |
| 191 case V4L2_CID_PAN_RESET: | 191 case V4L2_CID_PAN_RESET: |
| 192 case V4L2_CID_TILT_RESET: | 192 case V4L2_CID_TILT_RESET: |
| 193 case V4L2_CID_PAN_ABSOLUTE: | 193 case V4L2_CID_PAN_ABSOLUTE: |
| 194 case V4L2_CID_TILT_ABSOLUTE: | 194 case V4L2_CID_TILT_ABSOLUTE: |
| 195 case V4L2_CID_ZOOM_ABSOLUTE: | |
| 196 case V4L2_CID_ZOOM_RELATIVE: | |
| 197 case V4L2_CID_ZOOM_CONTINUOUS: | |
| 195 case V4L2_CID_PAN_SPEED: | 198 case V4L2_CID_PAN_SPEED: |
| 196 case V4L2_CID_TILT_SPEED: | 199 case V4L2_CID_TILT_SPEED: |
| 197 case V4L2_CID_PANTILT_CMD: | 200 case V4L2_CID_PANTILT_CMD: |
| 198 return true; | 201 return true; |
| 199 } | 202 } |
| 200 return false; | 203 return false; |
| 201 } | 204 } |
| 202 | 205 |
| 203 // Sets all user control to their default. Some controls are enabled by another | 206 // Sets all user control to their default. Some controls are enabled by another |
| 204 // flag, usually having the word "auto" in the name, see IsSpecialControl(). | 207 // flag, usually having the word "auto" in the name, see IsSpecialControl(). |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 887 DLOG(ERROR) << "Error mmap()ing a V4L2 buffer into userspace"; | 890 DLOG(ERROR) << "Error mmap()ing a V4L2 buffer into userspace"; |
| 888 return false; | 891 return false; |
| 889 } | 892 } |
| 890 start_ = static_cast<uint8_t*>(start); | 893 start_ = static_cast<uint8_t*>(start); |
| 891 length_ = buffer.length; | 894 length_ = buffer.length; |
| 892 payload_size_ = 0; | 895 payload_size_ = 0; |
| 893 return true; | 896 return true; |
| 894 } | 897 } |
| 895 | 898 |
| 896 } // namespace media | 899 } // namespace media |
| OLD | NEW |