]> rtime.felk.cvut.cz Git - frescor/streamer.git/commitdiff
Added options to specify network contract parameters.
authorPavel Pisa <pi@baree.pikron.com>
Thu, 28 May 2009 01:45:42 +0000 (03:45 +0200)
committerPavel Pisa <pi@baree.pikron.com>
Thu, 28 May 2009 01:45:42 +0000 (03:45 +0200)
Signed-off-by: Pavel Pisa <pi@baree.pikron.com>
streamer.c

index d082f3a3219916c1e19f484e7406b760bf80943b..1f85ce40850d0775b7ff99488bcd6f95b552a808 100644 (file)
 #include <frsh.h>
 #endif
 
+#ifdef CONFIG_STREAMER_WITH_FRSH
+/*temporrary solution to pass network parameters */
 extern long int udp_budget, udp_period;
+#endif /*CONFIG_STREAMER_WITH_FRSH*/
 
 static const char *sdp_file = "sdp.txt";
 static const char *vdev = "/dev/video0";
@@ -59,6 +62,10 @@ usage(void)
        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_STREAMER_WITH_FRSH
+       printf("  -b <number>    network budget\n");
+       printf("  -p <number>    network period for given budget\n");
+      #endif /*CONFIG_STREAMER_WITH_FRSH*/
       #ifdef CONFIG_OC_ULUT
        printf("  -l <number>|<domain>=<number>,...\n");
       #endif /*CONFIG_OC_ULUT*/
@@ -68,7 +75,7 @@ static int args_parse(int argc, char *argv[])
 {
   int v;
 
-  while ((v = getopt(argc, argv, "w:h:r:d:m:i:l:")) >= 0) {
+  while ((v = getopt(argc, argv, "w:h:r:d:m:i:l:b:p:")) >= 0) {
     switch (v) {
       case 'w':
         width = atoi(optarg);
@@ -92,6 +99,15 @@ static int args_parse(int argc, char *argv[])
        else if(!strcmp(impform, "v4l2"))
          impform = "video4linux2";
         break;
+      #ifdef CONFIG_STREAMER_WITH_FRSH
+      case 'b':
+       udp_budget = atol(optarg);
+       break;
+      case 'p':
+       udp_period = atol(optarg);
+       break;
+      #endif /*CONFIG_STREAMER_WITH_FRSH*/
+
       #ifdef CONFIG_OC_ULUT
       case 'l':
        ul_log_domain_arg2levels(optarg);
@@ -169,12 +185,12 @@ int main(int argc, char *argv[])
 #ifdef CONFIG_STREAMER_WITH_FRSH
   ret = frsh_init();
   if (ret) PERROR_AND_EXIT(ret, "frsh_init1");
-#endif /*CONFIG_STREAMER_WITH_FRSH*/
-  
-  /* fill contract params */
+
+  /* fill default network contract params */
   udp_budget = 50000; 
   udp_period = 500;
-  
+#endif /*CONFIG_STREAMER_WITH_FRSH*/
+
   avcodec_register_all();
   av_register_all();
   avdevice_register_all();