diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-12-04 03:06:08 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:38:55 -0500 |
commit | 8c252050146fc6f54e9bf5ef8276b25f3dd67a1c (patch) | |
tree | 101d02ee01b2554f2c22e892ed1c3e6e134b2b5b /drivers/media/video | |
parent | fb139224aea3b56237542690516eb9d6d671b135 (diff) |
V4L/DVB (9861): gspca - ov534: Accept many simultaneous webcams.
This patch moves the last fid and pts from static to the sd structure.
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/gspca/ov534.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index e02c8f70f814..28a7982792b3 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c | |||
@@ -48,6 +48,8 @@ static int frame_rate; | |||
48 | /* specific webcam descriptor */ | 48 | /* specific webcam descriptor */ |
49 | struct sd { | 49 | struct sd { |
50 | struct gspca_dev gspca_dev; /* !! must be the first item */ | 50 | struct gspca_dev gspca_dev; /* !! must be the first item */ |
51 | __u32 last_fid; | ||
52 | __u32 last_pts; | ||
51 | }; | 53 | }; |
52 | 54 | ||
53 | /* V4L2 controls supported by the driver */ | 55 | /* V4L2 controls supported by the driver */ |
@@ -397,9 +399,8 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
397 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, | 399 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, |
398 | __u8 *data, int len) | 400 | __u8 *data, int len) |
399 | { | 401 | { |
400 | static __u32 last_pts; | 402 | struct sd *sd = (struct sd *) gspca_dev; |
401 | __u32 this_pts; | 403 | __u32 this_pts; |
402 | static int last_fid; | ||
403 | int this_fid; | 404 | int this_fid; |
404 | 405 | ||
405 | /* Payloads are prefixed with a the UVC-style header. We | 406 | /* Payloads are prefixed with a the UVC-style header. We |
@@ -428,10 +429,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, | |||
428 | this_fid = (data[1] & UVC_STREAM_FID) ? 1 : 0; | 429 | this_fid = (data[1] & UVC_STREAM_FID) ? 1 : 0; |
429 | 430 | ||
430 | /* If PTS or FID has changed, start a new frame. */ | 431 | /* If PTS or FID has changed, start a new frame. */ |
431 | if (this_pts != last_pts || this_fid != last_fid) { | 432 | if (this_pts != sd->last_pts || this_fid != sd->last_fid) { |
432 | gspca_frame_add(gspca_dev, FIRST_PACKET, frame, NULL, 0); | 433 | gspca_frame_add(gspca_dev, FIRST_PACKET, frame, NULL, 0); |
433 | last_pts = this_pts; | 434 | sd->last_pts = this_pts; |
434 | last_fid = this_fid; | 435 | sd->last_fid = this_fid; |
435 | } | 436 | } |
436 | 437 | ||
437 | /* Add the data from this payload */ | 438 | /* Add the data from this payload */ |
@@ -440,7 +441,7 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, struct gspca_frame *frame, | |||
440 | 441 | ||
441 | /* If this packet is marked as EOF, end the frame */ | 442 | /* If this packet is marked as EOF, end the frame */ |
442 | if (data[1] & UVC_STREAM_EOF) { | 443 | if (data[1] & UVC_STREAM_EOF) { |
443 | last_pts = 0; | 444 | sd->last_pts = 0; |
444 | 445 | ||
445 | if ((frame->data_end - frame->data) != | 446 | if ((frame->data_end - frame->data) != |
446 | (gspca_dev->width * gspca_dev->height * 2)) { | 447 | (gspca_dev->width * gspca_dev->height * 2)) { |