logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

uvcvideo.h (2627B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef __LINUX_UVCVIDEO_H_
  3. #define __LINUX_UVCVIDEO_H_
  4. #include <linux/ioctl.h>
  5. #include <linux/types.h>
  6. /*
  7. * Dynamic controls
  8. */
  9. /* Data types for UVC control data */
  10. #define UVC_CTRL_DATA_TYPE_RAW 0
  11. #define UVC_CTRL_DATA_TYPE_SIGNED 1
  12. #define UVC_CTRL_DATA_TYPE_UNSIGNED 2
  13. #define UVC_CTRL_DATA_TYPE_BOOLEAN 3
  14. #define UVC_CTRL_DATA_TYPE_ENUM 4
  15. #define UVC_CTRL_DATA_TYPE_BITMASK 5
  16. /* Control flags */
  17. #define UVC_CTRL_FLAG_SET_CUR (1 << 0)
  18. #define UVC_CTRL_FLAG_GET_CUR (1 << 1)
  19. #define UVC_CTRL_FLAG_GET_MIN (1 << 2)
  20. #define UVC_CTRL_FLAG_GET_MAX (1 << 3)
  21. #define UVC_CTRL_FLAG_GET_RES (1 << 4)
  22. #define UVC_CTRL_FLAG_GET_DEF (1 << 5)
  23. /* Control should be saved at suspend and restored at resume. */
  24. #define UVC_CTRL_FLAG_RESTORE (1 << 6)
  25. /* Control can be updated by the camera. */
  26. #define UVC_CTRL_FLAG_AUTO_UPDATE (1 << 7)
  27. /* Control supports asynchronous reporting */
  28. #define UVC_CTRL_FLAG_ASYNCHRONOUS (1 << 8)
  29. #define UVC_CTRL_FLAG_GET_RANGE \
  30. (UVC_CTRL_FLAG_GET_CUR | UVC_CTRL_FLAG_GET_MIN | \
  31. UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | \
  32. UVC_CTRL_FLAG_GET_DEF)
  33. #define UVC_MENU_NAME_LEN 32
  34. struct uvc_menu_info {
  35. __u32 value;
  36. __u8 name[UVC_MENU_NAME_LEN];
  37. };
  38. struct uvc_xu_control_mapping {
  39. __u32 id;
  40. __u8 name[32];
  41. __u8 entity[16];
  42. __u8 selector;
  43. __u8 size;
  44. __u8 offset;
  45. __u32 v4l2_type;
  46. __u32 data_type;
  47. struct uvc_menu_info *menu_info;
  48. __u32 menu_count;
  49. __u32 reserved[4];
  50. };
  51. struct uvc_xu_control_query {
  52. __u8 unit;
  53. __u8 selector;
  54. __u8 query; /* Video Class-Specific Request Code, */
  55. /* defined in linux/usb/video.h A.8. */
  56. __u16 size;
  57. __u8 *data;
  58. };
  59. #define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_control_mapping)
  60. #define UVCIOC_CTRL_QUERY _IOWR('u', 0x21, struct uvc_xu_control_query)
  61. /*
  62. * Metadata node
  63. */
  64. /**
  65. * struct uvc_meta_buf - metadata buffer building block
  66. * @ns: system timestamp of the payload in nanoseconds
  67. * @sof: USB Frame Number
  68. * @length: length of the payload header
  69. * @flags: payload header flags
  70. * @buf: optional device-specific header data
  71. *
  72. * UVC metadata nodes fill buffers with possibly multiple instances of this
  73. * struct. The first two fields are added by the driver, they can be used for
  74. * clock synchronisation. The rest is an exact copy of a UVC payload header.
  75. * Only complete objects with complete buffers are included. Therefore it's
  76. * always sizeof(meta->ns) + sizeof(meta->sof) + meta->length bytes large.
  77. */
  78. struct uvc_meta_buf {
  79. __u64 ns;
  80. __u16 sof;
  81. __u8 length;
  82. __u8 flags;
  83. __u8 buf[];
  84. } __attribute__((packed));
  85. #endif