diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-06-27 02:08:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 14:31:10 -0400 |
commit | b192ca983746585e807259414f8d6f58cb28311f (patch) | |
tree | 8c95bdcebcf4217e3813d803ecf281af2d431e5f /drivers/media/video/gspca/vc032x.c | |
parent | c6dc725c8e0c3438587e18f918f6da16e7a23539 (diff) |
V4L/DVB: gspca - main: Simplify image building
The image pointer and its length are now in the main structure instead
of in the frame buffer. They are updated on application vidioc_qbuf and
in the URB interrupt function when ending an image.
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/vc032x.c')
-rw-r--r-- | drivers/media/video/gspca/vc032x.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c index 732c3dfe46ff..0a7d1e0866d2 100644 --- a/drivers/media/video/gspca/vc032x.c +++ b/drivers/media/video/gspca/vc032x.c | |||
@@ -3726,17 +3726,16 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
3726 | /* The vc0321 sends some additional data after sending the complete | 3726 | /* The vc0321 sends some additional data after sending the complete |
3727 | * frame, we ignore this. */ | 3727 | * frame, we ignore this. */ |
3728 | if (sd->bridge == BRIDGE_VC0321) { | 3728 | if (sd->bridge == BRIDGE_VC0321) { |
3729 | struct gspca_frame *frame; | 3729 | int size, l; |
3730 | int l; | ||
3731 | 3730 | ||
3732 | frame = gspca_get_i_frame(gspca_dev); | 3731 | if (gspca_dev->image == NULL) { |
3733 | if (frame == NULL) { | ||
3734 | gspca_dev->last_packet_type = DISCARD_PACKET; | 3732 | gspca_dev->last_packet_type = DISCARD_PACKET; |
3735 | return; | 3733 | return; |
3736 | } | 3734 | } |
3737 | l = frame->data_end - frame->data; | 3735 | l = gspca_dev->image_len; |
3738 | if (len > frame->v4l2_buf.length - l) | 3736 | size = gspca_dev->frsz; |
3739 | len = frame->v4l2_buf.length - l; | 3737 | if (len > size - l) |
3738 | len = size - l; | ||
3740 | } | 3739 | } |
3741 | gspca_frame_add(gspca_dev, INTER_PACKET, data, len); | 3740 | gspca_frame_add(gspca_dev, INTER_PACKET, data, len); |
3742 | } | 3741 | } |