Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357153
b: refs/heads/master
c: e04c00d
h: refs/heads/master
i:
  357151: 8f299f2
v: v3
  • Loading branch information
Frank Schaefer authored and Mauro Carvalho Chehab committed Dec 22, 2012
1 parent 3c1ac2e commit 7231b8c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 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: 4078d625c9610a362f571f7e5ff2521adadfff2b
refs/heads/master: e04c00d985c62a6e1cc6c8048308f3216442f708
45 changes: 25 additions & 20 deletions trunk/drivers/media/usb/em28xx/em28xx-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,27 @@ static inline struct em28xx_buffer *get_next_buf(struct em28xx *dev,
return buf;
}

/*
* Finish the current buffer if completed and prepare for the next field
*/
static struct em28xx_buffer *
finish_field_prepare_next(struct em28xx *dev,
struct em28xx_buffer *buf,
struct em28xx_dmaqueue *dma_q)
{
if (dev->progressive || dev->top_field) { /* Brand new frame */
if (buf != NULL)
finish_buffer(dev, buf);
buf = get_next_buf(dev, dma_q);
}
if (buf != NULL) {
buf->top_field = dev->top_field;
buf->pos = 0;
}

return buf;
}

/* Processes and copies the URB data content (video and VBI data) */
static inline int em28xx_urb_data_copy(struct em28xx *dev, struct urb *urb)
{
Expand Down Expand Up @@ -448,17 +469,9 @@ static inline int em28xx_urb_data_copy(struct em28xx *dev, struct urb *urb)
* have no continuation header */

if (dev->capture_type == 0) {
vbi_buf = finish_field_prepare_next(dev, vbi_buf, vbi_dma_q);
dev->usb_ctl.vbi_buf = vbi_buf;
dev->capture_type = 1;
if (dev->top_field) { /* Brand new frame */
if (vbi_buf != NULL)
finish_buffer(dev, vbi_buf);
vbi_buf = get_next_buf(dev, vbi_dma_q);
dev->usb_ctl.vbi_buf = vbi_buf;
}
if (vbi_buf != NULL) {
vbi_buf->top_field = dev->top_field;
vbi_buf->pos = 0;
}
}

if (dev->capture_type == 1) {
Expand All @@ -480,17 +493,9 @@ static inline int em28xx_urb_data_copy(struct em28xx *dev, struct urb *urb)
}

if (dev->capture_type == 2) {
buf = finish_field_prepare_next(dev, buf, dma_q);
dev->usb_ctl.vid_buf = buf;
dev->capture_type = 3;
if (dev->progressive || dev->top_field) {
if (buf != NULL)
finish_buffer(dev, buf);
buf = get_next_buf(dev, dma_q);
dev->usb_ctl.vid_buf = buf;
}
if (buf != NULL) {
buf->top_field = dev->top_field;
buf->pos = 0;
}
}

if (buf != NULL && dev->capture_type == 3 && len > 0)
Expand Down

0 comments on commit 7231b8c

Please sign in to comment.