Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306424
b: refs/heads/master
c: 6e6d76c
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed May 15, 2012
1 parent 1bb03bd commit 54e4e0f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 69ecdbac144147a80747914d9b6ea3472e2d93e7
refs/heads/master: 6e6d76cdc541e28bf4f609141d76c488c6c0d263
5 changes: 4 additions & 1 deletion trunk/drivers/media/video/uvc/uvc_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ static void uvc_ctrl_send_events(struct uvc_fh *handle,
}
}

static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev)
static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev, unsigned elems)
{
struct uvc_fh *handle = container_of(sev->fh, struct uvc_fh, vfh);
struct uvc_control_mapping *mapping;
Expand Down Expand Up @@ -1278,6 +1278,9 @@ static int uvc_ctrl_add_event(struct v4l2_subscribed_event *sev)

uvc_ctrl_fill_event(handle->chain, &ev, ctrl, mapping, val,
changes);
/* Mark the queue as active, allowing this initial
event to be accepted. */
sev->elems = elems;
v4l2_event_queue_fh(sev->fh, &ev);
}

Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/media/video/v4l2-ctrls.c
Original file line number Diff line number Diff line change
Expand Up @@ -2559,7 +2559,7 @@ int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val)
}
EXPORT_SYMBOL(v4l2_ctrl_s_ctrl);

static int v4l2_ctrl_add_event(struct v4l2_subscribed_event *sev)
static int v4l2_ctrl_add_event(struct v4l2_subscribed_event *sev, unsigned elems)
{
struct v4l2_ctrl *ctrl = v4l2_ctrl_find(sev->fh->ctrl_handler, sev->id);

Expand All @@ -2576,6 +2576,9 @@ static int v4l2_ctrl_add_event(struct v4l2_subscribed_event *sev)
if (!(ctrl->flags & V4L2_CTRL_FLAG_WRITE_ONLY))
changes |= V4L2_EVENT_CTRL_CH_VALUE;
fill_event(&ev, ctrl, changes);
/* Mark the queue as active, allowing this initial
event to be accepted. */
sev->elems = elems;
v4l2_event_queue_fh(sev->fh, &ev);
}
v4l2_ctrl_unlock(ctrl);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/v4l2-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ int v4l2_event_subscribe(struct v4l2_fh *fh,
}

if (sev->ops && sev->ops->add) {
int ret = sev->ops->add(sev);
int ret = sev->ops->add(sev, elems);
if (ret) {
sev->ops = NULL;
v4l2_event_unsubscribe(fh, sub);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/media/v4l2-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ struct v4l2_kevent {
* @merge: Optional callback that can merge event 'old' into event 'new'.
*/
struct v4l2_subscribed_event_ops {
int (*add)(struct v4l2_subscribed_event *sev);
int (*add)(struct v4l2_subscribed_event *sev, unsigned elems);
void (*del)(struct v4l2_subscribed_event *sev);
void (*replace)(struct v4l2_event *old, const struct v4l2_event *new);
void (*merge)(const struct v4l2_event *old, struct v4l2_event *new);
Expand Down

0 comments on commit 54e4e0f

Please sign in to comment.