Hi Laurent,

Thanks for the set!

On Mon, May 16, 2016 at 01:02:12PM +0300, Laurent Pinchart wrote:
> Signed-off-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
> ---
>  yavta.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/yavta.c b/yavta.c
> index 4b531a0360fe..d0bcf7f19c7b 100644
> --- a/yavta.c
> +++ b/yavta.c
> @@ -1225,6 +1225,30 @@ static int video_parse_control_array(const struct 
> v4l2_query_ext_ctrl *query,
>  
>       for ( ; isspace(*val); ++val) { };
>  
> +     if (*val == '<') {
> +             /* Read the control value from the given file. */
> +             ssize_t size;
> +             int fd;
> +
> +             val++;
> +             fd = open(val, O_RDONLY);
> +             if (fd < 0) {
> +                     printf("unable to open control file `%s'\n", val);
> +                     return -EINVAL;
> +             }
> +
> +             size = read(fd, ctrl->ptr, ctrl->size);
> +             if (size != (ssize_t)ctrl->size) {
> +                     printf("error reading control file `%s' (%s)\n", val,
> +                            strerror(errno));
> +                     close(fd);
> +                     return -EINVAL;
> +             }
> +
> +             close(fd);
> +             return 0;
> +     }
> +
>       if (*val++ != '{')
>               return -EINVAL;
>  

How about adding a new command line option to read the value from a file? I
think that'd be cleaner. I'd also add support for writing binary values to a
file, that would be quite convenient. Write support could be done later as
well.

For patches 1--3:

Acked-by: Sakari Ailus <sakari.ai...@linux.intel.com>

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi     XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to