aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTheodore Kilgore <kilgota@auburn.edu>2009-03-13 12:04:31 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:20 -0400
commit9832d765f82769799ba15ac9d2e8edf8f7de6898 (patch)
treed4b63f69efe28d996ddcea2f78ce15d1a8903743 /drivers
parent9f9cd8f18c7faabf6dc144c198f6ee30429d3da0 (diff)
V4L/DVB (10986): mr97310a: don't discard frame headers on stream output
Fix a bug where all frame headers were being discarded, instead of being part of the stream output, on MR97310A cameras. The 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> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/mr97310a.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/media/video/gspca/mr97310a.c b/drivers/media/video/gspca/mr97310a.c
index 5ec5ce6e3ed9..2a901a4a6f00 100644
--- a/drivers/media/video/gspca/mr97310a.c
+++ b/drivers/media/video/gspca/mr97310a.c
@@ -29,9 +29,7 @@ MODULE_LICENSE("GPL");
29/* specific webcam descriptor */ 29/* specific webcam descriptor */
30struct sd { 30struct sd {
31 struct gspca_dev gspca_dev; /* !! must be the first item */ 31 struct gspca_dev gspca_dev; /* !! must be the first item */
32
33 u8 sof_read; 32 u8 sof_read;
34 u8 header_read;
35}; 33};
36 34
37/* V4L2 controls supported by the driver */ 35/* V4L2 controls supported by the driver */
@@ -285,7 +283,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
285 __u8 *data, /* isoc packet */ 283 __u8 *data, /* isoc packet */
286 int len) /* iso packet length */ 284 int len) /* iso packet length */
287{ 285{
288 struct sd *sd = (struct sd *) gspca_dev;
289 unsigned char *sof; 286 unsigned char *sof;
290 287
291 sof = pac_find_sof(gspca_dev, data, len); 288 sof = pac_find_sof(gspca_dev, data, len);
@@ -300,25 +297,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
300 n = 0; 297 n = 0;
301 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, 298 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
302 data, n); 299 data, n);
303 sd->header_read = 0; 300 /* Start next frame. */
304 gspca_frame_add(gspca_dev, FIRST_PACKET, frame, NULL, 0); 301 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
302 pac_sof_marker, sizeof pac_sof_marker);
305 len -= sof - data; 303 len -= sof - data;
306 data = sof; 304 data = sof;
307 } 305 }
308 if (sd->header_read < 7) {
309 int needed;
310
311 /* skip the rest of the header */
312 needed = 7 - sd->header_read;
313 if (len <= needed) {
314 sd->header_read += len;
315 return;
316 }
317 data += needed;
318 len -= needed;
319 sd->header_read = 7;
320 }
321
322 gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); 306 gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
323} 307}
324 308