Parker Schuh | 44f8692 | 2017-01-03 23:59:50 -0800 | [diff] [blame] | 1 | #ifndef AOS_LINUX_CODE_CAMREA_V4L2_H_ |
| 2 | #define AOS_LINUX_CODE_CAMREA_V4L2_H_ |
| 3 | |
| 4 | // This file handles including everything needed to use V4L2 and has some |
| 5 | // utility functions. |
| 6 | |
| 7 | #include <sys/ioctl.h> |
| 8 | |
| 9 | #include <asm/types.h> /* for videodev2.h */ |
| 10 | #include <linux/videodev2.h> |
| 11 | |
| 12 | namespace camera { |
| 13 | |
| 14 | static inline int xioctl(int fd, int request, void *arg) { |
| 15 | int r; |
| 16 | do { |
| 17 | r = ioctl(fd, request, reinterpret_cast<uintptr_t>(arg)); |
| 18 | } while (r == -1 && errno == EINTR); |
| 19 | return r; |
| 20 | } |
| 21 | |
| 22 | } // namespace camera |
| 23 | |
| 24 | #endif |