dev-event.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <title>Event Interface</title>
  2. <para>The V4L2 event interface provides a means for a user to get
  3. immediately notified on certain conditions taking place on a device.
  4. This might include start of frame or loss of signal events, for
  5. example. Changes in the value or state of a V4L2 control can also be
  6. reported through events.
  7. </para>
  8. <para>To receive events, the events the user is interested in first must
  9. be subscribed using the &VIDIOC-SUBSCRIBE-EVENT; ioctl. Once an event is
  10. subscribed, the events of subscribed types are dequeueable using the
  11. &VIDIOC-DQEVENT; ioctl. Events may be unsubscribed using
  12. VIDIOC_UNSUBSCRIBE_EVENT ioctl. The special event type V4L2_EVENT_ALL may
  13. be used to unsubscribe all the events the driver supports.</para>
  14. <para>The event subscriptions and event queues are specific to file
  15. handles. Subscribing an event on one file handle does not affect
  16. other file handles.</para>
  17. <para>The information on dequeueable events is obtained by using select or
  18. poll system calls on video devices. The V4L2 events use POLLPRI events on
  19. poll system call and exceptions on select system call.</para>
  20. <para>Starting with kernel 3.1 certain guarantees can be given with
  21. regards to events:<orderedlist>
  22. <listitem>
  23. <para>Each subscribed event has its own internal dedicated event queue.
  24. This means that flooding of one event type will not interfere with other
  25. event types.</para>
  26. </listitem>
  27. <listitem>
  28. <para>If the internal event queue for a particular subscribed event
  29. becomes full, then the oldest event in that queue will be dropped.</para>
  30. </listitem>
  31. <listitem>
  32. <para>Where applicable, certain event types can ensure that the payload
  33. of the oldest event that is about to be dropped will be merged with the payload
  34. of the next oldest event. Thus ensuring that no information is lost, but only an
  35. intermediate step leading up to that information. See the documentation for the
  36. event you want to subscribe to whether this is applicable for that event or not.</para>
  37. </listitem>
  38. </orderedlist></para>