aboutsummaryrefslogtreecommitdiffstats
path: root/src/callbacks.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-21 10:03:53 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-23 17:57:52 (GMT)
commitaa973596fd61d4e91f66cf53ab51cbed9042be30 (patch)
tree6815e1ceefb698496f35a1d5d7dcf9941d6f5313 /src/callbacks.c
parent2a14f1057ec37923a88dc7dea381299a32a22f7f (diff)
Optimize the logic with sets control values
No need to write all controls when just one changes.
Diffstat (limited to 'src/callbacks.c')
-rw-r--r--src/callbacks.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index 0a0ee6c..0b193c8 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -641,35 +641,35 @@ void contrast_change (GtkHScale * sc1, cam * cam)
{
cam->contrast = 256 * (int) gtk_range_get_value ((GtkRange *) sc1);
- set_pic_info (cam);
+ v4l2_set_control(cam->dev, V4L2_CID_CONTRAST, cam->contrast);
}
void brightness_change (GtkHScale * sc1, cam * cam)
{
cam->brightness = 256 * (int) gtk_range_get_value ((GtkRange *) sc1);
- set_pic_info (cam);
+ v4l2_set_control(cam->dev, V4L2_CID_BRIGHTNESS, cam->brightness);
}
void colour_change (GtkHScale * sc1, cam * cam)
{
cam->colour = 256 * (int) gtk_range_get_value ((GtkRange *) sc1);
- set_pic_info (cam);
+ v4l2_set_control(cam->dev, V4L2_CID_SATURATION, cam->colour);
}
void hue_change (GtkHScale * sc1, cam * cam)
{
cam->hue = 256 * (int) gtk_range_get_value ((GtkRange *) sc1);
- set_pic_info (cam);
+ v4l2_set_control(cam->dev, V4L2_CID_HUE, cam->hue);
}
void wb_change (GtkHScale * sc1, cam * cam)
{
cam->whiteness = 256 * (int) gtk_range_get_value ((GtkRange *) sc1);
- set_pic_info (cam);
+ v4l2_set_control(cam->dev, V4L2_CID_WHITENESS, cam->whiteness);
}
void help_cb (GtkWidget * widget, gpointer data)

Privacy Policy