vidioc-subscribe-event.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <refentry id="vidioc-subscribe-event">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_SUBSCRIBE_EVENT</refname>
  8. <refname>VIDIOC_UNSUBSCRIBE_EVENT</refname>
  9. <refpurpose>Subscribe or unsubscribe event</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <funcsynopsis>
  13. <funcprototype>
  14. <funcdef>int <function>ioctl</function></funcdef>
  15. <paramdef>int <parameter>fd</parameter></paramdef>
  16. <paramdef>int <parameter>request</parameter></paramdef>
  17. <paramdef>struct v4l2_event_subscription
  18. *<parameter>argp</parameter></paramdef>
  19. </funcprototype>
  20. </funcsynopsis>
  21. </refsynopsisdiv>
  22. <refsect1>
  23. <title>Arguments</title>
  24. <variablelist>
  25. <varlistentry>
  26. <term><parameter>fd</parameter></term>
  27. <listitem>
  28. <para>&fd;</para>
  29. </listitem>
  30. </varlistentry>
  31. <varlistentry>
  32. <term><parameter>request</parameter></term>
  33. <listitem>
  34. <para>VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT</para>
  35. </listitem>
  36. </varlistentry>
  37. <varlistentry>
  38. <term><parameter>argp</parameter></term>
  39. <listitem>
  40. <para></para>
  41. </listitem>
  42. </varlistentry>
  43. </variablelist>
  44. </refsect1>
  45. <refsect1>
  46. <title>Description</title>
  47. <para>Subscribe or unsubscribe V4L2 event. Subscribed events are
  48. dequeued by using the &VIDIOC-DQEVENT; ioctl.</para>
  49. <table frame="none" pgwide="1" id="v4l2-event-subscription">
  50. <title>struct <structname>v4l2_event_subscription</structname></title>
  51. <tgroup cols="3">
  52. &cs-str;
  53. <tbody valign="top">
  54. <row>
  55. <entry>__u32</entry>
  56. <entry><structfield>type</structfield></entry>
  57. <entry>Type of the event, see <xref linkend="event-type" />. Note that
  58. <constant>V4L2_EVENT_ALL</constant> can be used with VIDIOC_UNSUBSCRIBE_EVENT
  59. for unsubscribing all events at once.</entry>
  60. </row>
  61. <row>
  62. <entry>__u32</entry>
  63. <entry><structfield>id</structfield></entry>
  64. <entry>ID of the event source. If there is no ID associated with
  65. the event source, then set this to 0. Whether or not an event
  66. needs an ID depends on the event type.</entry>
  67. </row>
  68. <row>
  69. <entry>__u32</entry>
  70. <entry><structfield>flags</structfield></entry>
  71. <entry>Event flags, see <xref linkend="event-flags" />.</entry>
  72. </row>
  73. <row>
  74. <entry>__u32</entry>
  75. <entry><structfield>reserved</structfield>[5]</entry>
  76. <entry>Reserved for future extensions. Drivers and applications
  77. must set the array to zero.</entry>
  78. </row>
  79. </tbody>
  80. </tgroup>
  81. </table>
  82. <table pgwide="1" frame="none" id="event-flags">
  83. <title>Event Flags</title>
  84. <tgroup cols="3">
  85. &cs-def;
  86. <tbody valign="top">
  87. <row>
  88. <entry><constant>V4L2_EVENT_SUB_FL_SEND_INITIAL</constant></entry>
  89. <entry>0x0001</entry>
  90. <entry>When this event is subscribed an initial event will be sent
  91. containing the current status. This only makes sense for events
  92. that are triggered by a status change such as <constant>V4L2_EVENT_CTRL</constant>.
  93. Other events will ignore this flag.</entry>
  94. </row>
  95. <row>
  96. <entry><constant>V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK</constant></entry>
  97. <entry>0x0002</entry>
  98. <entry><para>If set, then events directly caused by an ioctl will also be sent to
  99. the filehandle that called that ioctl. For example, changing a control using
  100. &VIDIOC-S-CTRL; will cause a V4L2_EVENT_CTRL to be sent back to that same
  101. filehandle. Normally such events are suppressed to prevent feedback loops
  102. where an application changes a control to a one value and then another, and
  103. then receives an event telling it that that control has changed to the first
  104. value.</para>
  105. <para>Since it can't tell whether that event was caused by another application
  106. or by the &VIDIOC-S-CTRL; call it is hard to decide whether to set the
  107. control to the value in the event, or ignore it.</para>
  108. <para>Think carefully when you set this flag so you won't get into situations
  109. like that.</para>
  110. </entry>
  111. </row>
  112. </tbody>
  113. </tgroup>
  114. </table>
  115. </refsect1>
  116. <refsect1>
  117. &return-value;
  118. </refsect1>
  119. </refentry>