Hi Hans,

On Friday 07 January 2011 13:47:33 Hans Verkuil wrote:
> Drivers can use the has_new field to determine if a new value was specified
> for a control. The v4l2_ctrl_handler_setup() must always set this to 1
> since the setup has to force a full update of all controls.

According to include/media/v4l2-ctrls.h, has_new is a "Internal flag: set when 
there is a valid new value". Drivers should then not use it.

If you want to use the flag in a driver, the comment should be changed and its 
usage should be documented in Documentation/video4linux/v4l2-controls.txt.

> Signed-off-by: Hans Verkuil <[email protected]>
> ---
>  drivers/media/video/v4l2-ctrls.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/video/v4l2-ctrls.c
> b/drivers/media/video/v4l2-ctrls.c index 8f81efc..64f56bb 100644
> --- a/drivers/media/video/v4l2-ctrls.c
> +++ b/drivers/media/video/v4l2-ctrls.c
> @@ -1280,8 +1280,10 @@ int v4l2_ctrl_handler_setup(struct v4l2_ctrl_handler
> *hdl) if (ctrl->done)
>                       continue;
> 
> -             for (i = 0; i < master->ncontrols; i++)
> +             for (i = 0; i < master->ncontrols; i++) {
>                       cur_to_new(master->cluster[i]);
> +                     master->cluster[i]->has_new = 1;
> +             }
> 
>               /* Skip button controls and read-only controls. */
>               if (ctrl->type == V4L2_CTRL_TYPE_BUTTON ||

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to