From 28c51f3f2f4ce151ba57d70a2f0c462f9a43eb7d Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 16 Mar 2019 16:27:45 +0300 Subject: [PATCH] better help --- src/main.c | 102 ++++++++++++++++++++++++++--------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/main.c b/src/main.c index 4d5ef26..7f71f37 100644 --- a/src/main.c +++ b/src/main.c @@ -106,79 +106,79 @@ static void _version(bool nl) { static void _help(struct device_t *dev, struct encoder_t *encoder, struct http_server_t *server) { printf("\nuStreamer - Lightweight and fast MJPG-HTTP streamer\n"); - printf("===================================================\n\n"); + printf("═══════════════════════════════════════════════════\n\n"); printf("Version: "); _version(false); printf("; license: GPLv3\n"); printf("Copyright (C) 2018 Maxim Devaev \n\n"); printf("Capturing options:\n"); - printf("------------------\n"); - printf(" -d|--device -- Path to V4L2 device. Default: %s.\n\n", dev->path); - printf(" -i|--input -- Input channel. Default: %u.\n\n", dev->input); - printf(" -x|--width -- Initial image width. Default: %u.\n\n", dev->width); - printf(" -y|--height -- Initial image height. Default: %u.\n\n", dev->height); - printf(" -m|--format -- Image format.\n"); + printf("══════════════════\n"); + printf(" -d|--device ──────── Path to V4L2 device. Default: %s.\n\n", dev->path); + printf(" -i|--input ───────────────── Input channel. Default: %u.\n\n", dev->input); + printf(" -x|--width ───────────────── Initial image width. Default: %u.\n\n", dev->width); + printf(" -y|--height ──────────────── Initial image height. Default: %u.\n\n", dev->height); + printf(" -m|--format ────────────── Image format.\n"); printf(" Available: %s; default: YUYV.\n\n", FORMATS_STR); - printf(" -a|--tv-standard -- Force TV standard.\n"); + printf(" -a|--tv-standard ───────── Force TV standard.\n"); printf(" Available: %s; default: disabled.\n\n", STANDARDS_STR); - printf(" -f|--desired-fps -- Desired FPS. Default: maximum as possible.\n\n"); - printf(" -z|--min-frame-size -- Drop frames smaller then this limit.\n"); + printf(" -f|--desired-fps ─────────── Desired FPS. Default: maximum as possible.\n\n"); + printf(" -z|--min-frame-size ──────── Drop frames smaller then this limit.\n"); printf(" Useful if the device produces small-sized garbage frames.\n\n"); - printf(" -n|--persistent -- Don't re-initialize device on timeout. Default: disabled.\n\n"); - printf(" -t|--dv-timings -- Enable DV timings queriyng and events processing.\n"); + printf(" -n|--persistent ──────────────── Don't re-initialize device on timeout. Default: disabled.\n\n"); + printf(" -t|--dv-timings ──────────────── Enable DV timings queriyng and events processing.\n"); printf(" Supports automatic resolution changing. Default: disabled.\n\n"); - printf(" -b|--buffers -- The number of buffers to receive data from the device.\n"); + printf(" -b|--buffers ─────────────── The number of buffers to receive data from the device.\n"); printf(" Each buffer may processed using an intermediate thread.\n"); printf(" Default: %u (the number of CPU cores (but not more 4) + 1)\n\n", dev->n_buffers); - printf(" -w|--workers -- The number of worker threads. Default: %u (== --buffers).\n\n", dev->n_workers); - printf(" -q|--quality -- Set quality of JPEG encoding from 1 to 100 (best). Default: %u.\n\n", encoder->quality); - printf(" -c|--encoder -- Use specified encoder. It may affects to workers number.\n"); - printf(" -- Available: %s; default: CPU.\n\n", ENCODER_TYPES_STR); - printf(" --device-timeout -- Timeout for device querying. Default: %u\n\n", dev->timeout); - printf(" --device-error-delay -- Delay before trying to connect to the device again\n"); + printf(" -w|--workers ─────────────── The number of worker threads. Default: %u (== --buffers).\n\n", dev->n_workers); + printf(" -q|--quality ─────────────── Set quality of JPEG encoding from 1 to 100 (best). Default: %u.\n\n", encoder->quality); + printf(" -c|--encoder ──────────── Use specified encoder. It may affects to workers number.\n"); + printf(" Available: %s; default: CPU.\n\n", ENCODER_TYPES_STR); + printf(" --device-timeout ───── Timeout for device querying. Default: %u\n\n", dev->timeout); + printf(" --device-error-delay ─ Delay before trying to connect to the device again\n"); printf(" after timeout. Default: %u\n\n", dev->error_delay); printf("Image control options:\n"); - printf("---------------\n"); - printf(" --brightness -- Set brightness. Default: no change.\n\n"); - printf(" --brightness-auto -- Enable automatic brightness control. Default: no change.\n\n"); - printf(" --contrast -- Set contrast. Default: no change.\n\n"); - printf(" --saturation -- Set saturation. Default: no change.\n\n"); - printf(" --hue -- Set hue. Default: no change.\n\n"); - printf(" --hue-auto -- Enable automatic hue control. Default: no change.\n\n"); - printf(" --gamma -- Set gamma. Default: no change.\n\n"); - printf(" --sharpness -- Set sharpness. Default: no change.\n\n"); - printf(" --backlight-compensation -- Set backlight compensation. Default: no change.\n\n"); - printf(" --white-balance -- Set white balance. Default: no change.\n\n"); - printf(" --white-balance-auto -- Enable automatic white balance control. Default: no change.\n\n"); - printf(" --gain -- Set gain. Default: no change.\n\n"); - printf(" --gain-auto -- Enable automatic gain control. Default: no change.\n\n"); + printf("══════════════════════\n"); + printf(" --brightness ───────────── Set brightness. Default: no change.\n\n"); + printf(" --brightness-auto ──────────── Enable automatic brightness control. Default: no change.\n\n"); + printf(" --contrast ─────────────── Set contrast. Default: no change.\n\n"); + printf(" --saturation ───────────── Set saturation. Default: no change.\n\n"); + printf(" --hue ──────────────────── Set hue. Default: no change.\n\n"); + printf(" --hue-auto ─────────────────── Enable automatic hue control. Default: no change.\n\n"); + printf(" --gamma ────────────────── Set gamma. Default: no change.\n\n"); + printf(" --sharpness ────────────── Set sharpness. Default: no change.\n\n"); + printf(" --backlight-compensation ─ Set backlight compensation. Default: no change.\n\n"); + printf(" --white-balance ────────── Set white balance. Default: no change.\n\n"); + printf(" --white-balance-auto ───────── Enable automatic white balance control. Default: no change.\n\n"); + printf(" --gain ─────────────────── Set gain. Default: no change.\n\n"); + printf(" --gain-auto ────────────────── Enable automatic gain control. Default: no change.\n\n"); printf("HTTP server options:\n"); - printf("--------------------\n"); - printf(" -s|--host
-- Listen on Hostname or IP. Default: %s\n\n", server->host); - printf(" -p|--port -- Bind to this TCP port. Default: %u\n\n", server->port); - printf(" -u|--unix -- Bind to UNIX domain socket. Default: disabled\n\n"); - printf(" -r|--unix-rm -- Try to remove old UNIX socket file before binding. Default: disabled\n\n"); - printf(" -o|--unix-mode -- Set UNIX socket file permissions (like 777). Default: disabled\n\n"); - printf(" -e|--drop-same-frames -- Don't send same frames to clients, but no more than specified number.\n"); + printf("════════════════════\n"); + printf(" -s|--host
──────── Listen on Hostname or IP. Default: %s\n\n", server->host); + printf(" -p|--port ────────────── Bind to this TCP port. Default: %u\n\n", server->port); + printf(" -u|--unix ─────────── Bind to UNIX domain socket. Default: disabled\n\n"); + printf(" -r|--unix-rm ─────────────── Try to remove old UNIX socket file before binding. Default: disabled\n\n"); + printf(" -o|--unix-mode ────── Set UNIX socket file permissions (like 777). Default: disabled\n\n"); + printf(" -e|--drop-same-frames ── Don't send same frames to clients, but no more than specified number.\n"); printf(" It can significantly reduce the outgoing traffic, but will increase\n"); printf(" the CPU loading. Don't use this option with analog signal sources\n"); printf(" or webcams, it's useless. Default: disabled.\n\n"); - printf(" -l|--slowdown -- Slowdown capturing to 1 FPS or less when no stream clients connected.\n"); + printf(" -l|--slowdown ────────────── Slowdown capturing to 1 FPS or less when no stream clients connected.\n"); printf(" Useful to reduce CPU cosumption. Default: disabled.\n\n"); - printf(" --fake-width -- Override image width for /state. Default: disabled\n\n"); - printf(" --fake-height -- Override image height for /state. Default: disabled.\n\n"); - printf(" --server-timeout -- Timeout for client connections. Default: %u\n\n", server->timeout); + printf(" --fake-width ─────────── Override image width for /state. Default: disabled\n\n"); + printf(" --fake-height ────────── Override image height for /state. Default: disabled.\n\n"); + printf(" --server-timeout ─ Timeout for client connections. Default: %u\n\n", server->timeout); printf("Misc options:\n"); - printf("-------------\n"); - printf(" --log-level -- Verbosity level of messages from 0 (info) to 3 (debug).\n"); + printf("═════════════\n"); + printf(" --log-level ─ Verbosity level of messages from 0 (info) to 3 (debug).\n"); printf(" Enabling debugging messages can slow down the program.\n"); printf(" Available levels: 0=info, 1=performance, 2=verbose, 3=debug.\n"); printf(" Default: %u.\n\n", log_level); - printf(" --perf -- Enable performance messages (same as --log-level=1). Default: disabled.\n\n"); - printf(" --verbose -- Enable verbose messages and lower (same as --log-level=2). Default: disabled.\n\n"); - printf(" --debug -- Enable debug messages and lower (same as --log-level=3). Default: disabled.\n\n"); - printf(" -h|--help -- Print this text and exit.\n\n"); - printf(" -v|--version -- Print version and exit.\n\n"); + printf(" --perf ────────── Enable performance messages (same as --log-level=1). Default: disabled.\n\n"); + printf(" --verbose ─────── Enable verbose messages and lower (same as --log-level=2). Default: disabled.\n\n"); + printf(" --debug ───────── Enable debug messages and lower (same as --log-level=3). Default: disabled.\n\n"); + printf(" -h|--help ─────── Print this text and exit.\n\n"); + printf(" -v|--version ──── Print version and exit.\n\n"); } static int _parse_options(int argc, char *argv[], struct device_t *dev, struct encoder_t *encoder, struct http_server_t *server) {