aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-event.h
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2011-06-18 06:02:20 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:53:31 -0400
commit2151bdc887acfd6dc2c931b4d3c01f95e30b7df8 (patch)
tree429683c0f6de68971d74fa379cf1dcfe4540c5a3 /include/media/v4l2-event.h
parentf1e393de382af9b9bd2462a42bfa16b8c501d81b (diff)
[media] v4l2-event: add optional merge and replace callbacks
When the event queue for a subscribed event is full, then the oldest event is dropped. It would be nice if the contents of that oldest event could be merged with the next-oldest. That way no information is lost, only intermediate steps are lost. This patch adds optional replace() (called when only one kevent was allocated) and merge() (called when more than one kevent was allocated) callbacks that will be called to do this job. These two callbacks are implemented for the V4L2_EVENT_CTRL event. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/v4l2-event.h')
-rw-r--r--include/media/v4l2-event.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h
index 8d681e5ca552..6da793fa4d34 100644
--- a/include/media/v4l2-event.h
+++ b/include/media/v4l2-event.h
@@ -55,6 +55,12 @@ struct v4l2_subscribed_event {
55 struct v4l2_fh *fh; 55 struct v4l2_fh *fh;
56 /* list node that hooks into the object's event list (if there is one) */ 56 /* list node that hooks into the object's event list (if there is one) */
57 struct list_head node; 57 struct list_head node;
58 /* Optional callback that can replace event 'old' with event 'new'. */
59 void (*replace)(struct v4l2_event *old,
60 const struct v4l2_event *new);
61 /* Optional callback that can merge event 'old' into event 'new'. */
62 void (*merge)(const struct v4l2_event *old,
63 struct v4l2_event *new);
58 /* the number of elements in the events array */ 64 /* the number of elements in the events array */
59 unsigned elems; 65 unsigned elems;
60 /* the index of the events containing the oldest available event */ 66 /* the index of the events containing the oldest available event */