Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62281
b: refs/heads/master
c: a46c5fb
h: refs/heads/master
i:
  62279: 880b852
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 20, 2007
1 parent ab47b2d commit 4f3503e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 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: 3d58ffe2aa107df6db57f875dba5368960b17cde
refs/heads/master: a46c5fbc6912c4e34cb7ded314249b639dc244a6
19 changes: 14 additions & 5 deletions trunk/drivers/media/video/v4l2-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,16 +939,25 @@ int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qc
When no more controls are available 0 is returned. */
u32 v4l2_ctrl_next(const u32 * const * ctrl_classes, u32 id)
{
u32 ctrl_class;
u32 ctrl_class = V4L2_CTRL_ID2CLASS(id);
const u32 *pctrl;

/* if no query is desired, then just return the control ID */
if ((id & V4L2_CTRL_FLAG_NEXT_CTRL) == 0)
return id;
if (ctrl_classes == NULL)
return 0;

/* if no query is desired, then check if the ID is part of ctrl_classes */
if ((id & V4L2_CTRL_FLAG_NEXT_CTRL) == 0) {
/* find class */
while (*ctrl_classes && V4L2_CTRL_ID2CLASS(**ctrl_classes) != ctrl_class)
ctrl_classes++;
if (*ctrl_classes == NULL)
return 0;
pctrl = *ctrl_classes;
/* find control ID */
while (*pctrl && *pctrl != id) pctrl++;
return *pctrl ? id : 0;
}
id &= V4L2_CTRL_ID_MASK;
ctrl_class = V4L2_CTRL_ID2CLASS(id);
id++; /* select next control */
/* find first class that matches (or is greater than) the class of
the ID */
Expand Down

0 comments on commit 4f3503e

Please sign in to comment.