diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2011-07-05 12:09:26 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 22:55:38 +0200 |
commit | 639884a6d94ffa16d76b131a55f65748ca0c94f2 (patch) | |
tree | cd316d1dddb8fd144e6463bc41023a91523d2292 /drivers/media/video/v4l2-ctrls.c | |
parent | [media] v4l2-ctrls.c: copy-and-paste error: user_to_new -> new_to_user (diff) | |
download | linux-639884a6d94ffa16d76b131a55f65748ca0c94f2.tar.xz linux-639884a6d94ffa16d76b131a55f65748ca0c94f2.zip |
[media] v4l2-ctrls: always send an event if a control changed implicitly
By default no control events are sent to the application that caused the
control value or flags change (i.e. the control(s) passed to VIDIOC_S_CTRL
or VIDIOC_S_EXT_CTRLS). But if a change in one control causes a change in
another control that was not part of the control(s) in VIDIOC_S_CTRL or
S_EXT_CTRLS, then the application should be notified.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-ctrls.c')
-rw-r--r-- | drivers/media/video/v4l2-ctrls.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index 1f84b9676f10..0e8a28f37af9 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -712,10 +712,15 @@ static void new_to_cur(struct v4l2_fh *fh, struct v4l2_ctrl *ctrl, if (!is_cur_manual(ctrl->cluster[0])) ctrl->flags |= V4L2_CTRL_FLAG_INACTIVE; } - if (changed || update_inactive) + if (changed || update_inactive) { + /* If a control was changed that was not one of the controls + modified by the application, then send the event to all. */ + if (!ctrl->is_new) + fh = NULL; send_event(fh, ctrl, (changed ? V4L2_EVENT_CTRL_CH_VALUE : 0) | (update_inactive ? V4L2_EVENT_CTRL_CH_FLAGS : 0)); + } } /* Copy the current value to the new value */ |