diff options
author | Jim Paris <jim@jtan.com> | 2008-12-04 02:36:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:38:54 -0500 |
commit | 5ea9c4def8154a5be836dd31cbd97f49fd34ea8f (patch) | |
tree | 7e30ff4d8284dde1526570ce9b815473e959934b /drivers/media/video | |
parent | 47dfd21fbf4ba303b5fdfad6f4e110e57990803c (diff) |
V4L/DVB (9859): gspca - ov534: Fix frame size so we don't miss the last pixel.
The frame size is too small, so we lose the last YUYV pixel.
Fix the setup and remove the last_pixel hack.
Signed-off-by: Jim Paris <jim@jtan.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/gspca/ov534.c | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index ee08e30e23c..79bb6241d27 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c | |||
@@ -197,9 +197,9 @@ static const __u8 ov534_reg_initdata[][2] = { | |||
197 | { 0x1d, 0x40 }, | 197 | { 0x1d, 0x40 }, |
198 | { 0x1d, 0x02 }, | 198 | { 0x1d, 0x02 }, |
199 | { 0x1d, 0x00 }, | 199 | { 0x1d, 0x00 }, |
200 | { 0x1d, 0x02 }, | 200 | { 0x1d, 0x02 }, /* frame size 0x025800 * 4 = 614400 */ |
201 | { 0x1d, 0x57 }, | 201 | { 0x1d, 0x58 }, /* frame size */ |
202 | { 0x1d, 0xff }, | 202 | { 0x1d, 0x00 }, /* frame size */ |
203 | 203 | ||
204 | { 0x8d, 0x1c }, | 204 | { 0x8d, 0x1c }, |
205 | { 0x8e, 0x80 }, | 205 | { 0x8e, 0x80 }, |
@@ -409,25 +409,15 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
409 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, | 409 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, |
410 | __u8 *data, int len) | 410 | __u8 *data, int len) |
411 | { | 411 | { |
412 | /* | ||
413 | * The current camera setup doesn't stream the last pixel, so we set it | ||
414 | * to a dummy value | ||
415 | */ | ||
416 | __u8 last[4] = { 0, 0, 0, 0 }; | ||
417 | int framesize = frame->v4l2_buf.length; | 412 | int framesize = frame->v4l2_buf.length; |
418 | 413 | ||
419 | PDEBUG(D_PACK, ""); | 414 | if (len == framesize) { |
420 | PDEBUG(D_PACK, "** packet len = %d, framesize = %d", len, framesize); | 415 | frame = gspca_frame_add(gspca_dev, FIRST_PACKET, frame, |
421 | PDEBUG(D_PACK, "** frame->data_end - frame->data + len = %d", | 416 | data, len); |
422 | frame->data_end - frame->data + len); | 417 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0); |
423 | |||
424 | if (frame->data_end - frame->data + len == framesize - 4) { | ||
425 | PDEBUG(D_PACK, " end of frame!"); | ||
426 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); | ||
427 | frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, last, 4); | ||
428 | gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, 0); | ||
429 | } else | 418 | } else |
430 | gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len); | 419 | PDEBUG(D_PACK, "packet len = %d, framesize = %d", len, |
420 | framesize); | ||
431 | } | 421 | } |
432 | 422 | ||
433 | /* sub-driver description */ | 423 | /* sub-driver description */ |