static int64_t rec_timestamp = 0;
static int64_t input_ts_offset = 0;
static int file_overwrite = 0;
+static int o_direct = 0;
static int metadata_count;
static AVMetadataTag *metadata;
static int do_benchmark = 0;
}
/* open the file */
- if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) {
+ o_direct = 1;
+ if (url_fopen(&oc->pb, filename, o_direct ? URL_RDWR|URL_DIRECT : URL_WRONLY) < 0) {
fprintf(stderr, "Could not open '%s'\n", filename);
av_exit(1);
}
+
+ if (0) {
+ int i;
+ for (i=0; i<0x81; i++) {
+ put_le32(oc->pb, i);
+ if (i==0x42)
+ put_flush_packet(oc->pb);
+ }
+ url_close_buf(oc->pb);
+ url_fclose(oc->pb);
+ exit(0);
+ }
}
memset(ap, 0, sizeof(*ap));
{ "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" },
+ { "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" },
{ "t", OPT_FUNC2 | HAS_ARG, {(void*)opt_recording_time}, "record or transcode \"duration\" seconds of audio/video", "duration" },
/* bind this thread to vres */
thread_id = fosa_thread_self();
- /* PXW(frsh_thread_bind(disk_vres, thread_id)); */
+ PXW(frsh_thread_bind(disk_vres, thread_id));
ret = av_encode(output_files, nb_output_files,
input_files, nb_input_files,
cpu_budget = fosa_msec_to_rel_time(5);
cpu_period = fosa_msec_to_rel_time(1000/50);
-/* #define DISK_THROUGHPUT 20277LLU /\* units??? probably MB/s *\/ */
-/* disk_budget = fosa_nsec_to_rel_time(1000000000LLU/\*nsec/s*\/ * 500000 /\*bytes/s*\/ */
-/* / (DISK_THROUGHPUT*1000000) /\* bytes *\/); // is this correct? */
+#if 1
+#define DISK_THROUGHPUT 20277LLU /* units??? probably MB/s */
+ disk_budget = fosa_nsec_to_rel_time(1000000000LLU/*nsec/s*/ * 500000 /*bytes/s*/
+ / (DISK_THROUGHPUT*1000000) /* bytes */); // is this correct?
+#else
disk_budget = fosa_msec_to_rel_time(1);
- disk_period = fosa_msec_to_rel_time(1000/50);
+#endif
+ disk_period = fosa_msec_to_rel_time(1000/30);
/* Contract negotiation for CPU */
ret = frsh_contract_init(&cpu_contract);