diff mbox

for the file gspca/mr97310a.c (Resubmit)

Message ID alpine.LNX.2.00.0903071129420.7903@banach.math.auburn.edu (mailing list archive)
State Accepted
Headers show

Commit Message

kilgota@banach.math.auburn.edu March 7, 2009, 5:41 p.m. UTC
Here is a cleaned-up version of the patch to gspca/mr97310a.c

This patch causes all frame headers in the streaming output of MR97310A 
cameras, instead of being discarded.

Said frame headers contain information which may be useful in processing 
the video output and therefore should be kept and not discarded.

A corresponding patch to the decompression algorithm in 
libv4lconvert/mr97310a.c corrects the change in frame offset.

Signed-off-by: Theodore Kilgore <kilgota@auburn.edu>
----------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- mr97310a.c.orig	2009-02-18 14:40:03.000000000 -0600
+++ mr97310a.c	2009-03-06 15:12:14.000000000 -0600
@@ -29,9 +29,7 @@  MODULE_LICENSE("GPL");
  /* specific webcam descriptor */
  struct sd {
  	struct gspca_dev gspca_dev;  /* !! must be the first item */
-
  	u8 sof_read;
-	u8 header_read;
  };

  /* V4L2 controls supported by the driver */
@@ -285,7 +283,6 @@  static void sd_pkt_scan(struct gspca_dev
  			__u8 *data,                   /* isoc packet */
  			int len)                      /* iso packet length */
  {
-	struct sd *sd = (struct sd *) gspca_dev;
  	unsigned char *sof;

  	sof = pac_find_sof(gspca_dev, data, len);
@@ -300,25 +297,12 @@  static void sd_pkt_scan(struct gspca_dev
  			n = 0;
  		frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
  					data, n);
-		sd->header_read = 0;
-		gspca_frame_add(gspca_dev, FIRST_PACKET, frame, NULL, 0);
+		/* Start next frame. */
+		gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
+			pac_sof_marker, sizeof pac_sof_marker);
  		len -= sof - data;
  		data = sof;
  	}
-	if (sd->header_read < 7) {
-		int needed;
-
-		/* skip the rest of the header */
-		needed = 7 - sd->header_read;
-		if (len <= needed) {
-			sd->header_read += len;
-			return;
-		}
-		data += needed;
-		len -= needed;
-		sd->header_read = 7;
-	}
-
  	gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
  }