[media] v4l2-event: add optional merge and replace callbacks
authorHans Verkuil <hans.verkuil@cisco.com>
Sat, 18 Jun 2011 10:02:20 +0000 (07:02 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:53:31 +0000 (17:53 -0300)
commit2151bdc887acfd6dc2c931b4d3c01f95e30b7df8
tree429683c0f6de68971d74fa379cf1dcfe4540c5a3
parentf1e393de382af9b9bd2462a42bfa16b8c501d81b
[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>
drivers/media/video/v4l2-event.c
include/media/v4l2-event.h