diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-07-23 07:06:49 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-07-23 14:57:52 -0300 |
commit | 3b12891e61bd88580c7c30a4dd1774a024253dcd (patch) | |
tree | 7a6a753b8d54f94a9ea9631074a194613a3dc9e6 /src/v4l.c | |
parent | 8a7bdf9d3b48ca50186864faae9e56928594286d (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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; } } |