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/cpia1.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/cpia1.c')
-rw-r--r-- | drivers/media/video/gspca/cpia1.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/video/gspca/cpia1.c b/drivers/media/video/gspca/cpia1.c index 58b696f455be..4b3ea3b4bbba 100644 --- a/drivers/media/video/gspca/cpia1.c +++ b/drivers/media/video/gspca/cpia1.c | |||
@@ -1760,22 +1760,23 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
1760 | data[25] == sd->params.roi.colEnd && | 1760 | data[25] == sd->params.roi.colEnd && |
1761 | data[26] == sd->params.roi.rowStart && | 1761 | data[26] == sd->params.roi.rowStart && |
1762 | data[27] == sd->params.roi.rowEnd) { | 1762 | data[27] == sd->params.roi.rowEnd) { |
1763 | struct gspca_frame *frame = gspca_get_i_frame(gspca_dev); | 1763 | u8 *image; |
1764 | 1764 | ||
1765 | atomic_set(&sd->cam_exposure, data[39] * 2); | 1765 | atomic_set(&sd->cam_exposure, data[39] * 2); |
1766 | atomic_set(&sd->fps, data[41]); | 1766 | atomic_set(&sd->fps, data[41]); |
1767 | 1767 | ||
1768 | if (frame == NULL) { | 1768 | image = gspca_dev->image; |
1769 | if (image == NULL) { | ||
1769 | gspca_dev->last_packet_type = DISCARD_PACKET; | 1770 | gspca_dev->last_packet_type = DISCARD_PACKET; |
1770 | return; | 1771 | return; |
1771 | } | 1772 | } |
1772 | 1773 | ||
1773 | /* Check for proper EOF for last frame */ | 1774 | /* Check for proper EOF for last frame */ |
1774 | if ((frame->data_end - frame->data) > 4 && | 1775 | if (gspca_dev->image_len > 4 && |
1775 | frame->data_end[-4] == 0xff && | 1776 | image[gspca_dev->image_len - 4] == 0xff && |
1776 | frame->data_end[-3] == 0xff && | 1777 | image[gspca_dev->image_len - 3] == 0xff && |
1777 | frame->data_end[-2] == 0xff && | 1778 | image[gspca_dev->image_len - 2] == 0xff && |
1778 | frame->data_end[-1] == 0xff) | 1779 | image[gspca_dev->image_len - 1] == 0xff) |
1779 | gspca_frame_add(gspca_dev, LAST_PACKET, | 1780 | gspca_frame_add(gspca_dev, LAST_PACKET, |
1780 | NULL, 0); | 1781 | NULL, 0); |
1781 | 1782 | ||