diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-11-13 06:16:02 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:41:59 -0500 |
commit | d131c3c9e136cb5a817094c3dc4b7261b495cd6e (patch) | |
tree | f0f6cac7cab36e23d8c00fb78cbd6d3fea6db87b /drivers/media/video/gspca/gspca.c | |
parent | 3ec342f25004c87c0d94de1bc1b5399685d58ad8 (diff) |
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>
Diffstat (limited to 'drivers/media/video/gspca/gspca.c')
-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, | |||
144 | pkt_scan = gspca_dev->sd_desc->pkt_scan; | 144 | pkt_scan = gspca_dev->sd_desc->pkt_scan; |
145 | for (i = 0; i < urb->number_of_packets; i++) { | 145 | for (i = 0; i < urb->number_of_packets; i++) { |
146 | 146 | ||
147 | /* check the availability of the frame buffer */ | ||
148 | if ((gspca_dev->cur_frame->v4l2_buf.flags & BUF_ALL_FLAGS) | ||
149 | != V4L2_BUF_FLAG_QUEUED) { | ||
150 | gspca_dev->last_packet_type = DISCARD_PACKET; | ||
151 | break; | ||
152 | } | ||
153 | |||
154 | /* check the packet status and length */ | 147 | /* check the packet status and length */ |
155 | len = urb->iso_frame_desc[i].actual_length; | 148 | len = urb->iso_frame_desc[i].actual_length; |
156 | if (len == 0) { | 149 | if (len == 0) { |
@@ -223,17 +216,11 @@ static void bulk_irq(struct urb *urb) | |||
223 | goto resubmit; | 216 | goto resubmit; |
224 | } | 217 | } |
225 | 218 | ||
226 | /* check the availability of the frame buffer */ | 219 | PDEBUG(D_PACK, "packet l:%d", urb->actual_length); |
227 | if ((gspca_dev->cur_frame->v4l2_buf.flags & BUF_ALL_FLAGS) | 220 | gspca_dev->sd_desc->pkt_scan(gspca_dev, |
228 | != V4L2_BUF_FLAG_QUEUED) { | 221 | gspca_dev->frame, |
229 | gspca_dev->last_packet_type = DISCARD_PACKET; | 222 | urb->transfer_buffer, |
230 | } else { | 223 | urb->actual_length); |
231 | PDEBUG(D_PACK, "packet l:%d", urb->actual_length); | ||
232 | gspca_dev->sd_desc->pkt_scan(gspca_dev, | ||
233 | gspca_dev->frame, | ||
234 | urb->transfer_buffer, | ||
235 | urb->actual_length); | ||
236 | } | ||
237 | 224 | ||
238 | resubmit: | 225 | resubmit: |
239 | /* resubmit the URB */ | 226 | /* resubmit the URB */ |
@@ -266,16 +253,18 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev, | |||
266 | int i, j; | 253 | int i, j; |
267 | 254 | ||
268 | PDEBUG(D_PACK, "add t:%d l:%d", packet_type, len); | 255 | PDEBUG(D_PACK, "add t:%d l:%d", packet_type, len); |
256 | |||
257 | /* check the availability of the frame buffer */ | ||
269 | frame = gspca_dev->cur_frame; | 258 | frame = gspca_dev->cur_frame; |
259 | if ((frame->v4l2_buf.flags & BUF_ALL_FLAGS) | ||
260 | != V4L2_BUF_FLAG_QUEUED) { | ||
261 | gspca_dev->last_packet_type = DISCARD_PACKET; | ||
262 | return frame; | ||
263 | } | ||
270 | 264 | ||
271 | /* when start of a new frame, if the current frame buffer | 265 | /* when start of a new frame, if the current frame buffer |
272 | * is not queued, discard the whole frame */ | 266 | * is not queued, discard the whole frame */ |
273 | if (packet_type == FIRST_PACKET) { | 267 | if (packet_type == FIRST_PACKET) { |
274 | if ((frame->v4l2_buf.flags & BUF_ALL_FLAGS) | ||
275 | != V4L2_BUF_FLAG_QUEUED) { | ||
276 | gspca_dev->last_packet_type = DISCARD_PACKET; | ||
277 | return frame; | ||
278 | } | ||
279 | frame->data_end = frame->data; | 268 | frame->data_end = frame->data; |
280 | jiffies_to_timeval(get_jiffies_64(), | 269 | jiffies_to_timeval(get_jiffies_64(), |
281 | &frame->v4l2_buf.timestamp); | 270 | &frame->v4l2_buf.timestamp); |