public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: Patrice Chotard <patrice.chotard@sfr.fr>,
	Theodore Kilgore <kilgota@banach.math.auburn.edu>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH]  New Jeilin dual-mode camera support
Date: Thu, 17 Mar 2011 11:28:35 +0100	[thread overview]
Message-ID: <20110317112835.2247810d@tele> (raw)
In-Reply-To: <4D811835.5060303@sfr.fr>

On Wed, 16 Mar 2011 21:06:13 +0100
Patrice Chotard <patrice.chotard@sfr.fr> wrote:

> This patch add a new jeilin dual mode camera support and some
> specific controls settings.

Hi Patrice and Theodore,

Here are somme comments about Patrice's patch.

>  #include <linux/workqueue.h>
> +#include <linux/delay.h>
>  #include <linux/slab.h>

It is not a good idea to use mdelay(): it is a loop. Better use
msleep().

> -	u8 quality;			/* image quality */
> -	u8 jpegqual;			/* webcam quality */
> +	u8 camquality;			/* webcam quality */
> +	u8 jpegquality;			/* jpeg quality */

The webcam (encoding) quality and the jpeg (decoding) quality must be
the same. Then, looking carefully, jpegquality is not used!

> +	u8 freq;
> +	u8 type;
> +	/* below variables are only used for SPORTSCAM_DV15 */
> +	u8 autogain;
> +	u8 cyan;
> +	u8 magenta;
> +	u8 yellow;

You should use the new control mechanism (see stk014, sonixj, zc3xx...).

> +#define V4L2_CID_CAMQUALITY (V4L2_CID_USER_BASE + 1)
> +		.id      = V4L2_CID_CAMQUALITY,
> +		.type    = V4L2_CTRL_TYPE_INTEGER,
> +		.name    = "Image quality",

The JPEG quality must be get/set by the VIDIOC_G_JPEGCOMP /
VIDIOC_S_JPEGCOMP ioctl's.

> +#define V4L2_CID_CYAN_BALANCE (V4L2_CID_USER_BASE + 2)
	[snip]
> +#define V4L2_CID_MAGENTA_BALANCE (V4L2_CID_USER_BASE + 3)
	[snip]
> +#define V4L2_CID_YELLOW_BALANCE (V4L2_CID_USER_BASE + 4)

These values redefine V4L2_CID_SATURATION and V4L2_CID_HUE (user_base +
4 is no more defined). You should use V4L2_CID_RED_BALANCE,
V4L2_CID_BLUE_BALANCE and V4L2_CID_GAIN to set these controls.

> +	if (sd->type == SPORTSCAM_DV15)
> +		start_commands_size = 9;
> +	else
> +		start_commands_size = ARRAY_SIZE(start_commands);

Don't use magic values ('9').

> +			mdelay(start_commands[i].delay);

See above.

BTW, Theodore, as there is no USB command in the loop, there is no need
to have a work queue (look at the SENSOR_OV772x in ov534).

Best regards.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

  reply	other threads:[~2011-03-17 10:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 20:06 [PATCH] New Jeilin dual-mode camera support Patrice Chotard
2011-03-17 10:28 ` Jean-Francois Moine [this message]
2011-03-17 23:32   ` Patrice Chotard
  -- strict thread matches above, loose matches on Subject: below --
2011-03-14 22:27 Patrice Chotard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110317112835.2247810d@tele \
    --to=moinejf@free.fr \
    --cc=kilgota@banach.math.auburn.edu \
    --cc=linux-media@vger.kernel.org \
    --cc=patrice.chotard@sfr.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox