public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* PAtch: gspca-sonixb-ov6650-expo-clamp.patch
@ 2008-07-16 15:10 Hans de Goede
  0 siblings, 0 replies; only message in thread
From: Hans de Goede @ 2008-07-16 15:10 UTC (permalink / raw)
  To: Jean-Francois Moine; +Cc: video4linux-list

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

Hi,

This patches fixing oscilating in daylight with clouds with the sonixb driver
in combination with the ov6650 sensor.

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

Regards,

Hans

[-- Attachment #2: gspca-sonixb-ov6650-expo-clamp.patch --]
[-- Type: text/plain, Size: 1477 bytes --]

This patches fixing oscilating in daylight with clouds with the sonixb driver
in combination with the ov6650 sensor.

Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>

diff -r 086f909be17c linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c	Wed Jul 16 15:29:31 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c	Wed Jul 16 17:07:37 2008 +0200
@@ -712,8 +712,13 @@
 		/* frame exposure time in ms = 1000 * reg11 / 30    ->
 		reg10 = sd->exposure * 2 * reg10_max / (1000 * reg11 / 30) */
 		reg10 = (sd->exposure * 60 * reg10_max) / (1000 * reg11);
-		if (reg10 < 1) /* 0 is a valid value, but is very _black_ */
-			reg10 = 1;
+		
+		/* Don't allow this to get below 10 when using autogain, the
+		   steps become very large (relatively) when below 10 causing
+		   the image to oscilate from much too dark, to much too bright
+		   and back again. */
+		if (sd->autogain && reg10 < 10)
+			reg10 = 10;
 		else if (reg10 > reg10_max)
 			reg10 = reg10_max;
 
@@ -796,8 +801,11 @@
 		sd->autogain_ignore_frames--;
 	else if (gspca_auto_gain_n_exposure(gspca_dev, avg_lum,
 			sd->brightness * DESIRED_AVG_LUM / 127,
-			AUTOGAIN_DEADZONE, GAIN_KNEE, EXPOSURE_KNEE))
+			AUTOGAIN_DEADZONE, GAIN_KNEE, EXPOSURE_KNEE)) {
+		PDEBUG(D_FRAM, "autogain: gain changed: gain: %d expo: %d\n",
+			(int)sd->gain, (int)sd->exposure);
 		sd->autogain_ignore_frames = AUTOGAIN_IGNORE_FRAMES;
+	}
 }
 
 /* this function is called at probe time */

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-16 15:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-16 15:10 PAtch: gspca-sonixb-ov6650-expo-clamp.patch Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox