Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114027
b: refs/heads/master
c: 1b60e1a
h: refs/heads/master
i:
  114025: 86a1a61
  114023: 0d2b5cd
v: v3
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent ed85ee8 commit 241b768
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 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: 9de436cfc4e966652f8804f0dda8d338ca7fe89c
refs/heads/master: 1b60e1adc713e8d375dc117f5c3b5032d5b79abe
33 changes: 21 additions & 12 deletions trunk/drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ static struct vm_operations_struct gspca_vm_ops = {
.close = gspca_vm_close,
};

/* get the current input frame buffer */
struct gspca_frame *gspca_get_i_frame(struct gspca_dev *gspca_dev)
{
struct gspca_frame *frame;
int i;

i = gspca_dev->fr_i;
i = gspca_dev->fr_queue[i];
frame = &gspca_dev->frame[i];
if ((frame->v4l2_buf.flags & BUF_ALL_FLAGS)
!= V4L2_BUF_FLAG_QUEUED)
return NULL;
return frame;
}
EXPORT_SYMBOL(gspca_get_i_frame);

/*
* fill a video frame from an URB and resubmit
*/
Expand All @@ -110,7 +126,7 @@ static void fill_frame(struct gspca_dev *gspca_dev,
{
struct gspca_frame *frame;
__u8 *data; /* address of data in the iso message */
int i, j, len, st;
int i, len, st;
cam_pkt_op pkt_scan;

if (urb->status != 0) {
Expand All @@ -124,11 +140,8 @@ static void fill_frame(struct gspca_dev *gspca_dev,
for (i = 0; i < urb->number_of_packets; i++) {

/* check the availability of the frame buffer */
j = gspca_dev->fr_i;
j = gspca_dev->fr_queue[j];
frame = &gspca_dev->frame[j];
if ((frame->v4l2_buf.flags & BUF_ALL_FLAGS)
!= V4L2_BUF_FLAG_QUEUED) {
frame = gspca_get_i_frame(gspca_dev);
if (!frame) {
gspca_dev->last_packet_type = DISCARD_PACKET;
break;
}
Expand Down Expand Up @@ -185,7 +198,6 @@ static void bulk_irq(struct urb *urb
{
struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context;
struct gspca_frame *frame;
int j;

PDEBUG(D_PACK, "bulk irq");
if (!gspca_dev->streaming)
Expand All @@ -199,11 +211,8 @@ static void bulk_irq(struct urb *urb
}

/* check the availability of the frame buffer */
j = gspca_dev->fr_i;
j = gspca_dev->fr_queue[j];
frame = &gspca_dev->frame[j];
if ((frame->v4l2_buf.flags & BUF_ALL_FLAGS)
!= V4L2_BUF_FLAG_QUEUED) {
frame = gspca_get_i_frame(gspca_dev);
if (!frame) {
gspca_dev->last_packet_type = DISCARD_PACKET;
} else {
PDEBUG(D_PACK, "packet l:%d", urb->actual_length);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/gspca/gspca.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev,
struct gspca_frame *frame,
const __u8 *data,
int len);
struct gspca_frame *gspca_get_i_frame(struct gspca_dev *gspca_dev);
#ifdef CONFIG_PM
int gspca_suspend(struct usb_interface *intf, pm_message_t message);
int gspca_resume(struct usb_interface *intf);
Expand Down

0 comments on commit 241b768

Please sign in to comment.