aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/jeilinj.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:50:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:50:49 -0500
commit3e7468313758913c5e4d372f35b271b96bad1298 (patch)
treeeb612d252a9e2349a1173451cd779beebd18a33e /drivers/media/video/gspca/jeilinj.c
parent6825fbc4cb219f2c98bb7d157915d797cf5cb823 (diff)
parente97f4677961f68e29bd906022ebf60a6df7f530a (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (345 commits) V4L/DVB (13542): ir-keytable: Allow dynamic table change V4L/DVB (13541): atbm8830: replace 64-bit division and floating point usage V4L/DVB (13540): ir-common: Cleanup get key evdev code V4L/DVB (13539): ir-common: add __func__ for debug messages V4L/DVB (13538): ir-common: Use a dynamic keycode table V4L/DVB (13537): ir: Prepare the code for dynamic keycode table allocation V4L/DVB (13536): em28xx: Use the full RC5 code on HVR-950 Remote Controller V4L/DVB (13535): ir-common: Add a hauppauge new table with the complete RC5 code V4L/DVB (13534): ir-common: Remove some unused fields/structs V4L/DVB (13533): ir: use dynamic tables, instead of static ones V4L/DVB (13532): ir-common: Add infrastructure to use a dynamic keycode table V4L/DVB (13531): ir-common: rename the debug routine to allow exporting it V4L/DVB (13458): go7007: subdev conversion V4L/DVB (13457): s2250: subdev conversion V4L/DVB (13456): s2250: Change module structure V4L/DVB (13528): em28xx: add support for em2800 VC211A card em28xx: don't reduce scale to half size for em2800 em28xx: don't load audio modules when AC97 is mis-detected em28xx: em2800 chips support max width of 640 V4L/DVB (13523): dvb-bt8xx: fix compile warning ... Fix up trivial conflicts due to spelling fixes from the trivial tree in Documentation/video4linux/gspca.txt drivers/media/video/cx18/cx18-mailbox.h
Diffstat (limited to 'drivers/media/video/gspca/jeilinj.c')
-rw-r--r--drivers/media/video/gspca/jeilinj.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/drivers/media/video/gspca/jeilinj.c b/drivers/media/video/gspca/jeilinj.c
index a11c97ebeb0f..2019b04f9235 100644
--- a/drivers/media/video/gspca/jeilinj.c
+++ b/drivers/media/video/gspca/jeilinj.c
@@ -181,11 +181,9 @@ static void jlj_dostream(struct work_struct *work)
181{ 181{
182 struct sd *dev = container_of(work, struct sd, work_struct); 182 struct sd *dev = container_of(work, struct sd, work_struct);
183 struct gspca_dev *gspca_dev = &dev->gspca_dev; 183 struct gspca_dev *gspca_dev = &dev->gspca_dev;
184 struct gspca_frame *frame;
185 int blocks_left; /* 0x200-sized blocks remaining in current frame. */ 184 int blocks_left; /* 0x200-sized blocks remaining in current frame. */
186 int size_in_blocks; 185 int size_in_blocks;
187 int act_len; 186 int act_len;
188 int discarding = 0; /* true if we failed to get space for frame. */
189 int packet_type; 187 int packet_type;
190 int ret; 188 int ret;
191 u8 *buffer; 189 u8 *buffer;
@@ -196,15 +194,6 @@ static void jlj_dostream(struct work_struct *work)
196 goto quit_stream; 194 goto quit_stream;
197 } 195 }
198 while (gspca_dev->present && gspca_dev->streaming) { 196 while (gspca_dev->present && gspca_dev->streaming) {
199 if (!gspca_dev->present)
200 goto quit_stream;
201 /* Start a new frame, and add the JPEG header, first thing */
202 frame = gspca_get_i_frame(gspca_dev);
203 if (frame && !discarding)
204 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
205 dev->jpeg_hdr, JPEG_HDR_SZ);
206 else
207 discarding = 1;
208 /* 197 /*
209 * Now request data block 0. Line 0 reports the size 198 * Now request data block 0. Line 0 reports the size
210 * to download, in blocks of size 0x200, and also tells the 199 * to download, in blocks of size 0x200, and also tells the
@@ -222,14 +211,15 @@ static void jlj_dostream(struct work_struct *work)
222 size_in_blocks = buffer[0x0a]; 211 size_in_blocks = buffer[0x0a];
223 blocks_left = buffer[0x0a] - 1; 212 blocks_left = buffer[0x0a] - 1;
224 PDEBUG(D_STREAM, "blocks_left = 0x%x", blocks_left); 213 PDEBUG(D_STREAM, "blocks_left = 0x%x", blocks_left);
225 packet_type = INTER_PACKET; 214
226 if (frame && !discarding) 215 /* Start a new frame, and add the JPEG header, first thing */
227 /* Toss line 0 of data block 0, keep the rest. */ 216 gspca_frame_add(gspca_dev, FIRST_PACKET,
228 gspca_frame_add(gspca_dev, packet_type, 217 dev->jpeg_hdr, JPEG_HDR_SZ);
229 frame, buffer + FRAME_HEADER_LEN, 218 /* Toss line 0 of data block 0, keep the rest. */
219 gspca_frame_add(gspca_dev, INTER_PACKET,
220 buffer + FRAME_HEADER_LEN,
230 JEILINJ_MAX_TRANSFER - FRAME_HEADER_LEN); 221 JEILINJ_MAX_TRANSFER - FRAME_HEADER_LEN);
231 else 222
232 discarding = 1;
233 while (blocks_left > 0) { 223 while (blocks_left > 0) {
234 if (!gspca_dev->present) 224 if (!gspca_dev->present)
235 goto quit_stream; 225 goto quit_stream;
@@ -246,12 +236,8 @@ static void jlj_dostream(struct work_struct *work)
246 packet_type = LAST_PACKET; 236 packet_type = LAST_PACKET;
247 else 237 else
248 packet_type = INTER_PACKET; 238 packet_type = INTER_PACKET;
249 if (frame && !discarding) 239 gspca_frame_add(gspca_dev, packet_type,
250 gspca_frame_add(gspca_dev, packet_type, 240 buffer, JEILINJ_MAX_TRANSFER);
251 frame, buffer,
252 JEILINJ_MAX_TRANSFER);
253 else
254 discarding = 1;
255 } 241 }
256 } 242 }
257quit_stream: 243quit_stream: