1 <refentry id="vidioc-subscribe-event">
3 <refentrytitle>ioctl VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT</refentrytitle>
8 <refname>VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT</refname>
9 <refpurpose>Subscribe or unsubscribe event</refpurpose>
15 <funcdef>int <function>ioctl</function></funcdef>
16 <paramdef>int <parameter>fd</parameter></paramdef>
17 <paramdef>int <parameter>request</parameter></paramdef>
18 <paramdef>struct v4l2_event_subscription
19 *<parameter>argp</parameter></paramdef>
25 <title>Arguments</title>
29 <term><parameter>fd</parameter></term>
35 <term><parameter>request</parameter></term>
37 <para>VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT</para>
41 <term><parameter>argp</parameter></term>
50 <title>Description</title>
52 <para>Subscribe or unsubscribe V4L2 event. Subscribed events are
53 dequeued by using the &VIDIOC-DQEVENT; ioctl.</para>
55 <table frame="none" pgwide="1" id="v4l2-event-subscription">
56 <title>struct <structname>v4l2_event_subscription</structname></title>
62 <entry><structfield>type</structfield></entry>
63 <entry>Type of the event.</entry>
67 <entry><structfield>id</structfield></entry>
68 <entry>ID of the event source. If there is no ID associated with
69 the event source, then set this to 0. Whether or not an event
70 needs an ID depends on the event type.</entry>
74 <entry><structfield>flags</structfield></entry>
75 <entry>Event flags, see <xref linkend="event-flags" />.</entry>
79 <entry><structfield>reserved</structfield>[5]</entry>
80 <entry>Reserved for future extensions. Drivers and applications
81 must set the array to zero.</entry>
87 <table frame="none" pgwide="1" id="event-type">
88 <title>Event Types</title>
93 <entry><constant>V4L2_EVENT_ALL</constant></entry>
95 <entry>All events. V4L2_EVENT_ALL is valid only for
96 VIDIOC_UNSUBSCRIBE_EVENT for unsubscribing all events at once.
100 <entry><constant>V4L2_EVENT_VSYNC</constant></entry>
102 <entry>This event is triggered on the vertical sync.
103 This event has a &v4l2-event-vsync; associated with it.
107 <entry><constant>V4L2_EVENT_EOS</constant></entry>
109 <entry>This event is triggered when the end of a stream is reached.
110 This is typically used with MPEG decoders to report to the application
111 when the last of the MPEG stream has been decoded.
115 <entry><constant>V4L2_EVENT_CTRL</constant></entry>
117 <entry>This event requires that the <structfield>id</structfield>
118 matches the control ID from which you want to receive events.
119 This event is triggered if the control's value changes, if a
120 button control is pressed or if the control's flags change.
121 This event has a &v4l2-event-ctrl; associated with it. This struct
122 contains much of the same information as &v4l2-queryctrl; and
125 If the event is generated due to a call to &VIDIOC-S-CTRL; or
126 &VIDIOC-S-EXT-CTRLS;, then the event will not be sent to
127 the file handle that called the ioctl function. This prevents
128 nasty feedback loops.
130 This event type will ensure that no information is lost when
131 more events are raised than there is room internally. In that
132 case the &v4l2-event-ctrl; of the second-oldest event is kept,
133 but the <structfield>changes</structfield> field of the
134 second-oldest event is ORed with the <structfield>changes</structfield>
135 field of the oldest event.
139 <entry><constant>V4L2_EVENT_PRIVATE_START</constant></entry>
140 <entry>0x08000000</entry>
141 <entry>Base event number for driver-private events.</entry>
147 <table pgwide="1" frame="none" id="event-flags">
148 <title>Event Flags</title>
153 <entry><constant>V4L2_EVENT_SUB_FL_SEND_INITIAL</constant></entry>
154 <entry>0x0001</entry>
155 <entry>When this event is subscribed an initial event will be sent
156 containing the current status. This only makes sense for events
157 that are triggered by a status change such as <constant>V4L2_EVENT_CTRL</constant>.
158 Other events will ignore this flag.</entry>
164 <table frame="none" pgwide="1" id="v4l2-event-vsync">
165 <title>struct <structname>v4l2_event_vsync</structname></title>
171 <entry><structfield>field</structfield></entry>
172 <entry>The upcoming field. See &v4l2-field;.</entry>
178 <table frame="none" pgwide="1" id="v4l2-event-ctrl">
179 <title>struct <structname>v4l2_event_ctrl</structname></title>
185 <entry><structfield>changes</structfield></entry>
187 <entry>A bitmask that tells what has changed. See <xref linkend="changes-flags" />.</entry>
191 <entry><structfield>type</structfield></entry>
193 <entry>The type of the control. See &v4l2-ctrl-type;.</entry>
196 <entry>union (anonymous)</entry>
204 <entry><structfield>value</structfield></entry>
205 <entry>The 32-bit value of the control for 32-bit control types.
206 This is 0 for string controls since the value of a string
207 cannot be passed using &VIDIOC-DQEVENT;.</entry>
212 <entry><structfield>value64</structfield></entry>
213 <entry>The 64-bit value of the control for 64-bit control types.</entry>
217 <entry><structfield>flags</structfield></entry>
219 <entry>The control flags. See <xref linkend="control-flags" />.</entry>
223 <entry><structfield>minimum</structfield></entry>
225 <entry>The minimum value of the control. See &v4l2-queryctrl;.</entry>
229 <entry><structfield>maximum</structfield></entry>
231 <entry>The maximum value of the control. See &v4l2-queryctrl;.</entry>
235 <entry><structfield>step</structfield></entry>
237 <entry>The step value of the control. See &v4l2-queryctrl;.</entry>
241 <entry><structfield>default_value</structfield></entry>
243 <entry>The default value value of the control. See &v4l2-queryctrl;.</entry>
249 <table pgwide="1" frame="none" id="changes-flags">
250 <title>Changes</title>
255 <entry><constant>V4L2_EVENT_CTRL_CH_VALUE</constant></entry>
256 <entry>0x0001</entry>
257 <entry>This control event was triggered because the value of the control
258 changed. Special case: if a button control is pressed, then this
259 event is sent as well, even though there is not explicit value
260 associated with a button control.</entry>
263 <entry><constant>V4L2_EVENT_CTRL_CH_FLAGS</constant></entry>
264 <entry>0x0002</entry>
265 <entry>This control event was triggered because the control flags
277 sgml-parent-document: "v4l2.sgml"
278 indent-tabs-mode: nil