brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | #ifndef AOS_ATOM_CODE_CAMREA_V4L2_H_ |
| 2 | #define AOS_ATOM_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 aos { |
| 13 | namespace camera { |
| 14 | |
| 15 | static inline int xioctl(int fd, int request, void *arg) { |
| 16 | int r; |
| 17 | do { |
| 18 | r = ioctl(fd, request, reinterpret_cast<uintptr_t>(arg)); |
| 19 | } while (r == -1 && errno == EINTR); |
| 20 | return r; |
| 21 | } |
| 22 | |
| 23 | } // namespace camera |
| 24 | } // namespace aos |
| 25 | |
| 26 | #endif |
| 27 | |