aboutsummaryrefslogtreecommitdiffstats
path: root/src/v4l.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-23 10:06:49 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-23 17:57:52 (GMT)
commit3b12891e61bd88580c7c30a4dd1774a024253dcd (patch)
tree7a6a753b8d54f94a9ea9631074a194613a3dc9e6 /src/v4l.c
parent8a7bdf9d3b48ca50186864faae9e56928594286d (diff)
Hide V4L2 controls if not present at the camera
Not all controls are available on all cameras. Be sure to show only the ones that apply to the camera used. While here, fix the callback logic for whitebalance
Diffstat (limited to 'src/v4l.c')
-rw-r--r--src/v4l.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/v4l.c b/src/v4l.c
index f265512..47c0fe6 100644
--- a/src/v4l.c
+++ b/src/v4l.c
@@ -173,30 +173,40 @@ void get_pic_info(cam * cam){
cam->hue = i;
if(cam->debug == TRUE)
printf("hue = %d\n", cam->hue);
+ } else {
+ cam->hue = -1;
}
i = v4l2_get_control(cam->dev, V4L2_CID_SATURATION);
if (i >= 0) {
cam->colour = i;
if(cam->debug == TRUE)
printf("colour = %d\n", cam->colour);
+ } else {
+ cam->colour = -1;
}
i = v4l2_get_control(cam->dev, V4L2_CID_CONTRAST);
if (i >= 0) {
cam->contrast = i;
if(cam->debug == TRUE)
printf("contrast = %d\n", cam->contrast);
+ } else {
+ cam->contrast = -1;
}
i = v4l2_get_control(cam->dev, V4L2_CID_WHITENESS);
if (i >= 0) {
cam->whiteness = i;
if(cam->debug == TRUE)
printf("whiteness = %d\n", cam->whiteness);
+ } else {
+ cam->whiteness = -1;
}
i = v4l2_get_control(cam->dev, V4L2_CID_BRIGHTNESS);
if (i >= 0) {
cam->brightness = i;
if(cam->debug == TRUE)
printf("brightness = %d\n", cam->brightness);
+ } else {
+ cam->brightness = -1;
}
}

Privacy Policy