mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-05-27 07:46:15 +00:00
Added backlight_compensation, white_balance and gain
This commit is contained in:
15
src/device.c
15
src/device.c
@@ -383,12 +383,15 @@ static void _device_open_set_image_settings(struct device_t *dev) {
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_CID_AUTO (V4L2_CID_AUTOBRIGHTNESS, V4L2_CID_BRIGHTNESS, brightness);
|
SET_CID_AUTO (V4L2_CID_AUTOBRIGHTNESS, V4L2_CID_BRIGHTNESS, brightness);
|
||||||
SET_CID_MANUAL ( V4L2_CID_CONTRAST, contrast);
|
SET_CID_MANUAL ( V4L2_CID_CONTRAST, contrast);
|
||||||
SET_CID_MANUAL ( V4L2_CID_SATURATION, saturation);
|
SET_CID_MANUAL ( V4L2_CID_SATURATION, saturation);
|
||||||
SET_CID_AUTO (V4L2_CID_HUE_AUTO, V4L2_CID_HUE, hue);
|
SET_CID_AUTO (V4L2_CID_HUE_AUTO, V4L2_CID_HUE, hue);
|
||||||
SET_CID_MANUAL ( V4L2_CID_GAMMA, gamma);
|
SET_CID_MANUAL ( V4L2_CID_GAMMA, gamma);
|
||||||
SET_CID_MANUAL ( V4L2_CID_SHARPNESS, sharpness);
|
SET_CID_MANUAL ( V4L2_CID_SHARPNESS, sharpness);
|
||||||
|
SET_CID_MANUAL ( V4L2_CID_BACKLIGHT_COMPENSATION, backlight_compensation);
|
||||||
|
SET_CID_AUTO (V4L2_CID_AUTO_WHITE_BALANCE, V4L2_CID_WHITE_BALANCE_TEMPERATURE, white_balance);
|
||||||
|
SET_CID_AUTO (V4L2_CID_AUTOGAIN, V4L2_CID_GAIN, gain);
|
||||||
|
|
||||||
# undef SET_CID_AUTO
|
# undef SET_CID_AUTO
|
||||||
# undef SET_CID_MANUAL
|
# undef SET_CID_MANUAL
|
||||||
|
|||||||
@@ -79,6 +79,9 @@ struct image_settings_t {
|
|||||||
S_AUTO (hue);
|
S_AUTO (hue);
|
||||||
S_MANUAL (gamma);
|
S_MANUAL (gamma);
|
||||||
S_MANUAL (sharpness);
|
S_MANUAL (sharpness);
|
||||||
|
S_MANUAL (backlight_compensation);
|
||||||
|
S_AUTO (white_balance);
|
||||||
|
S_AUTO (gain);
|
||||||
};
|
};
|
||||||
|
|
||||||
#undef S_AUTO
|
#undef S_AUTO
|
||||||
|
|||||||
31
src/main.c
31
src/main.c
@@ -68,6 +68,11 @@ static const struct option _long_opts[] = {
|
|||||||
{"image-hue-auto", no_argument, NULL, 2005},
|
{"image-hue-auto", no_argument, NULL, 2005},
|
||||||
{"image-gamma", required_argument, NULL, 2006},
|
{"image-gamma", required_argument, NULL, 2006},
|
||||||
{"image-sharpness", required_argument, NULL, 2007},
|
{"image-sharpness", required_argument, NULL, 2007},
|
||||||
|
{"image-backlight-compensation", required_argument, NULL, 2008},
|
||||||
|
{"image-white-balance", required_argument, NULL, 2009},
|
||||||
|
{"image-white-balance-auto", no_argument, NULL, 2010},
|
||||||
|
{"image-gain", required_argument, NULL, 2011},
|
||||||
|
{"image-gain-auto", no_argument, NULL, 2012},
|
||||||
|
|
||||||
{"host", required_argument, NULL, 's'},
|
{"host", required_argument, NULL, 's'},
|
||||||
{"port", required_argument, NULL, 'p'},
|
{"port", required_argument, NULL, 'p'},
|
||||||
@@ -133,14 +138,19 @@ static void _help(struct device_t *dev, struct encoder_t *encoder, struct http_s
|
|||||||
printf(" after a timeout. Default: %u\n\n", dev->error_delay);
|
printf(" after a timeout. Default: %u\n\n", dev->error_delay);
|
||||||
printf("Image options:\n");
|
printf("Image options:\n");
|
||||||
printf("---------------\n");
|
printf("---------------\n");
|
||||||
printf(" --image-brightness <N> -- Set brightness. Default: no change.\n\n");
|
printf(" --image-brightness <N> -- Set brightness. Default: no change.\n\n");
|
||||||
printf(" --image-brightness-auto -- Enable automatic brightness control. Default: no change.\n\n");
|
printf(" --image-brightness-auto -- Enable automatic brightness control. Default: no change.\n\n");
|
||||||
printf(" --image-contrast <N> -- Set contrast. Default: no change.\n\n");
|
printf(" --image-contrast <N> -- Set contrast. Default: no change.\n\n");
|
||||||
printf(" --image-saturation <N> -- Set saturation. Default: no change.\n\n");
|
printf(" --image-saturation <N> -- Set saturation. Default: no change.\n\n");
|
||||||
printf(" --image-hue <N> -- Set hue. Default: no change.\n\n");
|
printf(" --image-hue <N> -- Set hue. Default: no change.\n\n");
|
||||||
printf(" --image-hue-auto -- Enable automatic hue control. Default: no change.\n\n");
|
printf(" --image-hue-auto -- Enable automatic hue control. Default: no change.\n\n");
|
||||||
printf(" --image-gamma <N> -- Set gamma. Default: no change.\n\n");
|
printf(" --image-gamma <N> -- Set gamma. Default: no change.\n\n");
|
||||||
printf(" --image-sharpness <N> -- Set sharpness. Default: no change.\n\n");
|
printf(" --image-sharpness <N> -- Set sharpness. Default: no change.\n\n");
|
||||||
|
printf(" --image-backlight-compensation <N> -- Set backlight compensation. Default: no change.\n\n");
|
||||||
|
printf(" --image-white-combalance <N> -- Set white balance. Default: no change.\n\n");
|
||||||
|
printf(" --image-white-combalance-auto -- Enable automatic white balance control. Default: no change.\n\n");
|
||||||
|
printf(" --image-gain <N> -- Set gain. Default: no change.\n\n");
|
||||||
|
printf(" --image-gain-auto -- Enable automatic gain control. Default: no change.\n\n");
|
||||||
printf("HTTP server options:\n");
|
printf("HTTP server options:\n");
|
||||||
printf("--------------------\n");
|
printf("--------------------\n");
|
||||||
printf(" -s|--host <address> -- Listen on Hostname or IP. Default: %s\n\n", server->host);
|
printf(" -s|--host <address> -- Listen on Hostname or IP. Default: %s\n\n", server->host);
|
||||||
@@ -241,6 +251,11 @@ static int _parse_options(int argc, char *argv[], struct device_t *dev, struct e
|
|||||||
case 2005: OPT_IMG_AUTO(hue);
|
case 2005: OPT_IMG_AUTO(hue);
|
||||||
case 2006: OPT_IMG(gamma);
|
case 2006: OPT_IMG(gamma);
|
||||||
case 2007: OPT_IMG(sharpness);
|
case 2007: OPT_IMG(sharpness);
|
||||||
|
case 2008: OPT_IMG(backlight_compensation);
|
||||||
|
case 2009: OPT_IMG(white_balance);
|
||||||
|
case 2010: OPT_IMG_AUTO(white_balance);
|
||||||
|
case 2011: OPT_IMG(gain);
|
||||||
|
case 2012: OPT_IMG_AUTO(gain);
|
||||||
|
|
||||||
case 's': OPT_SET(server->host, optarg);
|
case 's': OPT_SET(server->host, optarg);
|
||||||
case 'p': OPT_UNSIGNED(server->port, "--port", 1, 65535);
|
case 'p': OPT_UNSIGNED(server->port, "--port", 1, 65535);
|
||||||
|
|||||||
Reference in New Issue
Block a user