public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: gscpa stv06xx + ov518: dont discard every other frame
@ 2009-10-04 15:41 Hans de Goede
  2009-10-04 16:24 ` Erik Andrén
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2009-10-04 15:41 UTC (permalink / raw)
  To: Jean-Francois Moine
  Cc: James Blanford, Erik Andrén, Linux Media Mailing List

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

Hi,

As noticed by James Blanford <jhblanford@gmail.com>, we were discarding
every other frame in stv06xx and the ov518 (part of ov519.c) drivers.

When we call gspca_frame_add, it returns a pointer to the frame passed in,
unless we call it with LAST_PACKET, when it will return a pointer to a
new frame in which to store the frame data for the next frame. So whenever
calling:
gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, len);
we should do this as:
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, len);

So that any further data got from of the pkt we are handling in pkt_scan, goes
to the next frame.

We are not doing this in stv06xx.c pkt_scan method, which the cause of what
James is seeing. So I started checking all drivers, and we are not doing this
either in ov519.c when handling an ov518 bridge. So now the framerate of my
3 ov518 test cams has just doubled. Thanks James!

The attached patch fixes this.

Regards,

Hans

[-- Attachment #2: gspca-dont-discard-every-other-frame.patch --]
[-- Type: text/plain, Size: 1164 bytes --]

diff -r 5ad36b0c0e90 linux/drivers/media/video/gspca/ov519.c
--- a/linux/drivers/media/video/gspca/ov519.c	Sun Oct 04 16:23:04 2009 +0200
+++ b/linux/drivers/media/video/gspca/ov519.c	Sun Oct 04 17:26:43 2009 +0200
@@ -2939,7 +2939,7 @@
 	/* A false positive here is likely, until OVT gives me
 	 * the definitive SOF/EOF format */
 	if ((!(data[0] | data[1] | data[2] | data[3] | data[5])) && data[6]) {
-		gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0);
+		frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0);
 		gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, 0);
 		sd->packet_nr = 0;
 	}
diff -r 5ad36b0c0e90 linux/drivers/media/video/gspca/stv06xx/stv06xx.c
--- a/linux/drivers/media/video/gspca/stv06xx/stv06xx.c	Sun Oct 04 16:23:04 2009 +0200
+++ b/linux/drivers/media/video/gspca/stv06xx/stv06xx.c	Sun Oct 04 17:26:43 2009 +0200
@@ -394,7 +394,7 @@
 			PDEBUG(D_PACK, "End of frame detected");
 
 			/* Complete the last frame (if any) */
-			gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0);
+			frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0);
 
 			if (chunk_len)
 				PDEBUG(D_ERR, "Chunk length is "

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: gscpa stv06xx + ov518: dont discard every other frame
  2009-10-04 15:41 PATCH: gscpa stv06xx + ov518: dont discard every other frame Hans de Goede
@ 2009-10-04 16:24 ` Erik Andrén
  0 siblings, 0 replies; 2+ messages in thread
From: Erik Andrén @ 2009-10-04 16:24 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Jean-Francois Moine, James Blanford, Linux Media Mailing List

2009/10/4 Hans de Goede <hdegoede@redhat.com>:
> Hi,
>
> As noticed by James Blanford <jhblanford@gmail.com>, we were discarding
> every other frame in stv06xx and the ov518 (part of ov519.c) drivers.
>
> When we call gspca_frame_add, it returns a pointer to the frame passed in,
> unless we call it with LAST_PACKET, when it will return a pointer to a
> new frame in which to store the frame data for the next frame. So whenever
> calling:
> gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, len);
> we should do this as:
> frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, len);
>
> So that any further data got from of the pkt we are handling in pkt_scan,
> goes
> to the next frame.
>
> We are not doing this in stv06xx.c pkt_scan method, which the cause of what
> James is seeing. So I started checking all drivers, and we are not doing
> this
> either in ov519.c when handling an ov518 bridge. So now the framerate of my
> 3 ov518 test cams has just doubled. Thanks James!
>
What a great discovery!  \o/

Regards,
Erik

> The attached patch fixes this.
>
> Regards,
>
> Hans
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-04 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-04 15:41 PATCH: gscpa stv06xx + ov518: dont discard every other frame Hans de Goede
2009-10-04 16:24 ` Erik Andrén

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