Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357144
b: refs/heads/master
c: 0455eeb
h: refs/heads/master
v: v3
  • Loading branch information
Frank Schaefer authored and Mauro Carvalho Chehab committed Dec 22, 2012
1 parent 0dca83e commit 65b2c55
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3610f58bb1d545fe3f3767ec8ca3251383e9c728
refs/heads/master: 0455eebfbd6c286552f9d98bdc6614dfbdd63682
26 changes: 10 additions & 16 deletions trunk/drivers/media/usb/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ static inline int em28xx_urb_data_copy_vbi(struct em28xx *dev, struct urb *urb)
dev->capture_type = 0;
dev->vbi_read = 0;
em28xx_isocdbg("VBI START HEADER!!!\n");
dev->cur_field = p[2];
dev->top_field = !(p[2] & 1);
p += 4;
len -= 4;
} else if (p[0] == 0x88 && p[1] == 0x88 &&
Expand All @@ -603,6 +603,8 @@ static inline int em28xx_urb_data_copy_vbi(struct em28xx *dev, struct urb *urb)
len -= 4;
} else if (p[0] == 0x22 && p[1] == 0x5a) {
/* start video */
dev->capture_type = 1;
dev->top_field = !(p[2] & 1);
p += 4;
len -= 4;
}
Expand All @@ -619,8 +621,7 @@ static inline int em28xx_urb_data_copy_vbi(struct em28xx *dev, struct urb *urb)
em28xx_isocdbg("dev->vbi_read > vbi_size\n");
} else if ((dev->vbi_read + len) < vbi_size) {
/* This entire frame is VBI data */
if (dev->vbi_read == 0 &&
(!(dev->cur_field & 1))) {
if (dev->vbi_read == 0 && dev->top_field) {
/* Brand new frame */
if (vbi_buf != NULL)
vbi_buffer_filled(dev,
Expand All @@ -636,12 +637,8 @@ static inline int em28xx_urb_data_copy_vbi(struct em28xx *dev, struct urb *urb)

if (dev->vbi_read == 0) {
vbi_dma_q->pos = 0;
if (vbi_buf != NULL) {
if (dev->cur_field & 1)
vbi_buf->top_field = 0;
else
vbi_buf->top_field = 1;
}
if (vbi_buf != NULL)
vbi_buf->top_field = dev->top_field;
}

dev->vbi_read += len;
Expand All @@ -662,7 +659,7 @@ static inline int em28xx_urb_data_copy_vbi(struct em28xx *dev, struct urb *urb)

if (dev->capture_type == 1) {
dev->capture_type = 2;
if (dev->progressive || !(dev->cur_field & 1)) {
if (dev->progressive || dev->top_field) {
if (buf != NULL)
buffer_filled(dev, dma_q, buf);
get_next_buf(dma_q, &buf);
Expand All @@ -671,12 +668,8 @@ static inline int em28xx_urb_data_copy_vbi(struct em28xx *dev, struct urb *urb)
else
outp = videobuf_to_vmalloc(&buf->vb);
}
if (buf != NULL) {
if (dev->cur_field & 1)
buf->top_field = 0;
else
buf->top_field = 1;
}
if (buf != NULL)
buf->top_field = dev->top_field;

dma_q->pos = 0;
}
Expand Down Expand Up @@ -774,6 +767,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
urb_init = 1;

if (urb_init) {
dev->capture_type = -1;
if (em28xx_vbi_supported(dev) == 1)
rc = em28xx_init_usb_xfer(dev, EM28XX_ANALOG_MODE,
dev->analog_xfer_bulk,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/usb/em28xx/em28xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ struct em28xx {
/* vbi related state tracking */
int capture_type;
int vbi_read;
unsigned char cur_field;
unsigned char top_field:1;
unsigned int vbi_width;
unsigned int vbi_height; /* lines per field */

Expand Down

0 comments on commit 65b2c55

Please sign in to comment.