From a122a80894cbf5ad70919d93970faca4bcd61491 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Tue, 26 May 2009 14:56:50 +0200 Subject: [PATCH] Added parsing of loglevels and options usage text. Signed-off-by: Pavel Pisa --- Makefile.omk | 1 + streamer.c | 31 +++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Makefile.omk b/Makefile.omk index 3d9c679..4c62334 100644 --- a/Makefile.omk +++ b/Makefile.omk @@ -1,5 +1,6 @@ default_CONFIG += CONFIG_STREAMER_WITH_FRSH=y default_CONFIG += CONFIG_AQUOSA=x +default_CONFIG += CONFIG_OC_ULUT=x LOCAL_CONFIG_H = streamer_config.h diff --git a/streamer.c b/streamer.c index 739ab5c..a7e4119 100644 --- a/streamer.c +++ b/streamer.c @@ -17,6 +17,11 @@ #include "streamer_config.h" +#ifdef CONFIG_OC_ULUT +#include +#include +#endif + #ifdef CONFIG_STREAMER_WITH_FRSH #include #endif @@ -43,11 +48,26 @@ static void sdp_print(AVFormatContext *s, const char *fname) fclose(f); } +static void +usage(void) +{ + printf("usage: streamer [ options ]\n"); + printf(" -w send image width\n"); + printf(" -h send image height\n"); + printf(" -r refresh rate\n"); + printf(" -r video device [%s]\n", vdev); + printf(" -m destination IP address\n"); + printf(" -i input video device format [%s]\n", impform); + #ifdef CONFIG_OC_ULUT + printf(" -l |=,...\n"); + #endif /*CONFIG_OC_ULUT*/ +} + static int args_parse(int argc, char *argv[]) { int v; - while ((v = getopt(argc, argv, "w:h:r:d:m:i:")) >= 0) { + while ((v = getopt(argc, argv, "w:h:r:d:m:i:l:")) >= 0) { switch (v) { case 'w': width = atoi(optarg); @@ -71,8 +91,15 @@ static int args_parse(int argc, char *argv[]) else if(!strcmp(impform, "v4l2")) impform = "video4linux2"; break; - default: /* ’?’ */ + #ifdef CONFIG_OC_ULUT + case 'l': + ul_log_domain_arg2levels(optarg); + break; + #endif /*CONFIG_OC_ULUT*/ + + default: /* unknown option */ fprintf(stderr, "%s: illegal option %c\n", argv[0], v); + usage(); exit(-1); } } -- 2.39.2