]> rtime.felk.cvut.cz Git - frescor/demo.git/commitdiff
recorder: Allow specifying CPU contract label from command line
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 21 May 2010 14:17:09 +0000 (16:17 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 21 May 2010 14:17:09 +0000 (16:17 +0200)
src/recorder/ffmpeg.c

index 18790dc244bf479529433f8423399d1ef611f488..b190beff3a09890000b8ddec0b81f1a90348f8c4 100644 (file)
@@ -180,6 +180,7 @@ static int64_t rec_timestamp = 0;
 static int64_t input_ts_offset = 0;
 static int file_overwrite = 0;
 static int o_direct = 0;
+static const char *contract_label = "recorder";
 static int metadata_count;
 static AVMetadataTag *metadata;
 static int do_benchmark = 0;
@@ -2891,6 +2892,11 @@ static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
     return codec->id;
 }
 
+static void opt_contract_label(const char *label)
+{
+    contract_label = label;
+}
+
 static void opt_input_file(const char *filename)
 {
     AVFormatContext *ic;
@@ -3898,6 +3904,7 @@ static const OptionDef options[] = {
     { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
     { "i", HAS_ARG, {(void*)opt_input_file}, "input file name", "filename" },
     { "y", OPT_BOOL, {(void*)&file_overwrite}, "overwrite output files" },
+    { "contract_label", HAS_ARG, {(void*)opt_contract_label}, "contract label", "label" },
     { "direct", OPT_BOOL, {(void*)&o_direct}, "write to output file using direct I/O (O_DIRECT)" },
     { "map", HAS_ARG | OPT_EXPERT, {(void*)opt_map}, "set input stream mapping", "file:stream[:syncfile:syncstream]" },
     { "map_meta_data", HAS_ARG | OPT_EXPERT, {(void*)opt_map_meta_data}, "set meta data information of outfile from infile", "outfile:infile" },
@@ -4068,7 +4075,7 @@ int frsh_stuff()
                                         FRSH_CT_REGULAR);
     if (ret) PERROR_AND_EXIT(ret, "frsh_contract_set_basic_params");
     ret = frsh_contract_set_resource_and_label(&cpu_contract, 
-                                              FRSH_RT_PROCESSOR, FRSH_CPU_ID_DEFAULT, "recorder");
+                                              FRSH_RT_PROCESSOR, FRSH_CPU_ID_DEFAULT, contract_label);
     if (ret) PERROR_AND_EXIT(ret, "frsh_contract_set_resource_and_label");
 
     ret = frsh_contract_negotiate(&cpu_contract, &cpu_vres);