patch-uvc_compat_h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. $OpenBSD: patch-uvc_compat_h,v 1.1.1.1 2008/06/13 16:45:01 robert Exp $
  2. --- uvc_compat.h.orig Fri Jun 13 00:36:47 2008
  3. +++ uvc_compat.h Fri Jun 13 00:37:34 2008
  4. @@ -1,129 +1,2 @@
  5. #ifndef _UVC_COMPAT_H
  6. -#define _UVC_COMPAT_H
  7. -
  8. -#include <linux/version.h>
  9. -
  10. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
  11. -/*
  12. - * Extended control API
  13. - */
  14. -struct v4l2_ext_control
  15. -{
  16. - __u32 id;
  17. - __u32 reserved2[2];
  18. - union {
  19. - __s32 value;
  20. - __s64 value64;
  21. - void *reserved;
  22. - };
  23. -} __attribute__ ((packed));
  24. -
  25. -struct v4l2_ext_controls
  26. -{
  27. - __u32 ctrl_class;
  28. - __u32 count;
  29. - __u32 error_idx;
  30. - __u32 reserved[2];
  31. - struct v4l2_ext_control *controls;
  32. -};
  33. -
  34. -/* Values for ctrl_class field */
  35. -#define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */
  36. -#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
  37. -
  38. -#define V4L2_CTRL_ID_MASK (0x0fffffff)
  39. -#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
  40. -#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
  41. -
  42. -/* User-class control IDs defined by V4L2 */
  43. -#undef V4L2_CID_BASE
  44. -#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
  45. -#define V4L2_CID_USER_BASE V4L2_CID_BASE
  46. -#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
  47. -
  48. -#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
  49. -#define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls)
  50. -#define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls)
  51. -
  52. -#endif
  53. -
  54. -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
  55. -/*
  56. - * Frame size and frame rate enumeration
  57. - *
  58. - * Included in Linux 2.6.19
  59. - */
  60. -enum v4l2_frmsizetypes
  61. -{
  62. - V4L2_FRMSIZE_TYPE_DISCRETE = 1,
  63. - V4L2_FRMSIZE_TYPE_CONTINUOUS = 2,
  64. - V4L2_FRMSIZE_TYPE_STEPWISE = 3,
  65. -};
  66. -
  67. -struct v4l2_frmsize_discrete
  68. -{
  69. - __u32 width; /* Frame width [pixel] */
  70. - __u32 height; /* Frame height [pixel] */
  71. -};
  72. -
  73. -struct v4l2_frmsize_stepwise
  74. -{
  75. - __u32 min_width; /* Minimum frame width [pixel] */
  76. - __u32 max_width; /* Maximum frame width [pixel] */
  77. - __u32 step_width; /* Frame width step size [pixel] */
  78. - __u32 min_height; /* Minimum frame height [pixel] */
  79. - __u32 max_height; /* Maximum frame height [pixel] */
  80. - __u32 step_height; /* Frame height step size [pixel] */
  81. -};
  82. -
  83. -struct v4l2_frmsizeenum
  84. -{
  85. - __u32 index; /* Frame size number */
  86. - __u32 pixel_format; /* Pixel format */
  87. - __u32 type; /* Frame size type the device supports. */
  88. -
  89. - union { /* Frame size */
  90. - struct v4l2_frmsize_discrete discrete;
  91. - struct v4l2_frmsize_stepwise stepwise;
  92. - };
  93. -
  94. - __u32 reserved[2]; /* Reserved space for future use */
  95. -};
  96. -
  97. -enum v4l2_frmivaltypes
  98. -{
  99. - V4L2_FRMIVAL_TYPE_DISCRETE = 1,
  100. - V4L2_FRMIVAL_TYPE_CONTINUOUS = 2,
  101. - V4L2_FRMIVAL_TYPE_STEPWISE = 3,
  102. -};
  103. -
  104. -struct v4l2_frmival_stepwise
  105. -{
  106. - struct v4l2_fract min; /* Minimum frame interval [s] */
  107. - struct v4l2_fract max; /* Maximum frame interval [s] */
  108. - struct v4l2_fract step; /* Frame interval step size [s] */
  109. -};
  110. -
  111. -struct v4l2_frmivalenum
  112. -{
  113. - __u32 index; /* Frame format index */
  114. - __u32 pixel_format; /* Pixel format */
  115. - __u32 width; /* Frame width */
  116. - __u32 height; /* Frame height */
  117. - __u32 type; /* Frame interval type the device supports. */
  118. -
  119. - union { /* Frame interval */
  120. - struct v4l2_fract discrete;
  121. - struct v4l2_frmival_stepwise stepwise;
  122. - };
  123. -
  124. - __u32 reserved[2]; /* Reserved space for future use */
  125. -};
  126. -
  127. -#define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum)
  128. -#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum)
  129. -#endif
  130. -
  131. -
  132. #endif /* _UVC_COMPAT_H */
  133. -