diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-12-31 06:47:07 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-06 07:45:26 -0500 |
commit | 115f418bfa7575fbd1422d7fd274a2425260beb2 (patch) | |
tree | 2ce249f699d355a850ef28fd71cd892aa531fe57 /drivers | |
parent | 1516524ff299d803ff530495fd66b514ec962f75 (diff) |
[media] pwc: Remove driver specific use of pixfmt.priv in the pwc driver
The .priv field never was intended for this, setting a framerate is
support using the standardized S_PARM ioctl.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/pwc/pwc-v4l.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c index 566b09c79802..8b862b6916f6 100644 --- a/drivers/media/video/pwc/pwc-v4l.c +++ b/drivers/media/video/pwc/pwc-v4l.c | |||
@@ -473,7 +473,7 @@ static int pwc_vidioc_try_fmt(struct pwc_device *pdev, struct v4l2_format *f) | |||
473 | static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) | 473 | static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) |
474 | { | 474 | { |
475 | struct pwc_device *pdev = video_drvdata(file); | 475 | struct pwc_device *pdev = video_drvdata(file); |
476 | int ret, fps, snapshot, compression, pixelformat; | 476 | int ret, pixelformat; |
477 | 477 | ||
478 | if (pwc_test_n_set_capt_file(pdev, file)) | 478 | if (pwc_test_n_set_capt_file(pdev, file)) |
479 | return -EBUSY; | 479 | return -EBUSY; |
@@ -483,16 +483,6 @@ static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) | |||
483 | return ret; | 483 | return ret; |
484 | 484 | ||
485 | pixelformat = f->fmt.pix.pixelformat; | 485 | pixelformat = f->fmt.pix.pixelformat; |
486 | compression = pdev->vcompression; | ||
487 | snapshot = 0; | ||
488 | fps = pdev->vframes; | ||
489 | if (f->fmt.pix.priv) { | ||
490 | compression = (f->fmt.pix.priv & PWC_QLT_MASK) >> PWC_QLT_SHIFT; | ||
491 | snapshot = !!(f->fmt.pix.priv & PWC_FPS_SNAPSHOT); | ||
492 | fps = (f->fmt.pix.priv & PWC_FPS_FRMASK) >> PWC_FPS_SHIFT; | ||
493 | if (fps == 0) | ||
494 | fps = pdev->vframes; | ||
495 | } | ||
496 | 486 | ||
497 | if (pixelformat != V4L2_PIX_FMT_YUV420 && | 487 | if (pixelformat != V4L2_PIX_FMT_YUV420 && |
498 | pixelformat != V4L2_PIX_FMT_PWC1 && | 488 | pixelformat != V4L2_PIX_FMT_PWC1 && |
@@ -511,9 +501,9 @@ static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) | |||
511 | } | 501 | } |
512 | 502 | ||
513 | PWC_DEBUG_IOCTL("Trying to set format to: width=%d height=%d fps=%d " | 503 | PWC_DEBUG_IOCTL("Trying to set format to: width=%d height=%d fps=%d " |
514 | "compression=%d snapshot=%d format=%c%c%c%c\n", | 504 | "compression=%d format=%c%c%c%c\n", |
515 | f->fmt.pix.width, f->fmt.pix.height, fps, | 505 | f->fmt.pix.width, f->fmt.pix.height, pdev->vframes, |
516 | compression, snapshot, | 506 | pdev->vcompression, |
517 | (pixelformat)&255, | 507 | (pixelformat)&255, |
518 | (pixelformat>>8)&255, | 508 | (pixelformat>>8)&255, |
519 | (pixelformat>>16)&255, | 509 | (pixelformat>>16)&255, |
@@ -522,9 +512,8 @@ static int pwc_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) | |||
522 | ret = pwc_set_video_mode(pdev, | 512 | ret = pwc_set_video_mode(pdev, |
523 | f->fmt.pix.width, | 513 | f->fmt.pix.width, |
524 | f->fmt.pix.height, | 514 | f->fmt.pix.height, |
525 | fps, | 515 | pdev->vframes, |
526 | compression, | 516 | pdev->vcompression, 0); |
527 | snapshot); | ||
528 | 517 | ||
529 | PWC_DEBUG_IOCTL("pwc_set_video_mode(), return=%d\n", ret); | 518 | PWC_DEBUG_IOCTL("pwc_set_video_mode(), return=%d\n", ret); |
530 | 519 | ||