diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-13 14:09:14 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:39 -0400 |
commit | b4916f8ca1da71bb97fb6dcf1e8da3f9c64cf80e (patch) | |
tree | c71e97aa170b066fedefd2d13326041181346b54 /drivers/media/video | |
parent | dbecb44c11d9517d604240b53581951ac4e3b5e6 (diff) |
V4L/DVB (7564): em28xx: Some fixes to display logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 31 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 3 |
2 files changed, 19 insertions, 15 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 10928dccaecc..d5728c2cd360 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -365,32 +365,33 @@ static inline int em28xx_isoc_copy(struct urb *urb) | |||
365 | /* FIXME: incomplete buffer checks where removed to make | 365 | /* FIXME: incomplete buffer checks where removed to make |
366 | logic simpler. Impacts of those changes should be evaluated | 366 | logic simpler. Impacts of those changes should be evaluated |
367 | */ | 367 | */ |
368 | if (p[0] == 0x33 && p[1] == 0x95 && p[2] == 0x00) { | ||
369 | em28xx_isocdbg("VBI HEADER!!!\n"); | ||
370 | /* FIXME: Should add vbi copy */ | ||
371 | continue; | ||
372 | } | ||
368 | if (p[0] == 0x22 && p[1] == 0x5a) { | 373 | if (p[0] == 0x22 && p[1] == 0x5a) { |
369 | em28xx_isocdbg("Video frame %d, length=%i, %s\n", p[2], | 374 | em28xx_isocdbg("Video frame %d, length=%i, %s\n", p[2], |
370 | len, (p[2] & 1)? "odd" : "even"); | 375 | len, (p[2] & 1)? "odd" : "even"); |
371 | 376 | ||
372 | if (p[2] & 1) | 377 | if (p[2] & 1) |
373 | buf->top_field = 0; | 378 | buf->top_field = 0; |
374 | else { | 379 | else |
375 | if (buf->receiving) { | ||
376 | buffer_filled(dev, dma_q, buf); | ||
377 | rc = get_next_buf(dma_q, &buf); | ||
378 | if (rc <= 0) | ||
379 | return rc; | ||
380 | outp = videobuf_to_vmalloc(&buf->vb); | ||
381 | } | ||
382 | |||
383 | buf->top_field = 1; | 380 | buf->top_field = 1; |
381 | |||
382 | // if (dev->isoc_ctl.last_field && !buf->top_field) { | ||
383 | if (dev->isoc_ctl.last_field != buf->top_field) { | ||
384 | buffer_filled(dev, dma_q, buf); | ||
385 | rc = get_next_buf(dma_q, &buf); | ||
386 | if (rc <= 0) | ||
387 | return rc; | ||
388 | outp = videobuf_to_vmalloc(&buf->vb); | ||
384 | } | 389 | } |
385 | buf->receiving = 1; | 390 | dev->isoc_ctl.last_field = buf->top_field; |
391 | |||
386 | dma_q->pos = 0; | 392 | dma_q->pos = 0; |
387 | } else if (p[0] == 0x33 && p[1] == 0x95 && p[2] == 0x00) { | ||
388 | em28xx_isocdbg("VBI HEADER!!!\n"); | ||
389 | } | 393 | } |
390 | |||
391 | em28xx_copy_video(dev, dma_q, buf, p, outp, len); | 394 | em28xx_copy_video(dev, dma_q, buf, p, outp, len); |
392 | |||
393 | /* FIXME: Should add vbi copy */ | ||
394 | } | 395 | } |
395 | return rc; | 396 | return rc; |
396 | } | 397 | } |
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 6d62357a038f..993c1ed05cc3 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -114,6 +114,9 @@ struct em28xx_usb_isoc_ctl { | |||
114 | /* Stores already requested buffers */ | 114 | /* Stores already requested buffers */ |
115 | struct em28xx_buffer *buf; | 115 | struct em28xx_buffer *buf; |
116 | 116 | ||
117 | /* Store last filled frame */ | ||
118 | int last_field; | ||
119 | |||
117 | /* Stores the number of received fields */ | 120 | /* Stores the number of received fields */ |
118 | int nfields; | 121 | int nfields; |
119 | }; | 122 | }; |