|
From: Peter S. <pe...@st...> - 2011-04-15 16:55:15
|
From: Cristi Posoiu <cri...@gm...> This patch was taken from http://sourceforge.net/tracker/?func=detail&aid=3201636&group_id=178178&atid=884193 Signed-off-by: Peter Stuge <pe...@st...> --- stk11xx-usb.c | 2 ++ stk11xx-v4l.c | 40 ++++++++++++++++++++++++++++++++++++++++ stk11xx.h | 2 ++ 3 files changed, 44 insertions(+), 0 deletions(-) diff --git a/stk11xx-usb.c b/stk11xx-usb.c index c065aab..3494c0a 100644 --- a/stk11xx-usb.c +++ b/stk11xx-usb.c @@ -695,6 +695,8 @@ static int usb_stk11xx_default_settings(struct usb_stk11xx *dev) dev->vsettings.default_whiteness = dev->vsettings.whiteness; dev->vsettings.default_contrast = dev->vsettings.contrast; dev->vsettings.default_colour = dev->vsettings.colour; + dev->vsettings.default_hflip = dev->vsettings.hflip; + dev->vsettings.default_vflip = dev->vsettings.vflip; return 0; } diff --git a/stk11xx-v4l.c b/stk11xx-v4l.c index 69b2e23..0ddd345 100644 --- a/stk11xx-v4l.c +++ b/stk11xx-v4l.c @@ -122,6 +122,24 @@ static struct v4l2_queryctrl stk11xx_controls[] = { .step = 1, .default_value = 0x7f00, }, + { + .id = V4L2_CID_HFLIP, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .name = "Flip Horizontally", + .minimum = 0, + .maximum = 1, + .step = 1, + .default_value = 0, // will be actually set later + }, + { + .id = V4L2_CID_VFLIP, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .name = "Flip Vertically", + .minimum = 0, + .maximum = 1, + .step = 1, + .default_value = 0, // will be actually set later + } }; @@ -1115,6 +1133,12 @@ static long v4l_stk11xx_do_ioctl(struct file *fp, case V4L2_CID_CONTRAST: c->default_value = dev->vsettings.default_contrast; break; + case V4L2_CID_HFLIP: + c->default_value = dev->vsettings.default_hflip; + break; + case V4L2_CID_VFLIP: + c->default_value = dev->vsettings.default_vflip; + break; } break; } @@ -1152,6 +1176,14 @@ static long v4l_stk11xx_do_ioctl(struct file *fp, c->value = dev->vsettings.contrast; break; + case V4L2_CID_HFLIP: + c->value = dev->vsettings.hflip; + break; + + case V4L2_CID_VFLIP: + c->value = dev->vsettings.vflip; + break; + default: return -EINVAL; } @@ -1181,6 +1213,14 @@ static long v4l_stk11xx_do_ioctl(struct file *fp, dev->vsettings.contrast = (0xff00 & c->value); break; + case V4L2_CID_HFLIP: + dev->vsettings.hflip = c->value ? 1: 0; + break; + + case V4L2_CID_VFLIP: + dev->vsettings.vflip = c->value ? 1: 0; + break; + default: return -EINVAL; } diff --git a/stk11xx.h b/stk11xx.h index 719d2fb..338ae68 100644 --- a/stk11xx.h +++ b/stk11xx.h @@ -305,6 +305,8 @@ struct stk11xx_video { int default_contrast; int default_colour; int default_whiteness; + int default_hflip; + int default_vflip; }; -- 1.7.0.4 |