V4L/DVB (13453): gspca - all subdrivers: Remove the unused frame ptr from pkt_scan().

Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Jean-Francois Moine 2009-11-13 09:21:03 -03:00 коммит произвёл Mauro Carvalho Chehab
Родитель d131c3c9e1
Коммит 76dd272b56
35 изменённых файлов: 240 добавлений и 287 удалений

Просмотреть файл

@ -888,8 +888,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -897,16 +896,15 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
if (data[0] == 0xff && data[1] == 0xd8) {
/* start of frame */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
/* put the JPEG header in the new frame */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
sd->jpeg_hdr, JPEG_HDR_SZ);
gspca_frame_add(gspca_dev, FIRST_PACKET,
sd->jpeg_hdr, JPEG_HDR_SZ);
data += 2;
len -= 2;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static void setbrightness(struct gspca_dev*gspca_dev)

Просмотреть файл

@ -752,8 +752,7 @@ static void do_autogain(struct gspca_dev *gspca_dev)
#undef LIMIT
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
int seqframe;
@ -767,14 +766,13 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
data[2], data[3], data[4], data[5]);
data += 30;
/* don't change datalength as the chips provided it */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
return;
}
if (len) {
data += 8;
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
} else { /* Drop Packet */
gspca_dev->last_packet_type = DISCARD_PACKET;
}

Просмотреть файл

@ -82,7 +82,6 @@ static void dostream(struct work_struct *work)
struct gspca_dev *gspca_dev = &dev->gspca_dev;
struct urb *urb = gspca_dev->urb[0];
u8 *data = urb->transfer_buffer;
struct gspca_frame *frame;
int ret = 0;
int len;
@ -118,10 +117,6 @@ again:
}
if (!gspca_dev->present || !gspca_dev->streaming)
goto out;
frame = gspca_get_i_frame(&dev->gspca_dev);
if (frame == NULL)
gspca_dev->last_packet_type = DISCARD_PACKET;
if (len < FPIX_MAX_TRANSFER ||
(data[len - 2] == 0xff &&
data[len - 1] == 0xd9)) {
@ -132,21 +127,17 @@ again:
* but there's nothing we can do. We also end
* here if the the jpeg ends right at the end
* of the frame. */
if (frame)
frame = gspca_frame_add(gspca_dev,
LAST_PACKET,
frame,
data, len);
gspca_frame_add(gspca_dev, LAST_PACKET,
data, len);
break;
}
/* got a partial image */
if (frame)
gspca_frame_add(gspca_dev,
gspca_dev->last_packet_type
== LAST_PACKET
? FIRST_PACKET : INTER_PACKET,
frame, data, len);
gspca_frame_add(gspca_dev,
gspca_dev->last_packet_type
== LAST_PACKET
? FIRST_PACKET : INTER_PACKET,
data, len);
}
/* We must wait before trying reading the next

Просмотреть файл

@ -36,7 +36,7 @@ static int sd_isoc_init(struct gspca_dev *gspca_dev);
static int sd_start(struct gspca_dev *gspca_dev);
static void sd_stop0(struct gspca_dev *gspca_dev);
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, u8 *data, s32 len);
u8 *data, int len);
static void sd_callback(struct gspca_dev *gspca_dev);
static int gl860_guess_sensor(struct gspca_dev *gspca_dev,
@ -433,7 +433,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
/* This function is called when an image is being received */
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, u8 *data, s32 len)
u8 *data, int len)
{
struct sd *sd = (struct sd *) gspca_dev;
static s32 nSkipped;
@ -445,11 +445,11 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
/* Test only against 0202h, so endianess does not matter */
switch (*(s16 *) data) {
case 0x0202: /* End of frame, start a new one */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
nSkipped = 0;
if (sd->nbIm >= 0 && sd->nbIm < 10)
sd->nbIm++;
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, NULL, 0);
break;
default:
@ -464,7 +464,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
nSkipped = nToSkip + 1;
}
gspca_frame_add(gspca_dev,
INTER_PACKET, frame, data, len);
INTER_PACKET, data, len);
}
break;
}

Просмотреть файл

@ -165,7 +165,7 @@ static void fill_frame(struct gspca_dev *gspca_dev,
i, urb->iso_frame_desc[i].offset, len);
data = (u8 *) urb->transfer_buffer
+ urb->iso_frame_desc[i].offset;
pkt_scan(gspca_dev, gspca_dev->cur_frame, data, len);
pkt_scan(gspca_dev, data, len);
}
resubmit:
@ -218,7 +218,6 @@ static void bulk_irq(struct urb *urb)
PDEBUG(D_PACK, "packet l:%d", urb->actual_length);
gspca_dev->sd_desc->pkt_scan(gspca_dev,
gspca_dev->frame,
urb->transfer_buffer,
urb->actual_length);
@ -243,11 +242,10 @@ resubmit:
* DISCARD_PACKET invalidates the whole frame.
* On LAST_PACKET, a new frame is returned.
*/
struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev,
enum gspca_packet_type packet_type,
struct gspca_frame *dummy,
const __u8 *data,
int len)
void gspca_frame_add(struct gspca_dev *gspca_dev,
enum gspca_packet_type packet_type,
const u8 *data,
int len)
{
struct gspca_frame *frame;
int i, j;
@ -259,7 +257,7 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev,
if ((frame->v4l2_buf.flags & BUF_ALL_FLAGS)
!= V4L2_BUF_FLAG_QUEUED) {
gspca_dev->last_packet_type = DISCARD_PACKET;
return frame;
return;
}
/* when start of a new frame, if the current frame buffer
@ -272,7 +270,7 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev,
} else if (gspca_dev->last_packet_type == DISCARD_PACKET) {
if (packet_type == LAST_PACKET)
gspca_dev->last_packet_type = packet_type;
return frame;
return;
}
/* append the packet to the frame buffer */
@ -304,9 +302,9 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev,
i,
gspca_dev->fr_o);
j = gspca_dev->fr_queue[i];
gspca_dev->cur_frame = frame = &gspca_dev->frame[j];
gspca_dev->cur_frame = &gspca_dev->frame[j];
}
return frame;
return;
}
EXPORT_SYMBOL(gspca_frame_add);

Просмотреть файл

@ -79,8 +79,7 @@ typedef int (*cam_streamparm_op) (struct gspca_dev *,
typedef int (*cam_qmnu_op) (struct gspca_dev *,
struct v4l2_querymenu *);
typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev,
struct gspca_frame *frame,
__u8 *data,
u8 *data,
int len);
struct ctrl {
@ -192,11 +191,10 @@ int gspca_dev_probe(struct usb_interface *intf,
int dev_size,
struct module *module);
void gspca_disconnect(struct usb_interface *intf);
struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev,
enum gspca_packet_type packet_type,
struct gspca_frame *frame,
const __u8 *data,
int len);
void gspca_frame_add(struct gspca_dev *gspca_dev,
enum gspca_packet_type packet_type,
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);

Просмотреть файл

@ -181,7 +181,6 @@ static void jlj_dostream(struct work_struct *work)
{
struct sd *dev = container_of(work, struct sd, work_struct);
struct gspca_dev *gspca_dev = &dev->gspca_dev;
struct gspca_frame *frame;
int blocks_left; /* 0x200-sized blocks remaining in current frame. */
int size_in_blocks;
int act_len;
@ -214,15 +213,13 @@ static void jlj_dostream(struct work_struct *work)
PDEBUG(D_STREAM, "blocks_left = 0x%x", blocks_left);
/* Start a new frame, and add the JPEG header, first thing */
frame = gspca_get_i_frame(gspca_dev);
if (frame) {
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
dev->jpeg_hdr, JPEG_HDR_SZ);
/* Toss line 0 of data block 0, keep the rest. */
gspca_frame_add(gspca_dev, INTER_PACKET,
frame, buffer + FRAME_HEADER_LEN,
gspca_frame_add(gspca_dev, FIRST_PACKET,
dev->jpeg_hdr, JPEG_HDR_SZ);
/* Toss line 0 of data block 0, keep the rest. */
gspca_frame_add(gspca_dev, INTER_PACKET,
buffer + FRAME_HEADER_LEN,
JEILINJ_MAX_TRANSFER - FRAME_HEADER_LEN);
}
while (blocks_left > 0) {
if (!gspca_dev->present)
goto quit_stream;
@ -239,10 +236,8 @@ static void jlj_dostream(struct work_struct *work)
packet_type = LAST_PACKET;
else
packet_type = INTER_PACKET;
if (frame)
gspca_frame_add(gspca_dev, packet_type,
frame, buffer,
JEILINJ_MAX_TRANSFER);
gspca_frame_add(gspca_dev, packet_type,
buffer, JEILINJ_MAX_TRANSFER);
}
}
quit_stream:

Просмотреть файл

@ -274,8 +274,7 @@ static int m5602_start_transfer(struct gspca_dev *gspca_dev)
}
static void m5602_urb_complete(struct gspca_dev *gspca_dev,
struct gspca_frame *frame,
__u8 *data, int len)
u8 *data, int len)
{
struct sd *sd = (struct sd *) gspca_dev;
@ -295,19 +294,27 @@ static void m5602_urb_complete(struct gspca_dev *gspca_dev,
len -= 6;
/* Complete the last frame (if any) */
frame = gspca_frame_add(gspca_dev, LAST_PACKET,
frame, data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
sd->frame_count++;
/* Create a new frame */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
PDEBUG(D_FRAM, "Starting new frame %d",
sd->frame_count);
} else {
int cur_frame_len = frame->data_end - frame->data;
struct gspca_frame *frame;
int cur_frame_len;
frame = gspca_get_i_frame(gspca_dev);
if (frame == NULL) {
gspca_dev->last_packet_type = DISCARD_PACKET;
return;
}
cur_frame_len = frame->data_end - frame->data;
/* Remove urb header */
data += 4;
len -= 4;
@ -316,12 +323,12 @@ static void m5602_urb_complete(struct gspca_dev *gspca_dev,
PDEBUG(D_FRAM, "Continuing frame %d copying %d bytes",
sd->frame_count, len);
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
data, len);
} else if (frame->v4l2_buf.length - cur_frame_len > 0) {
/* Add the remaining data up to frame size */
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data,
frame->v4l2_buf.length - cur_frame_len);
gspca_frame_add(gspca_dev, INTER_PACKET, data,
frame->v4l2_buf.length - cur_frame_len);
}
}
}

Просмотреть файл

@ -325,8 +325,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -348,11 +347,11 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
|| data[5 + p] == 0x67) {
PDEBUG(D_PACK, "sof offset: %d len: %d",
p, len);
frame = gspca_frame_add(gspca_dev, LAST_PACKET,
frame, data, p);
gspca_frame_add(gspca_dev, LAST_PACKET,
data, p);
/* put the JPEG header */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
sd->jpeg_hdr, JPEG_HDR_SZ);
data += p + 16;
len -= p + 16;
@ -360,7 +359,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
}
}
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -1030,9 +1030,8 @@ static int sd_getmin_clockdiv(struct gspca_dev *gspca_dev, __s32 *val)
#include "pac_common.h"
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
int len) /* iso packet length */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
unsigned char *sof;
@ -1047,15 +1046,15 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
n -= sizeof pac_sof_marker;
else
n = 0;
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
gspca_frame_add(gspca_dev, LAST_PACKET,
data, n);
/* Start next frame. */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
pac_sof_marker, sizeof pac_sof_marker);
len -= sof - data;
data = sof;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
/* sub-driver description */

Просмотреть файл

@ -3920,9 +3920,8 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void ov511_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *in, /* isoc packet */
int len) /* iso packet length */
u8 *in, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -3953,11 +3952,11 @@ static void ov511_pkt_scan(struct gspca_dev *gspca_dev,
return;
}
/* Add 11 byte footer to frame, might be usefull */
gspca_frame_add(gspca_dev, LAST_PACKET, frame, in, 11);
gspca_frame_add(gspca_dev, LAST_PACKET, in, 11);
return;
} else {
/* Frame start */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, in, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, in, 0);
sd->packet_nr = 0;
}
}
@ -3966,12 +3965,11 @@ static void ov511_pkt_scan(struct gspca_dev *gspca_dev,
len--;
/* intermediate packet */
gspca_frame_add(gspca_dev, INTER_PACKET, frame, in, len);
gspca_frame_add(gspca_dev, INTER_PACKET, in, len);
}
static void ov518_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -3979,8 +3977,8 @@ static void ov518_pkt_scan(struct gspca_dev *gspca_dev,
/* A false positive here is likely, until OVT gives me
* the definitive SOF/EOF format */
if ((!(data[0] | data[1] | data[2] | data[3] | data[5])) && data[6]) {
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, NULL, 0);
sd->packet_nr = 0;
}
@ -4004,12 +4002,11 @@ static void ov518_pkt_scan(struct gspca_dev *gspca_dev,
}
/* intermediate packet */
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static void ov519_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
/* Header of ov519 is 16 bytes:
@ -4032,7 +4029,7 @@ static void ov519_pkt_scan(struct gspca_dev *gspca_dev,
len -= HDRSZ;
#undef HDRSZ
if (data[0] == 0xff || data[1] == 0xd8)
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
data, len);
else
gspca_dev->last_packet_type = DISCARD_PACKET;
@ -4040,34 +4037,31 @@ static void ov519_pkt_scan(struct gspca_dev *gspca_dev,
case 0x51: /* end of frame */
if (data[9] != 0)
gspca_dev->last_packet_type = DISCARD_PACKET;
gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
return;
}
}
/* intermediate packet */
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static void ovfx2_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
/* A short read signals EOF */
if (len < OVFX2_BULK_SIZE) {
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, NULL, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, NULL, 0);
return;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -4075,20 +4069,20 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
switch (sd->bridge) {
case BRIDGE_OV511:
case BRIDGE_OV511PLUS:
ov511_pkt_scan(gspca_dev, frame, data, len);
ov511_pkt_scan(gspca_dev, data, len);
break;
case BRIDGE_OV518:
case BRIDGE_OV518PLUS:
ov518_pkt_scan(gspca_dev, frame, data, len);
ov518_pkt_scan(gspca_dev, data, len);
break;
case BRIDGE_OV519:
ov519_pkt_scan(gspca_dev, frame, data, len);
ov519_pkt_scan(gspca_dev, data, len);
break;
case BRIDGE_OVFX2:
ovfx2_pkt_scan(gspca_dev, frame, data, len);
ovfx2_pkt_scan(gspca_dev, data, len);
break;
case BRIDGE_W9968CF:
w9968cf_pkt_scan(gspca_dev, frame, data, len);
w9968cf_pkt_scan(gspca_dev, data, len);
break;
}
}

Просмотреть файл

@ -1403,8 +1403,8 @@ static void sd_stopN_ov965x(struct gspca_dev *gspca_dev)
#define UVC_STREAM_EOF (1 << 1)
#define UVC_STREAM_FID (1 << 0)
static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame,
__u8 *data, int len)
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, int len)
{
struct sd *sd = (struct sd *) gspca_dev;
__u32 this_pts;
@ -1445,23 +1445,22 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame,
/* If PTS or FID has changed, start a new frame. */
if (this_pts != sd->last_pts || this_fid != sd->last_fid) {
if (gspca_dev->last_packet_type == INTER_PACKET)
frame = gspca_frame_add(gspca_dev,
LAST_PACKET, frame,
NULL, 0);
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
sd->last_pts = this_pts;
sd->last_fid = this_fid;
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
data + 12, len - 12);
/* If this packet is marked as EOF, end the frame */
} else if (data[1] & UVC_STREAM_EOF) {
sd->last_pts = 0;
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data + 12, len - 12);
gspca_frame_add(gspca_dev, LAST_PACKET,
data + 12, len - 12);
} else {
/* Add the data from this payload */
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
data + 12, len - 12);
gspca_frame_add(gspca_dev, INTER_PACKET,
data + 12, len - 12);
}
/* Done this payload */
@ -1469,7 +1468,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame,
discard:
/* Discard data until a new frame starts. */
gspca_frame_add(gspca_dev, DISCARD_PACKET, frame, NULL, 0);
gspca_dev->last_packet_type = DISCARD_PACKET;
scan_next:
remaining_len -= len;

Просмотреть файл

@ -337,8 +337,7 @@ static void pac207_do_auto_gain(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame,
__u8 *data,
u8 *data,
int len)
{
struct sd *sd = (struct sd *) gspca_dev;
@ -354,10 +353,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
n -= sizeof pac_sof_marker;
else
n = 0;
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, n);
gspca_frame_add(gspca_dev, LAST_PACKET,
data, n);
sd->header_read = 0;
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, NULL, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, NULL, 0);
len -= sof - data;
data = sof;
}
@ -381,7 +380,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
sd->header_read = 11;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static void setbrightness(struct gspca_dev *gspca_dev)

Просмотреть файл

@ -855,7 +855,7 @@ static void pac_start_frame(struct gspca_dev *gspca_dev,
{
unsigned char tmpbuf[4];
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
pac_jpeg_header1, sizeof(pac_jpeg_header1));
tmpbuf[0] = lines >> 8;
@ -863,25 +863,31 @@ static void pac_start_frame(struct gspca_dev *gspca_dev,
tmpbuf[2] = samples_per_line >> 8;
tmpbuf[3] = samples_per_line & 0xff;
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
tmpbuf, sizeof(tmpbuf));
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
pac_jpeg_header2, sizeof(pac_jpeg_header2));
}
/* this function is run at interrupt level */
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
struct gspca_frame *frame;
unsigned char *sof;
sof = pac_find_sof(&sd->sof_read, data, len);
if (sof) {
int n, lum_offset, footer_length;
frame = gspca_get_i_frame(gspca_dev);
if (frame == NULL) {
gspca_dev->last_packet_type = DISCARD_PACKET;
return;
}
/* 6 bytes after the FF D9 EOF marker a number of lumination
bytes are send corresponding to different parts of the
image, the 14th and 15th byte after the EOF seem to
@ -895,12 +901,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
frame->data_end += n;
n = 0;
}
frame = gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
data, n);
if (gspca_dev->last_packet_type != DISCARD_PACKET &&
frame->data_end[-2] == 0xff &&
frame->data_end[-1] == 0xd9)
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
n = sof - data;
@ -920,7 +926,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
pac_start_frame(gspca_dev, frame,
gspca_dev->width, gspca_dev->height);
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -653,7 +653,7 @@ static void pac_start_frame(struct gspca_dev *gspca_dev,
{
unsigned char tmpbuf[4];
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
pac_jpeg_header1, sizeof(pac_jpeg_header1));
tmpbuf[0] = lines >> 8;
@ -661,25 +661,31 @@ static void pac_start_frame(struct gspca_dev *gspca_dev,
tmpbuf[2] = samples_per_line >> 8;
tmpbuf[3] = samples_per_line & 0xff;
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
tmpbuf, sizeof(tmpbuf));
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
pac_jpeg_header2, sizeof(pac_jpeg_header2));
}
/* this function is run at interrupt level */
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
unsigned char *sof;
struct gspca_frame *frame;
sof = pac_find_sof(&sd->sof_read, data, len);
if (sof) {
int n, lum_offset, footer_length;
frame = gspca_get_i_frame(gspca_dev);
if (frame == NULL) {
gspca_dev->last_packet_type = DISCARD_PACKET;
return;
}
/* 6 bytes after the FF D9 EOF marker a number of lumination
bytes are send corresponding to different parts of the
image, the 14th and 15th byte after the EOF seem to
@ -693,12 +699,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
frame->data_end += n;
n = 0;
}
frame = gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
data, n);
if (gspca_dev->last_packet_type != DISCARD_PACKET &&
frame->data_end[-2] == 0xff &&
frame->data_end[-1] == 0xd9)
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
n = sof - data;
@ -717,7 +723,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
pac_start_frame(gspca_dev, frame,
gspca_dev->height, gspca_dev->width);
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -2342,7 +2342,6 @@ static void sd_dqcallback(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
@ -2378,22 +2377,22 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
avg_lum >>= 9;
atomic_set(&sd->avg_lum, avg_lum);
gspca_frame_add(gspca_dev, LAST_PACKET,
frame, data, len);
data, len);
return;
}
if (gspca_dev->last_packet_type == LAST_PACKET) {
if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv
& MODE_JPEG) {
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
sd->jpeg_hdr, JPEG_HDR_SZ);
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
data, len);
} else {
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
data, len);
}
} else {
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
}

Просмотреть файл

@ -995,8 +995,7 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
unsigned char *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
int i;
@ -1054,12 +1053,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
pkt_type = DISCARD_PACKET;
}
frame = gspca_frame_add(gspca_dev, pkt_type,
frame, data, 0);
gspca_frame_add(gspca_dev, pkt_type,
NULL, 0);
data += i + fr_h_sz;
len -= i + fr_h_sz;
gspca_frame_add(gspca_dev, FIRST_PACKET,
frame, data, len);
data, len);
return;
}
}
@ -1068,15 +1067,21 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
if (cam->cam_mode[gspca_dev->curr_mode].priv & MODE_RAW) {
/* In raw mode we sometimes get some garbage after the frame
ignore this */
int used = frame->data_end - frame->data;
struct gspca_frame *frame;
int used;
int size = cam->cam_mode[gspca_dev->curr_mode].sizeimage;
frame = gspca_get_i_frame(gspca_dev);
if (frame == NULL) {
gspca_dev->last_packet_type = DISCARD_PACKET;
return;
}
used = frame->data_end - frame->data;
if (used + len > size)
len = size - used;
}
gspca_frame_add(gspca_dev, INTER_PACKET,
frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -1993,7 +1993,6 @@ static void do_autogain(struct gspca_dev *gspca_dev)
/* scan the URB packets */
/* This function is run at interrupt level. */
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
@ -2005,7 +2004,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
/* end of frame */
gspca_frame_add(gspca_dev, LAST_PACKET,
frame, data, sof + 2);
data, sof + 2);
if (sd->ag_cnt < 0)
return;
/* w1 w2 w3 */
@ -2028,10 +2027,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
if (gspca_dev->last_packet_type == LAST_PACKET) {
/* put the JPEG 422 header */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
sd->jpeg_hdr, JPEG_HDR_SZ);
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -899,8 +899,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -913,11 +912,11 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
/* gspca_dev->last_packet_type = DISCARD_PACKET; */
return;
}
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
gspca_frame_add(gspca_dev, LAST_PACKET,
ffd9, 2);
/* put the JPEG header in the new frame */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
sd->jpeg_hdr, JPEG_HDR_SZ);
data += SPCA500_OFFSET_DATA;
@ -931,7 +930,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
i = 0;
do {
if (data[i] == 0xff) {
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
data, i + 1);
len -= i;
data += i;
@ -940,7 +939,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
}
i++;
} while (i < len);
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static void setbrightness(struct gspca_dev *gspca_dev)

Просмотреть файл

@ -2032,20 +2032,15 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
switch (data[0]) {
case 0: /* start of frame */
frame = gspca_frame_add(gspca_dev,
LAST_PACKET,
frame,
data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
data += SPCA501_OFFSET_DATA;
len -= SPCA501_OFFSET_DATA;
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
return;
case 0xff: /* drop */
/* gspca_dev->last_packet_type = DISCARD_PACKET; */
@ -2053,8 +2048,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
}
data++;
len--;
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -739,26 +739,22 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
switch (data[0]) {
case 0: /* start of frame */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
data += SPCA50X_OFFSET_DATA;
len -= SPCA50X_OFFSET_DATA;
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
break;
case 0xff: /* drop */
break;
default:
data += 1;
len -= 1;
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
break;
}
}

Просмотреть файл

@ -543,18 +543,15 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
switch (data[0]) {
case 0: /* start of frame */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
data += SPCA50X_OFFSET_DATA;
len -= SPCA50X_OFFSET_DATA;
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
break;
case 0xff: /* drop */
/* gspca_dev->last_packet_type = DISCARD_PACKET; */
@ -562,8 +559,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
default:
data += 1;
len -= 1;
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
break;
}
}

Просмотреть файл

@ -1447,26 +1447,22 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
switch (data[0]) {
case 0: /* start of frame */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
data += SPCA508_OFFSET_DATA;
len -= SPCA508_OFFSET_DATA;
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
break;
case 0xff: /* drop */
break;
default:
data += 1;
len -= 1;
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
break;
}
}

Просмотреть файл

@ -779,8 +779,7 @@ static void do_autogain(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -788,12 +787,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
len--;
switch (*data++) { /* sequence number */
case 0: /* start of frame */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
if (data[1] & 0x10) {
/* compressed bayer */
gspca_frame_add(gspca_dev, FIRST_PACKET,
frame, data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
} else {
/* raw bayer (with a header, which we skip) */
if (sd->chip_revision == Rev012A) {
@ -803,14 +800,13 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
data += 16;
len -= 16;
}
gspca_frame_add(gspca_dev, FIRST_PACKET,
frame, data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
}
return;
case 0xff: /* drop (empty mpackets) */
return;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
/* rev 72a only */

Просмотреть файл

@ -214,7 +214,6 @@ static void sq905_dostream(struct work_struct *work)
{
struct sd *dev = container_of(work, struct sd, work_struct);
struct gspca_dev *gspca_dev = &dev->gspca_dev;
struct gspca_frame *frame;
int bytes_left; /* bytes remaining in current frame. */
int data_len; /* size to use for the next read. */
int header_read; /* true if we have already read the frame header. */
@ -266,18 +265,14 @@ static void sq905_dostream(struct work_struct *work)
} else {
packet_type = INTER_PACKET;
}
frame = gspca_get_i_frame(gspca_dev);
if (frame) {
frame = gspca_frame_add(gspca_dev, packet_type,
frame, data, data_len);
/* If entire frame fits in one packet we still
need to add a LAST_PACKET */
if (packet_type == FIRST_PACKET &&
bytes_left == 0)
frame = gspca_frame_add(gspca_dev,
LAST_PACKET,
frame, data, 0);
}
gspca_frame_add(gspca_dev, packet_type,
data, data_len);
/* If entire frame fits in one packet we still
need to add a LAST_PACKET */
if (packet_type == FIRST_PACKET &&
bytes_left == 0)
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
}
if (gspca_dev->present) {
/* acknowledge the frame */

Просмотреть файл

@ -115,7 +115,6 @@ static void sq905c_dostream(struct work_struct *work)
{
struct sd *dev = container_of(work, struct sd, work_struct);
struct gspca_dev *gspca_dev = &dev->gspca_dev;
struct gspca_frame *frame;
int bytes_left; /* bytes remaining in current frame. */
int data_len; /* size to use for the next read. */
int act_len;
@ -146,10 +145,8 @@ static void sq905c_dostream(struct work_struct *work)
PDEBUG(D_STREAM, "bytes_left = 0x%x", bytes_left);
/* We keep the header. It has other information, too. */
packet_type = FIRST_PACKET;
frame = gspca_get_i_frame(gspca_dev);
if (frame)
gspca_frame_add(gspca_dev, packet_type,
frame, buffer, FRAME_HEADER_LEN);
gspca_frame_add(gspca_dev, packet_type,
buffer, FRAME_HEADER_LEN);
while (bytes_left > 0 && gspca_dev->present) {
data_len = bytes_left > SQ905C_MAX_TRANSFER ?
SQ905C_MAX_TRANSFER : bytes_left;
@ -167,9 +164,8 @@ static void sq905c_dostream(struct work_struct *work)
packet_type = LAST_PACKET;
else
packet_type = INTER_PACKET;
if (frame)
gspca_frame_add(gspca_dev, packet_type,
frame, buffer, data_len);
gspca_frame_add(gspca_dev, packet_type,
buffer, data_len);
}
}
quit_stream:

Просмотреть файл

@ -418,8 +418,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -435,11 +434,11 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
* (without ending - ff d9)
*/
if (data[0] == 0xff && data[1] == 0xfe) {
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
ffd9, 2);
gspca_frame_add(gspca_dev, LAST_PACKET,
ffd9, 2);
/* put the JPEG 411 header */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
sd->jpeg_hdr, JPEG_HDR_SZ);
/* beginning of the frame */
@ -447,7 +446,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
data += STKHDRSZ;
len -= STKHDRSZ;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -281,8 +281,7 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame,
__u8 *data,
u8 *data,
int len)
{
struct sd *sd = (struct sd *) gspca_dev;
@ -299,10 +298,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
/* Finish the previous frame, we do this upon reception of the next
packet, even though it is already complete so that the strange 16
byte packets send after a corrupt frame can discard it. */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame, NULL, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
/* Store the just received frame */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
}
/* sub-driver description */

Просмотреть файл

@ -312,8 +312,7 @@ out:
* The 0005 and 0100 chunks seem to appear only in compressed stream.
*/
static void stv06xx_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -366,7 +365,7 @@ frame_data:
sd->to_skip -= skip;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
data, chunk_len);
break;
@ -378,7 +377,7 @@ frame_data:
/* Create a new frame, chunk length should be zero */
gspca_frame_add(gspca_dev, FIRST_PACKET,
frame, data, 0);
NULL, 0);
if (sd->bridge == BRIDGE_ST6422)
sd->to_skip = gspca_dev->width * 4;
@ -394,8 +393,8 @@ frame_data:
PDEBUG(D_PACK, "End of frame detected");
/* Complete the last frame (if any) */
frame = gspca_frame_add(gspca_dev, LAST_PACKET,
frame, data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
if (chunk_len)
PDEBUG(D_ERR, "Chunk length is "

Просмотреть файл

@ -1116,7 +1116,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
@ -1186,11 +1185,11 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
break;
}
if (sof) { /* start of frame */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
ffd9, 2);
gspca_frame_add(gspca_dev, LAST_PACKET,
ffd9, 2);
/* put the JPEG header in the new frame */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
sd->jpeg_hdr, JPEG_HDR_SZ);
}
@ -1198,7 +1197,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
i = 0;
do {
if (data[i] == 0xff) {
gspca_frame_add(gspca_dev, INTER_PACKET, frame,
gspca_frame_add(gspca_dev, INTER_PACKET,
data, i + 1);
len -= i;
data += i;
@ -1207,7 +1206,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
}
i++;
} while (i < len);
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -938,7 +938,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
@ -956,9 +955,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
/* extra bytes....., could be processed too but would be
* a waste of time, right now leave the application and
* libjpeg do it for ourserlves.. */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
gspca_frame_add(gspca_dev, LAST_PACKET,
ffd9, 2);
gspca_frame_add(gspca_dev, FIRST_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
return;
}
@ -967,7 +966,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
* other's do not include it... */
len -= 2;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -398,8 +398,7 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -424,9 +423,9 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
* - 4 bytes
*/
gspca_frame_add(gspca_dev, packet_type0,
frame, data + 2, gspca_dev->width);
data + 2, gspca_dev->width);
gspca_frame_add(gspca_dev, packet_type1,
frame, data + gspca_dev->width + 5, gspca_dev->width);
data + gspca_dev->width + 5, gspca_dev->width);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -2987,7 +2987,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
u8 *data, /* isoc packet */
int len) /* iso pkt length */
{
@ -2996,21 +2995,25 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
if (data[0] == 0xff && data[1] == 0xd8) {
PDEBUG(D_PACK,
"vc032x header packet found len %d", len);
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
data += sd->image_offset;
len -= sd->image_offset;
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
data, len);
gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
return;
}
/* The vc0321 sends some additional data after sending the complete
* frame, we ignore this. */
if (sd->bridge == BRIDGE_VC0321
&& len > frame->v4l2_buf.length - (frame->data_end - frame->data))
len = frame->v4l2_buf.length - (frame->data_end - frame->data);
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
if (sd->bridge == BRIDGE_VC0321) {
struct gspca_frame *frame;
int l;
frame = gspca_get_i_frame(gspca_dev);
l = frame->data_end - frame->data;
if (len > frame->v4l2_buf.length - l)
len = frame->v4l2_buf.length - l;
}
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val)

Просмотреть файл

@ -576,8 +576,7 @@ static void w9968cf_stop0(struct sd *sd)
to be precise it sends: SOI, SOF, DRI, SOS, Y-data, SOS, U-data, SOS,
V-data, EOI. */
static void w9968cf_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame, /* target */
__u8 *data, /* isoc packet */
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
struct sd *sd = (struct sd *) gspca_dev;
@ -587,9 +586,9 @@ static void w9968cf_pkt_scan(struct gspca_dev *gspca_dev,
if (len >= 2 &&
data[0] == 0xff &&
data[1] == 0xd8) {
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
sd->jpeg_hdr, JPEG_HDR_SZ);
/* Strip the ff d8, our own header (which adds
huffman and quantization tables) already has this */
@ -599,12 +598,12 @@ static void w9968cf_pkt_scan(struct gspca_dev *gspca_dev,
} else {
/* In UYVY mode an empty packet signals EOF */
if (gspca_dev->empty_packet) {
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
NULL, 0);
gspca_dev->empty_packet = 0;
}
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}

Просмотреть файл

@ -6974,17 +6974,16 @@ static void sd_stop0(struct gspca_dev *gspca_dev)
}
static void sd_pkt_scan(struct gspca_dev *gspca_dev,
struct gspca_frame *frame,
__u8 *data,
u8 *data,
int len)
{
struct sd *sd = (struct sd *) gspca_dev;
if (data[0] == 0xff && data[1] == 0xd8) { /* start of frame */
frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
data, 0);
gspca_frame_add(gspca_dev, LAST_PACKET,
NULL, 0);
/* put the JPEG header in the new frame */
gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
gspca_frame_add(gspca_dev, FIRST_PACKET,
sd->jpeg_hdr, JPEG_HDR_SZ);
/* remove the webcam's header:
@ -6996,7 +6995,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
data += 18;
len -= 18;
}
gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)