[V4L] Video capture patch

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



Hello.

I am investigating the question of capturing movies with bt878 card. I often 
come over the video cassettes which seem to be 'uncaptureable' - they produce 
high frame drop rates when capturing at 25 fps, even in low resolutions. This 
happens both in Windows and in Linux with bttv driver. 
I made a short research of driver work and found out that skipping several 
last lines of data in RISC program resolves the problem. It seems that I 
can't do it with available options & ioctls, so I wrote a patch ( it is 
attached ). It's for 0.7.39. Maybe it can be imported into mainstream driver? 
It adds new bttv.o module option "cropfield". For two 'uncaptureable' 
cassettes I've got right now, capturing with original driver drops 30-50% of 
frames, but when I insert module with option "cropfield=1", frame drop goes to 
zero.

--
Best regards,
Eugene
--- driver/bttv-driver.c	Tue Aug 15 22:29:15 2000
+++ driver/bttv-driver.c~	Wed Sep  6 07:57:05 2000
@@ -72,7 +72,7 @@
 MODULE_PARM(bttv_debug,"i");
 MODULE_PARM(gbuffers,"i");
 MODULE_PARM(gbufsize,"i");
-
+MODULE_PARM(cropfield,"i");
 MODULE_DESCRIPTION("bttv - v4l driver module for bt848/878 based cards");
 MODULE_AUTHOR("Ralph  Metzler & Marcus Metzler & Gerd Knorr");
 
@@ -86,6 +86,8 @@
 static unsigned int fieldnr = 0;
 static unsigned int gbuffers = 2;
 static unsigned int gbufsize = BTTV_MAX_FBUF;
+
+static unsigned int cropfield = 0;
 unsigned int bttv_debug = 0;
 unsigned int bttv_verbose = 1;
 
@@ -643,6 +645,10 @@
 	*(re++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM3);
         *(re++)=0;
   
+  	if(height>cropfield)
+	    height-=cropfield;
+	else
+	    height=0;
 	for (line=0; line < (height<<(1^inter)); line++)
 	{
 		if(line==height)
@@ -735,6 +741,10 @@
 	*(re++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1);
         *(re++)=cpu_to_le32(0);
   
+	if(height>cropfield)
+	    height-=cropfield;
+	else
+	    height=0;
 	for (line=0; line < (height<<(1^inter)); line++)
 	{
 	        if (inter) 
@@ -906,6 +916,12 @@
         *(re++)=cpu_to_le32(0);
 	
 	/* translate bitmap to risc code */
+	
+	if(height>cropfield)
+	    height-=cropfield;
+	else
+	    height=0;
+
         for (line=outofmem=0; line < (height<<inter) && !outofmem; line++)
         {
 		y = line>>inter;

[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux