diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-06-27 21:48:33 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-30 23:38:24 +0200 |
commit | b56ab4ca1ca712f4b66b97c7f077883332c527b1 (patch) | |
tree | be913f704a0636ac8c619e76e335461a8339807e /drivers/media/video/gspca/sunplus.c | |
parent | [media] gspca: always call v4l2_ctrl_handler_setup after start (diff) | |
download | linux-b56ab4ca1ca712f4b66b97c7f077883332c527b1.tar.xz linux-b56ab4ca1ca712f4b66b97c7f077883332c527b1.zip |
[media] gspca: Remove bogus JPEG quality controls from various sub-drivers
Various gspca-subdrivers have a JPEG quality control which only changes
the quantization tables in the JPEG headers send to user-space without
making any changes to the settings of the bridge. Remove these bogus / wrong
controls.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/sunplus.c')
-rw-r--r-- | drivers/media/video/gspca/sunplus.c | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c index bd3d5a615384..c73748b2d21f 100644 --- a/drivers/media/video/gspca/sunplus.c +++ b/drivers/media/video/gspca/sunplus.c @@ -30,15 +30,12 @@ MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); MODULE_DESCRIPTION("GSPCA/SPCA5xx USB Camera Driver"); MODULE_LICENSE("GPL"); +#define QUALITY 85 + /* specific webcam descriptor */ struct sd { struct gspca_dev gspca_dev; /* !! must be the first item */ - struct v4l2_ctrl *jpegqual; -#define QUALITY_MIN 70 -#define QUALITY_MAX 95 -#define QUALITY_DEF 85 - bool autogain; u8 bridge; @@ -727,7 +724,7 @@ static int sd_start(struct gspca_dev *gspca_dev) /* create the JPEG header */ jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 0x22); /* JPEG 411 */ - jpeg_set_qual(sd->jpeg_hdr, v4l2_ctrl_g_ctrl(sd->jpegqual)); + jpeg_set_qual(sd->jpeg_hdr, QUALITY); if (sd->bridge == BRIDGE_SPCA504B) spca504B_setQtable(gspca_dev); @@ -932,27 +929,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, gspca_frame_add(gspca_dev, INTER_PACKET, data, len); } -static int sd_set_jcomp(struct gspca_dev *gspca_dev, - struct v4l2_jpegcompression *jcomp) -{ - struct sd *sd = (struct sd *) gspca_dev; - - v4l2_ctrl_s_ctrl(sd->jpegqual, jcomp->quality); - return 0; -} - -static int sd_get_jcomp(struct gspca_dev *gspca_dev, - struct v4l2_jpegcompression *jcomp) -{ - struct sd *sd = (struct sd *) gspca_dev; - - memset(jcomp, 0, sizeof *jcomp); - jcomp->quality = v4l2_ctrl_g_ctrl(sd->jpegqual); - jcomp->jpeg_markers = V4L2_JPEG_MARKER_DHT - | V4L2_JPEG_MARKER_DQT; - return 0; -} - static int sd_s_ctrl(struct v4l2_ctrl *ctrl) { struct gspca_dev *gspca_dev = @@ -977,9 +953,6 @@ static int sd_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_AUTOGAIN: sd->autogain = ctrl->val; break; - case V4L2_CID_JPEG_COMPRESSION_QUALITY: - jpeg_set_qual(sd->jpeg_hdr, ctrl->val); - break; } return gspca_dev->usb_err; } @@ -990,11 +963,10 @@ static const struct v4l2_ctrl_ops sd_ctrl_ops = { static int sd_init_controls(struct gspca_dev *gspca_dev) { - struct sd *sd = (struct sd *)gspca_dev; struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler; gspca_dev->vdev.ctrl_handler = hdl; - v4l2_ctrl_handler_init(hdl, 5); + v4l2_ctrl_handler_init(hdl, 4); v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, V4L2_CID_BRIGHTNESS, -128, 127, 1, 0); v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, @@ -1003,9 +975,6 @@ static int sd_init_controls(struct gspca_dev *gspca_dev) V4L2_CID_SATURATION, 0, 255, 1, 0x1a); v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, V4L2_CID_AUTOGAIN, 0, 1, 1, 1); - sd->jpegqual = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops, - V4L2_CID_JPEG_COMPRESSION_QUALITY, - QUALITY_MIN, QUALITY_MAX, 1, QUALITY_DEF); if (hdl->error) { pr_err("Could not initialize controls\n"); @@ -1023,8 +992,6 @@ static const struct sd_desc sd_desc = { .start = sd_start, .stopN = sd_stopN, .pkt_scan = sd_pkt_scan, - .get_jcomp = sd_get_jcomp, - .set_jcomp = sd_set_jcomp, }; /* -- module initialisation -- */ |