]> rtime.felk.cvut.cz Git - frescor/demo.git/commitdiff
url_fseek works
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 8 May 2010 19:50:27 +0000 (21:50 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 8 May 2010 19:50:27 +0000 (21:50 +0200)
build-no-frsh/cmd.gdb
build/Makefile.omk
src/ffmpeg
src/recorder/ffmpeg.c

index eae55298d54de079e96238eaedf71a2dee7c6f15..fb236f1a479107ed6ee113f1f6b87ba72d665e2a 100644 (file)
@@ -1,9 +1,10 @@
 file /home/wsh/frescor/demo/build-no-frsh/_compiled/bin/recorder
-b url_fopen
-b url_fdopen
-b file_open
-b av_interleaved_write_frame
-# b file_write
-# b av_interleaved_write_frame
-run -s 640x480 -r 15 -f video4linux2 -i /dev/video0
-#run -s 320x240 -f video4linux2 -i /dev/video0
+#b url_fopen
+#b url_fdopen
+#b file_open
+#b av_interleaved_write_frame
+#b file_write
+b file_read
+#run -s 640x480 -r 15 -f video4linux2 -i /dev/video0
+run -i snapshot%02d.png -y stream.mp4
+
index 2f932d57f8baa39a08c1ed8edbb720a08d7fe232..9e9dd19048945400394eda4ca8d2615d80316789 100644 (file)
@@ -1 +1,9 @@
 SUBDIRS=$(sort $(ALL_OMK_SUBDIRS) ffmpeg)
+
+test:
+       ./_compiled/bin/recorder -i snapshot%02d.png -y test_normal.mp4
+       ./_compiled/bin/recorder -i snapshot%02d.png -y -direct test_direct.mp4
+       hexdump -C test_normal.mp4 > test_normal.hex
+       hexdump -C test_direct.mp4 > test_direct.hex
+       kdiff3 test_normal.hex test_direct.hex
+
index 77b0842e4959363e840f573192cccd6e4ac40cb9..a4582fb42456fe83734835ecc73d5a9b2ec2aba3 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 77b0842e4959363e840f573192cccd6e4ac40cb9
+Subproject commit a4582fb42456fe83734835ecc73d5a9b2ec2aba3
index f6252571bd8e1b5dcd76a569a6428e95fdff9619..777637957b25b6b1460cf8e7837ee96470b3f740 100644 (file)
@@ -179,6 +179,7 @@ static int64_t start_time = 0;
 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;
@@ -3505,7 +3506,7 @@ static void opt_output_file(const char *filename)
         }
 
         /* open the file */
-        if (url_fopen(&oc->pb, filename, URL_WRONLY|URL_DIRECT) < 0) {
+        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);
         }
@@ -3896,6 +3897,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" },
+    { "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" },