diff options
-rw-r--r-- | include/media/v4l2-event.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 7abeb397d130..5f14e8895ce2 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h | |||
@@ -29,6 +29,40 @@ | |||
29 | #include <linux/videodev2.h> | 29 | #include <linux/videodev2.h> |
30 | #include <linux/wait.h> | 30 | #include <linux/wait.h> |
31 | 31 | ||
32 | /* | ||
33 | * Overview: | ||
34 | * | ||
35 | * Events are subscribed per-filehandle. An event specification consists of a | ||
36 | * type and is optionally associated with an object identified through the | ||
37 | * 'id' field. So an event is uniquely identified by the (type, id) tuple. | ||
38 | * | ||
39 | * The v4l2-fh struct has a list of subscribed events. The v4l2_subscribed_event | ||
40 | * struct is added to that list, one for every subscribed event. | ||
41 | * | ||
42 | * Each v4l2_subscribed_event struct ends with an array of v4l2_kevent structs. | ||
43 | * This array (ringbuffer, really) is used to store any events raised by the | ||
44 | * driver. The v4l2_kevent struct links into the 'available' list of the | ||
45 | * v4l2_fh struct so VIDIOC_DQEVENT will know which event to dequeue first. | ||
46 | * | ||
47 | * Finally, if the event subscription is associated with a particular object | ||
48 | * such as a V4L2 control, then that object needs to know about that as well | ||
49 | * so that an event can be raised by that object. So the 'node' field can | ||
50 | * be used to link the v4l2_subscribed_event struct into a list of that | ||
51 | * object. | ||
52 | * | ||
53 | * So to summarize: | ||
54 | * | ||
55 | * struct v4l2_fh has two lists: one of the subscribed events, and one of the | ||
56 | * pending events. | ||
57 | * | ||
58 | * struct v4l2_subscribed_event has a ringbuffer of raised (pending) events of | ||
59 | * that particular type. | ||
60 | * | ||
61 | * If struct v4l2_subscribed_event is associated with a specific object, then | ||
62 | * that object will have an internal list of struct v4l2_subscribed_event so | ||
63 | * it knows who subscribed an event to that object. | ||
64 | */ | ||
65 | |||
32 | struct v4l2_fh; | 66 | struct v4l2_fh; |
33 | struct v4l2_subscribed_event; | 67 | struct v4l2_subscribed_event; |
34 | struct video_device; | 68 | struct video_device; |