diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-11-13 12:16:02 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 21:41:59 +0100 |
commit | d131c3c9e136cb5a817094c3dc4b7261b495cd6e (patch) | |
tree | f0f6cac7cab36e23d8c00fb78cbd6d3fea6db87b | |
parent | V4L/DVB (13451): gspca - main: Memorize the current frame buffer. (diff) | |
download | linux-d131c3c9e136cb5a817094c3dc4b7261b495cd6e.tar.xz linux-d131c3c9e136cb5a817094c3dc4b7261b495cd6e.zip |
V4L/DVB (13452): gspca - main: Let the driver scan URB packets when no frame buffer.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/gspca/gspca.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index 31ec5aa44910..68ba535300f7 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -144,13 +144,6 @@ static void fill_frame(struct gspca_dev *gspca_dev, pkt_scan = gspca_dev->sd_desc->pkt_scan; for (i = 0; i < urb->number_of_packets; i++) { - /* check the availability of the frame buffer */ - if ((gspca_dev->cur_frame->v4l2_buf.flags & BUF_ALL_FLAGS) - != V4L2_BUF_FLAG_QUEUED) { - gspca_dev->last_packet_type = DISCARD_PACKET; - break; - } - /* check the packet status and length */ len = urb->iso_frame_desc[i].actual_length; if (len == 0) { @@ -223,17 +216,11 @@ static void bulk_irq(struct urb *urb) goto resubmit; } - /* check the availability of the frame buffer */ - if ((gspca_dev->cur_frame->v4l2_buf.flags & BUF_ALL_FLAGS) - != V4L2_BUF_FLAG_QUEUED) { - gspca_dev->last_packet_type = DISCARD_PACKET; - } else { - PDEBUG(D_PACK, "packet l:%d", urb->actual_length); - gspca_dev->sd_desc->pkt_scan(gspca_dev, - gspca_dev->frame, - urb->transfer_buffer, - urb->actual_length); - } + PDEBUG(D_PACK, "packet l:%d", urb->actual_length); + gspca_dev->sd_desc->pkt_scan(gspca_dev, + gspca_dev->frame, + urb->transfer_buffer, + urb->actual_length); resubmit: /* resubmit the URB */ @@ -266,16 +253,18 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev, int i, j; PDEBUG(D_PACK, "add t:%d l:%d", packet_type, len); + + /* check the availability of the frame buffer */ frame = gspca_dev->cur_frame; + if ((frame->v4l2_buf.flags & BUF_ALL_FLAGS) + != V4L2_BUF_FLAG_QUEUED) { + gspca_dev->last_packet_type = DISCARD_PACKET; + return frame; + } /* when start of a new frame, if the current frame buffer * is not queued, discard the whole frame */ if (packet_type == FIRST_PACKET) { - if ((frame->v4l2_buf.flags & BUF_ALL_FLAGS) - != V4L2_BUF_FLAG_QUEUED) { - gspca_dev->last_packet_type = DISCARD_PACKET; - return frame; - } frame->data_end = frame->data; jiffies_to_timeval(get_jiffies_64(), &frame->v4l2_buf.timestamp); |