]> rtime.felk.cvut.cz Git - frescor/streamer.git/blobdiff - streamer.c
Fixed streamer CPU reservation
[frescor/streamer.git] / streamer.c
index 28d5b7e1407802601161ae3df31333f49e22ee5e..06da889112d95a696a3d96253e9069025dcdd1c1 100644 (file)
@@ -65,6 +65,7 @@ usage(void)
        printf("  -i <string>    input video device format [%s]\n", impform);
        printf("  -p <port>      destination port [%d]\n", dport);
        printf("  -b <bitrate>   bitrate in b/s [%d]\n", bitrate);
+       printf("  -s <sdp_file>  name of output sdp file [%s]\n", sdp_file);
       #ifdef CONFIG_OC_ULUT
        printf("  -l <number>|<domain>=<number>,...\n");
       #endif /*CONFIG_OC_ULUT*/
@@ -74,8 +75,11 @@ static int args_parse(int argc, char *argv[])
 {
   int v;
 
-  while ((v = getopt(argc, argv, "w:h:r:d:m:i:l:b:p:")) >= 0) {
+  while ((v = getopt(argc, argv, "w:h:r:d:m:i:l:b:p:s:")) >= 0) {
     switch (v) {
+      case 's':
+       sdp_file = optarg;
+       break;
       case 'p':
         dport = atoi(optarg);
         break;
@@ -251,7 +255,7 @@ int main(int argc, char *argv[])
     return -1;
   }
   codec_open(s);
-  os = open_output_stream(dst, dport, CODEC_TYPE_VIDEO);
+  os = open_output_stream(dst, dport, CODEC_TYPE_VIDEO, fps);
   if (os == NULL) {
     fprintf(stderr, "Cannot open output stream\n");
 
@@ -266,15 +270,15 @@ int main(int argc, char *argv[])
   dump_format(os, 0, os->filename, 1);
   sdp_print(os, sdp_file);
 
-#if CONFIG_STREAMER_WITH_FRSH && CONFIG_AQUOSA 
+#if CONFIG_FFMPEG_WITH_FRSH && CONFIG_AQUOSA
   frsh_thread_attr_t frsh_attr;
   frsh_thread_id_t thread;
   frsh_vres_id_t cpu_vres;
   frsh_contract_t cpu_contract;
   frsh_rel_time_t cpu_budget, cpu_period;
  
-  cpu_budget = fosa_msec_to_rel_time(50);
-  cpu_period = fosa_msec_to_rel_time(100);
+  cpu_budget = fosa_msec_to_rel_time(10);
+  cpu_period = fosa_msec_to_rel_time(1000/fps);
   /* Contract negotiation for CPU */
   ret = frsh_contract_init(&cpu_contract);
   if (ret) PERROR_AND_EXIT(ret, "CPU:frsh_contract_init");