Re: [PATCH] ov772x: add support S_CROP operation.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 23 Jan 2009, Kuninori Morimoto wrote:

> ov772x_set_fmt had returned NULL when pixfmt is 0,
> although it mean only geometry change.
> This patch modify this problem.
> 
> Signed-off-by: Kuninori Morimoto <morimoto.kuninori@xxxxxxxxxxx>
> ---
>  drivers/media/video/ov772x.c |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c
> index 681a11b..30eb80e 100644
> --- a/drivers/media/video/ov772x.c
> +++ b/drivers/media/video/ov772x.c
> @@ -792,12 +792,15 @@ static int ov772x_set_fmt(struct soc_camera_device *icd,
>  
>  	/*
>  	 * select format
> +	 * when pixfmt is 0, only geometry change
>  	 */
> -	priv->fmt = NULL;
> -	for (i = 0; i < ARRAY_SIZE(ov772x_cfmts); i++) {
> -		if (pixfmt == ov772x_cfmts[i].fourcc) {
> -			priv->fmt = ov772x_cfmts + i;
> -			break;
> +	if (pixfmt) {
> +		priv->fmt = NULL;
> +		for (i = 0; i < ARRAY_SIZE(ov772x_cfmts); i++) {
> +			if (pixfmt == ov772x_cfmts[i].fourcc) {
> +				priv->fmt = ov772x_cfmts + i;
> +				break;
> +			}
>  		}
>  	}
>  	if (!priv->fmt)

Have you tested with v4l-dvb/v4l2-apps/test/capture_example.c? I think it 
wouldn't work, because it first calls S_CROP, and then S_FMT, and even 
with this your patch you'd fail S_CROP if S_FMT hadn't been called before 
(priv->fmt == NULL). Am I right? 

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux