]> rtime.felk.cvut.cz Git - frescor/streamer.git/commitdiff
Added parsing of loglevels and options usage text.
authorPavel Pisa <pi@baree.pikron.com>
Tue, 26 May 2009 12:56:50 +0000 (14:56 +0200)
committerPavel Pisa <pi@baree.pikron.com>
Tue, 26 May 2009 12:56:50 +0000 (14:56 +0200)
Signed-off-by: Pavel Pisa <pi@baree.pikron.com>
Makefile.omk
streamer.c

index 3d9c6793af2b757b3752c37b688f459ef73e77d7..4c623347e692fdfa84eeb84fa16e3ece122c9ec1 100644 (file)
@@ -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
 
index 739ab5cd9cf5f44d4cf5e28a9602a57e95b9a2c6..a7e4119d1eb580703fed2567191cdefb32c9abf0 100644 (file)
 
 #include "streamer_config.h"
 
+#ifdef CONFIG_OC_ULUT
+#include <ul_log.h>
+#include <ul_logreg.h>
+#endif
+
 #ifdef CONFIG_STREAMER_WITH_FRSH
 #include <frsh.h>
 #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 <number>    send image width\n");
+       printf("  -h <number>    send image height\n");
+       printf("  -r <number>    refresh rate\n");
+       printf("  -r <path>      video device [%s]\n", vdev);
+       printf("  -m <addr>      destination IP address\n");
+       printf("  -i <string>    input video device format [%s]\n", impform);
+      #ifdef CONFIG_OC_ULUT
+       printf("  -l <number>|<domain>=<number>,...\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);
     }
   }