From e184e187a24e17b01d50a558b18cdfd8eebb5550 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 18 Aug 2020 12:15:44 +0300 Subject: [PATCH] option --color-effect --- src/device.c | 1 + src/device.h | 1 + src/options.c | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/src/device.c b/src/device.c index ce0dd42..849c5e4 100644 --- a/src/device.c +++ b/src/device.c @@ -736,6 +736,7 @@ static void _device_apply_controls(struct device_t *dev) { CONTROL_MANUAL_CID ( V4L2_CID_BACKLIGHT_COMPENSATION, backlight_compensation); CONTROL_AUTO_CID (V4L2_CID_AUTO_WHITE_BALANCE, V4L2_CID_WHITE_BALANCE_TEMPERATURE, white_balance); CONTROL_AUTO_CID (V4L2_CID_AUTOGAIN, V4L2_CID_GAIN, gain); + CONTROL_MANUAL_CID ( V4L2_CID_COLORFX, color_effect); CONTROL_MANUAL_CID ( V4L2_CID_VFLIP, flip_vertical); CONTROL_MANUAL_CID ( V4L2_CID_HFLIP, flip_horizontal); diff --git a/src/device.h b/src/device.h index 6853d0d..e564bbb 100644 --- a/src/device.h +++ b/src/device.h @@ -90,6 +90,7 @@ struct controls_t { struct control_t backlight_compensation; struct control_t white_balance; struct control_t gain; + struct control_t color_effect; struct control_t flip_vertical; struct control_t flip_horizontal; }; diff --git a/src/options.c b/src/options.c index 389d6bf..e5388ae 100644 --- a/src/options.c +++ b/src/options.c @@ -92,6 +92,7 @@ enum _OPT_VALUES { _O_BACKLIGHT_COMPENSATION, _O_WHITE_BALANCE, _O_GAIN, + _O_COLOR_EFFECT, _O_FLIP_VERTICAL, _O_FLIP_HORIZONTAL, @@ -157,6 +158,7 @@ static const struct option _LONG_OPTS[] = { {"backlight-compensation", required_argument, NULL, _O_BACKLIGHT_COMPENSATION}, {"white-balance", required_argument, NULL, _O_WHITE_BALANCE}, {"gain", required_argument, NULL, _O_GAIN}, + {"color-effect", required_argument, NULL, _O_COLOR_EFFECT}, {"flip-vertical", required_argument, NULL, _O_FLIP_VERTICAL}, {"flip-horizontal", required_argument, NULL, _O_FLIP_HORIZONTAL}, @@ -364,6 +366,7 @@ int options_parse(struct options_t *options, struct device_t *dev, struct encode OPT_CTL_DEFAULT_NOBREAK(backlight_compensation); OPT_CTL_DEFAULT_NOBREAK(white_balance); OPT_CTL_DEFAULT_NOBREAK(gain); + OPT_CTL_DEFAULT_NOBREAK(color_effect); OPT_CTL_DEFAULT_NOBREAK(flip_vertical); OPT_CTL_DEFAULT_NOBREAK(flip_horizontal); break; @@ -376,6 +379,7 @@ int options_parse(struct options_t *options, struct device_t *dev, struct encode case _O_BACKLIGHT_COMPENSATION: OPT_CTL_MANUAL(backlight_compensation); case _O_WHITE_BALANCE: OPT_CTL_AUTO(white_balance); case _O_GAIN: OPT_CTL_AUTO(gain); + case _O_COLOR_EFFECT: OPT_CTL_MANUAL(color_effect); case _O_FLIP_VERTICAL: OPT_CTL_MANUAL(flip_vertical); case _O_FLIP_HORIZONTAL: OPT_CTL_MANUAL(flip_horizontal); @@ -608,6 +612,7 @@ static void _help(struct device_t *dev, struct encoder_t *encoder, struct http_s printf(" --backlight-compensation ─ Set backlight compensation. Default: no change.\n\n"); printf(" --white-balance ───── Set white balance. Default: no change.\n\n"); printf(" --gain ────────────── Set gain. Default: no change.\n\n"); + printf(" --color-effect ─────────── Set color effect. Default: no change.\n\n"); printf(" --flip-vertical <1|0|default> ──────── Set vertical flip. Default: no change.\n\n"); printf(" --flip-horizontal <1|0|default> ────── Set horizontal flip. Default: no change.\n\n"); printf(" Hint: use v4l2-ctl --list-ctrls-menus to query available controls of the device.\n\n");