vidioc-dqevent.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <refentry id="vidioc-dqevent">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_DQEVENT</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_DQEVENT</refname>
  8. <refpurpose>Dequeue event</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis>
  12. <funcprototype>
  13. <funcdef>int <function>ioctl</function></funcdef>
  14. <paramdef>int <parameter>fd</parameter></paramdef>
  15. <paramdef>int <parameter>request</parameter></paramdef>
  16. <paramdef>struct v4l2_event
  17. *<parameter>argp</parameter></paramdef>
  18. </funcprototype>
  19. </funcsynopsis>
  20. </refsynopsisdiv>
  21. <refsect1>
  22. <title>Arguments</title>
  23. <variablelist>
  24. <varlistentry>
  25. <term><parameter>fd</parameter></term>
  26. <listitem>
  27. <para>&fd;</para>
  28. </listitem>
  29. </varlistentry>
  30. <varlistentry>
  31. <term><parameter>request</parameter></term>
  32. <listitem>
  33. <para>VIDIOC_DQEVENT</para>
  34. </listitem>
  35. </varlistentry>
  36. <varlistentry>
  37. <term><parameter>argp</parameter></term>
  38. <listitem>
  39. <para></para>
  40. </listitem>
  41. </varlistentry>
  42. </variablelist>
  43. </refsect1>
  44. <refsect1>
  45. <title>Description</title>
  46. <para>Dequeue an event from a video device. No input is required
  47. for this ioctl. All the fields of the &v4l2-event; structure are
  48. filled by the driver. The file handle will also receive exceptions
  49. which the application may get by e.g. using the select system
  50. call.</para>
  51. <table frame="none" pgwide="1" id="v4l2-event">
  52. <title>struct <structname>v4l2_event</structname></title>
  53. <tgroup cols="4">
  54. &cs-str;
  55. <tbody valign="top">
  56. <row>
  57. <entry>__u32</entry>
  58. <entry><structfield>type</structfield></entry>
  59. <entry></entry>
  60. <entry>Type of the event.</entry>
  61. </row>
  62. <row>
  63. <entry>union</entry>
  64. <entry><structfield>u</structfield></entry>
  65. <entry></entry>
  66. <entry></entry>
  67. </row>
  68. <row>
  69. <entry></entry>
  70. <entry>&v4l2-event-vsync;</entry>
  71. <entry><structfield>vsync</structfield></entry>
  72. <entry>Event data for event <constant>V4L2_EVENT_VSYNC</constant>.
  73. </entry>
  74. </row>
  75. <row>
  76. <entry></entry>
  77. <entry>&v4l2-event-ctrl;</entry>
  78. <entry><structfield>ctrl</structfield></entry>
  79. <entry>Event data for event <constant>V4L2_EVENT_CTRL</constant>.
  80. </entry>
  81. </row>
  82. <row>
  83. <entry></entry>
  84. <entry>&v4l2-event-frame-sync;</entry>
  85. <entry><structfield>frame_sync</structfield></entry>
  86. <entry>Event data for event
  87. <constant>V4L2_EVENT_FRAME_SYNC</constant>.</entry>
  88. </row>
  89. <row>
  90. <entry></entry>
  91. <entry>&v4l2-event-motion-det;</entry>
  92. <entry><structfield>motion_det</structfield></entry>
  93. <entry>Event data for event V4L2_EVENT_MOTION_DET.</entry>
  94. </row>
  95. <row>
  96. <entry></entry>
  97. <entry>&v4l2-event-src-change;</entry>
  98. <entry><structfield>src_change</structfield></entry>
  99. <entry>Event data for event V4L2_EVENT_SOURCE_CHANGE.</entry>
  100. </row>
  101. <row>
  102. <entry></entry>
  103. <entry>__u8</entry>
  104. <entry><structfield>data</structfield>[64]</entry>
  105. <entry>Event data. Defined by the event type. The union
  106. should be used to define easily accessible type for
  107. events.</entry>
  108. </row>
  109. <row>
  110. <entry>__u32</entry>
  111. <entry><structfield>pending</structfield></entry>
  112. <entry></entry>
  113. <entry>Number of pending events excluding this one.</entry>
  114. </row>
  115. <row>
  116. <entry>__u32</entry>
  117. <entry><structfield>sequence</structfield></entry>
  118. <entry></entry>
  119. <entry>Event sequence number. The sequence number is
  120. incremented for every subscribed event that takes place.
  121. If sequence numbers are not contiguous it means that
  122. events have been lost.
  123. </entry>
  124. </row>
  125. <row>
  126. <entry>struct timespec</entry>
  127. <entry><structfield>timestamp</structfield></entry>
  128. <entry></entry>
  129. <entry>Event timestamp.</entry>
  130. </row>
  131. <row>
  132. <entry>u32</entry>
  133. <entry><structfield>id</structfield></entry>
  134. <entry></entry>
  135. <entry>The ID associated with the event source. If the event does not
  136. have an associated ID (this depends on the event type), then this
  137. is 0.</entry>
  138. </row>
  139. <row>
  140. <entry>__u32</entry>
  141. <entry><structfield>reserved</structfield>[8]</entry>
  142. <entry></entry>
  143. <entry>Reserved for future extensions. Drivers must set
  144. the array to zero.</entry>
  145. </row>
  146. </tbody>
  147. </tgroup>
  148. </table>
  149. <table frame="none" pgwide="1" id="v4l2-event-vsync">
  150. <title>struct <structname>v4l2_event_vsync</structname></title>
  151. <tgroup cols="3">
  152. &cs-str;
  153. <tbody valign="top">
  154. <row>
  155. <entry>__u8</entry>
  156. <entry><structfield>field</structfield></entry>
  157. <entry>The upcoming field. See &v4l2-field;.</entry>
  158. </row>
  159. </tbody>
  160. </tgroup>
  161. </table>
  162. <table frame="none" pgwide="1" id="v4l2-event-ctrl">
  163. <title>struct <structname>v4l2_event_ctrl</structname></title>
  164. <tgroup cols="4">
  165. &cs-str;
  166. <tbody valign="top">
  167. <row>
  168. <entry>__u32</entry>
  169. <entry><structfield>changes</structfield></entry>
  170. <entry></entry>
  171. <entry>A bitmask that tells what has changed. See <xref linkend="changes-flags" />.</entry>
  172. </row>
  173. <row>
  174. <entry>__u32</entry>
  175. <entry><structfield>type</structfield></entry>
  176. <entry></entry>
  177. <entry>The type of the control. See &v4l2-ctrl-type;.</entry>
  178. </row>
  179. <row>
  180. <entry>union (anonymous)</entry>
  181. <entry></entry>
  182. <entry></entry>
  183. <entry></entry>
  184. </row>
  185. <row>
  186. <entry></entry>
  187. <entry>__s32</entry>
  188. <entry><structfield>value</structfield></entry>
  189. <entry>The 32-bit value of the control for 32-bit control types.
  190. This is 0 for string controls since the value of a string
  191. cannot be passed using &VIDIOC-DQEVENT;.</entry>
  192. </row>
  193. <row>
  194. <entry></entry>
  195. <entry>__s64</entry>
  196. <entry><structfield>value64</structfield></entry>
  197. <entry>The 64-bit value of the control for 64-bit control types.</entry>
  198. </row>
  199. <row>
  200. <entry>__u32</entry>
  201. <entry><structfield>flags</structfield></entry>
  202. <entry></entry>
  203. <entry>The control flags. See <xref linkend="control-flags" />.</entry>
  204. </row>
  205. <row>
  206. <entry>__s32</entry>
  207. <entry><structfield>minimum</structfield></entry>
  208. <entry></entry>
  209. <entry>The minimum value of the control. See &v4l2-queryctrl;.</entry>
  210. </row>
  211. <row>
  212. <entry>__s32</entry>
  213. <entry><structfield>maximum</structfield></entry>
  214. <entry></entry>
  215. <entry>The maximum value of the control. See &v4l2-queryctrl;.</entry>
  216. </row>
  217. <row>
  218. <entry>__s32</entry>
  219. <entry><structfield>step</structfield></entry>
  220. <entry></entry>
  221. <entry>The step value of the control. See &v4l2-queryctrl;.</entry>
  222. </row>
  223. <row>
  224. <entry>__s32</entry>
  225. <entry><structfield>default_value</structfield></entry>
  226. <entry></entry>
  227. <entry>The default value value of the control. See &v4l2-queryctrl;.</entry>
  228. </row>
  229. </tbody>
  230. </tgroup>
  231. </table>
  232. <table frame="none" pgwide="1" id="v4l2-event-frame-sync">
  233. <title>struct <structname>v4l2_event_frame_sync</structname></title>
  234. <tgroup cols="3">
  235. &cs-str;
  236. <tbody valign="top">
  237. <row>
  238. <entry>__u32</entry>
  239. <entry><structfield>frame_sequence</structfield></entry>
  240. <entry>
  241. The sequence number of the frame being received.
  242. </entry>
  243. </row>
  244. </tbody>
  245. </tgroup>
  246. </table>
  247. <table frame="none" pgwide="1" id="v4l2-event-src-change">
  248. <title>struct <structname>v4l2_event_src_change</structname></title>
  249. <tgroup cols="3">
  250. &cs-str;
  251. <tbody valign="top">
  252. <row>
  253. <entry>__u32</entry>
  254. <entry><structfield>changes</structfield></entry>
  255. <entry>
  256. A bitmask that tells what has changed. See <xref linkend="src-changes-flags" />.
  257. </entry>
  258. </row>
  259. </tbody>
  260. </tgroup>
  261. </table>
  262. <table frame="none" pgwide="1" id="v4l2-event-motion-det">
  263. <title>struct <structname>v4l2_event_motion_det</structname></title>
  264. <tgroup cols="3">
  265. &cs-str;
  266. <tbody valign="top">
  267. <row>
  268. <entry>__u32</entry>
  269. <entry><structfield>flags</structfield></entry>
  270. <entry>
  271. Currently only one flag is available: if <constant>V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ</constant>
  272. is set, then the <structfield>frame_sequence</structfield> field is valid,
  273. otherwise that field should be ignored.
  274. </entry>
  275. </row>
  276. <row>
  277. <entry>__u32</entry>
  278. <entry><structfield>frame_sequence</structfield></entry>
  279. <entry>
  280. The sequence number of the frame being received. Only valid if the
  281. <constant>V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ</constant> flag was set.
  282. </entry>
  283. </row>
  284. <row>
  285. <entry>__u32</entry>
  286. <entry><structfield>region_mask</structfield></entry>
  287. <entry>
  288. The bitmask of the regions that reported motion. There is at least one
  289. region. If this field is 0, then no motion was detected at all.
  290. If there is no <constant>V4L2_CID_DETECT_MD_REGION_GRID</constant> control
  291. (see <xref linkend="detect-controls" />) to assign a different region
  292. to each cell in the motion detection grid, then that all cells
  293. are automatically assigned to the default region 0.
  294. </entry>
  295. </row>
  296. </tbody>
  297. </tgroup>
  298. </table>
  299. <table pgwide="1" frame="none" id="changes-flags">
  300. <title>Changes</title>
  301. <tgroup cols="3">
  302. &cs-def;
  303. <tbody valign="top">
  304. <row>
  305. <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry>
  306. <entry>0x0001</entry>
  307. <entry>This control event was triggered because the value of the control
  308. changed. Special case: if a button control is pressed, then this
  309. event is sent as well, even though there is not explicit value
  310. associated with a button control.</entry>
  311. </row>
  312. <row>
  313. <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry>
  314. <entry>0x0002</entry>
  315. <entry>This control event was triggered because the control flags
  316. changed.</entry>
  317. </row>
  318. <row>
  319. <entry><constant>V4L2_EVENT_CTRL_CH_RANGE</constant></entry>
  320. <entry>0x0004</entry>
  321. <entry>This control event was triggered because the minimum,
  322. maximum, step or the default value of the control changed.</entry>
  323. </row>
  324. </tbody>
  325. </tgroup>
  326. </table>
  327. <table pgwide="1" frame="none" id="src-changes-flags">
  328. <title>Source Changes</title>
  329. <tgroup cols="3">
  330. &cs-def;
  331. <tbody valign="top">
  332. <row>
  333. <entry><constant>V4L2_EVENT_SRC_CH_RESOLUTION</constant></entry>
  334. <entry>0x0001</entry>
  335. <entry>This event gets triggered when a resolution change is
  336. detected at an input. This can come from an input connector or
  337. from a video decoder.
  338. </entry>
  339. </row>
  340. </tbody>
  341. </tgroup>
  342. </table>
  343. </refsect1>
  344. <refsect1>
  345. &return-value;
  346. </refsect1>
  347. </refentry>