[PATCH] cx88: fix unexpected video resize when setting tv norm

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

 



# HG changeset patch
# User Marton Balint <cus@xxxxxxxxxx>
# Date 1231614067 -3600
# Node ID 571b3176dc82a7206ade1274b9e1dcd4d8bbe4f1
# Parent  985ecd81d993b4473cb644a4c1f9e36b840cef0b
cx88: fix unexpected video resize when setting tv norm

From: Marton Balint <cus@xxxxxxxxxx>

Cx88_set_tvnorm sets the size of the video to fixed 320x240. This is ugly at
least, but also can cause problems, if it happens during an active video
transfer. With this patch, cx88_set_scale will save the last requested video
size, and cx88_set_tvnorm will scale the video to this size.

Priority: normal

Signed-off-by: Marton Balint <cus@xxxxxxxxxx>

diff -r 985ecd81d993 -r 571b3176dc82 linux/drivers/media/video/cx88/cx88-cards.c
--- a/linux/drivers/media/video/cx88/cx88-cards.c	Fri Jan 09 10:07:07 2009 -0200
+++ b/linux/drivers/media/video/cx88/cx88-cards.c	Sat Jan 10 20:01:07 2009 +0100
@@ -3176,6 +3176,10 @@
 	info_printk(core, "TV tuner type %d, Radio tuner type %d\n",
 		    core->board.tuner_type, core->board.radio_type);
 
+	core->last_width = 320;
+	core->last_height = 240;
+	core->last_field = V4L2_FIELD_INTERLACED;
+
 	/* init hardware */
 	cx88_reset(core);
 	cx88_card_setup_pre_i2c(core);
diff -r 985ecd81d993 -r 571b3176dc82 linux/drivers/media/video/cx88/cx88-core.c
--- a/linux/drivers/media/video/cx88/cx88-core.c	Fri Jan 09 10:07:07 2009 -0200
+++ b/linux/drivers/media/video/cx88/cx88-core.c	Sat Jan 10 20:01:07 2009 +0100
@@ -715,6 +715,10 @@
 	unsigned int sheight = norm_maxh(core->tvnorm);
 	u32 value;
 
+	core->last_width = width;
+	core->last_height = height;
+	core->last_field = field;
+
 	dprintk(1,"set_scale: %dx%d [%s%s,%s]\n", width, height,
 		V4L2_FIELD_HAS_TOP(field)    ? "T" : "",
 		V4L2_FIELD_HAS_BOTTOM(field) ? "B" : "",
@@ -1014,7 +1018,7 @@
 	cx_write(MO_VBI_PACKET, (10<<11) | norm_vbipack(norm));
 
 	// this is needed as well to set all tvnorm parameter
-	cx88_set_scale(core, 320, 240, V4L2_FIELD_INTERLACED);
+	cx88_set_scale(core, core->last_width, core->last_height, core->last_field);
 
 	// audio
 	set_tvaudio(core);
diff -r 985ecd81d993 -r 571b3176dc82 linux/drivers/media/video/cx88/cx88.h
--- a/linux/drivers/media/video/cx88/cx88.h	Fri Jan 09 10:07:07 2009 -0200
+++ b/linux/drivers/media/video/cx88/cx88.h	Sat Jan 10 20:01:07 2009 +0100
@@ -352,6 +352,9 @@
 	u32                        input;
 	u32                        astat;
 	u32			   use_nicam;
+	unsigned int		   last_width;
+	unsigned int		   last_height;
+	enum v4l2_field		   last_field;
 
 	/* IR remote control state */
 	struct cx88_IR             *ir;
--
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