diff options
Diffstat (limited to 'drivers/media/video/gspca/ov519.c')
| -rw-r--r-- | drivers/media/video/gspca/ov519.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index f36e11a0458..2b2cbdbf03f 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
| @@ -41,6 +41,11 @@ | |||
| 41 | #include <linux/input.h> | 41 | #include <linux/input.h> |
| 42 | #include "gspca.h" | 42 | #include "gspca.h" |
| 43 | 43 | ||
| 44 | /* The jpeg_hdr is used by w996Xcf only */ | ||
| 45 | /* The CONEX_CAM define for jpeg.h needs renaming, now its used here too */ | ||
| 46 | #define CONEX_CAM | ||
| 47 | #include "jpeg.h" | ||
| 48 | |||
| 44 | MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>"); | 49 | MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>"); |
| 45 | MODULE_DESCRIPTION("OV519 USB Camera Driver"); | 50 | MODULE_DESCRIPTION("OV519 USB Camera Driver"); |
| 46 | MODULE_LICENSE("GPL"); | 51 | MODULE_LICENSE("GPL"); |
| @@ -90,6 +95,7 @@ struct sd { | |||
| 90 | #define QUALITY_DEF 50 | 95 | #define QUALITY_DEF 50 |
| 91 | 96 | ||
| 92 | __u8 stopped; /* Streaming is temporarily paused */ | 97 | __u8 stopped; /* Streaming is temporarily paused */ |
| 98 | __u8 first_frame; | ||
| 93 | 99 | ||
| 94 | __u8 frame_rate; /* current Framerate */ | 100 | __u8 frame_rate; /* current Framerate */ |
| 95 | __u8 clockdiv; /* clockdiv override */ | 101 | __u8 clockdiv; /* clockdiv override */ |
| @@ -115,7 +121,7 @@ struct sd { | |||
| 115 | int sensor_height; | 121 | int sensor_height; |
| 116 | int sensor_reg_cache[256]; | 122 | int sensor_reg_cache[256]; |
| 117 | 123 | ||
| 118 | u8 *jpeg_hdr; | 124 | u8 jpeg_hdr[JPEG_HDR_SZ]; |
| 119 | }; | 125 | }; |
| 120 | 126 | ||
| 121 | /* Note this is a bit of a hack, but the w9968cf driver needs the code for all | 127 | /* Note this is a bit of a hack, but the w9968cf driver needs the code for all |
| @@ -3147,7 +3153,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
| 3147 | sd->autobrightness = AUTOBRIGHT_DEF; | 3153 | sd->autobrightness = AUTOBRIGHT_DEF; |
| 3148 | if (sd->sensor == SEN_OV7670) { | 3154 | if (sd->sensor == SEN_OV7670) { |
| 3149 | sd->freq = OV7670_FREQ_DEF; | 3155 | sd->freq = OV7670_FREQ_DEF; |
| 3150 | gspca_dev->ctrl_dis = 1 << FREQ_IDX; | 3156 | gspca_dev->ctrl_dis = (1 << FREQ_IDX) | (1 << COLOR_IDX); |
| 3151 | } else { | 3157 | } else { |
| 3152 | sd->freq = FREQ_DEF; | 3158 | sd->freq = FREQ_DEF; |
| 3153 | gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX) | | 3159 | gspca_dev->ctrl_dis = (1 << HFLIP_IDX) | (1 << VFLIP_IDX) | |
| @@ -3961,6 +3967,8 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
| 3961 | sd_reset_snapshot(gspca_dev); | 3967 | sd_reset_snapshot(gspca_dev); |
| 3962 | sd->snapshot_pressed = 0; | 3968 | sd->snapshot_pressed = 0; |
| 3963 | 3969 | ||
| 3970 | sd->first_frame = 3; | ||
| 3971 | |||
| 3964 | ret = ov51x_restart(sd); | 3972 | ret = ov51x_restart(sd); |
| 3965 | if (ret < 0) | 3973 | if (ret < 0) |
| 3966 | goto out; | 3974 | goto out; |
| @@ -4153,13 +4161,23 @@ static void ovfx2_pkt_scan(struct gspca_dev *gspca_dev, | |||
| 4153 | u8 *data, /* isoc packet */ | 4161 | u8 *data, /* isoc packet */ |
| 4154 | int len) /* iso packet length */ | 4162 | int len) /* iso packet length */ |
| 4155 | { | 4163 | { |
| 4164 | struct sd *sd = (struct sd *) gspca_dev; | ||
| 4165 | |||
| 4166 | gspca_frame_add(gspca_dev, INTER_PACKET, data, len); | ||
| 4167 | |||
| 4156 | /* A short read signals EOF */ | 4168 | /* A short read signals EOF */ |
| 4157 | if (len < OVFX2_BULK_SIZE) { | 4169 | if (len < OVFX2_BULK_SIZE) { |
| 4158 | gspca_frame_add(gspca_dev, LAST_PACKET, data, len); | 4170 | /* If the frame is short, and it is one of the first ones |
| 4171 | the sensor and bridge are still syncing, so drop it. */ | ||
| 4172 | if (sd->first_frame) { | ||
| 4173 | sd->first_frame--; | ||
| 4174 | if (gspca_dev->image_len < | ||
| 4175 | sd->gspca_dev.width * sd->gspca_dev.height) | ||
| 4176 | gspca_dev->last_packet_type = DISCARD_PACKET; | ||
| 4177 | } | ||
| 4178 | gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0); | ||
| 4159 | gspca_frame_add(gspca_dev, FIRST_PACKET, NULL, 0); | 4179 | gspca_frame_add(gspca_dev, FIRST_PACKET, NULL, 0); |
| 4160 | return; | ||
| 4161 | } | 4180 | } |
| 4162 | gspca_frame_add(gspca_dev, INTER_PACKET, data, len); | ||
| 4163 | } | 4181 | } |
| 4164 | 4182 | ||
| 4165 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 4183 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
