summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-20 11:43:49 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-20 11:50:13 +0000
commit7822bbacbece6fcb2e12863cd6c7a53ab614c37c (patch)
tree117c00d035911ee93ca113c95f61ea5ef438a249 /test
parent9329d8755981989ccbe66df6085fbab7c809a2c6 (diff)
test: Add script to generate source file for testing vsync
Courtesy of an original script by Mark Schreiber, https://bugs.freedesktop.org/show_bug.cgi?id=59606
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am9
-rwxr-xr-xtest/mkvsync.sh27
2 files changed, 35 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 96c87f82..c1dd0e9b 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -35,4 +35,11 @@ libtest_la_SOURCES = \
dri2.h \
$(NULL)
-EXTRA_DIST = README
+vsync.avi: mkvsync.sh
+ ./mkvsync.sh $@
+
+clean-vsync-avi:
+ rm -rf vsync.avi .build.tmp
+
+EXTRA_DIST = README mkvsync.sh
+clean-local: clean-vsync-avi
diff --git a/test/mkvsync.sh b/test/mkvsync.sh
new file mode 100755
index 00000000..dd96ad8d
--- /dev/null
+++ b/test/mkvsync.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+OUT="$1"
+[ -n "$OUT" ] || OUT="vsync.avi"
+
+TMP=".build.tmp"
+
+rm -rf ${TMP}
+mkdir ${TMP}
+convert -size 640x480 -depth 24 canvas:black png24:${TMP}/black.png
+convert -size 640x480 -depth 24 canvas:white png24:${TMP}/white.png
+
+mkdir ${TMP}/anim
+
+for ((a=0; $a < 1000; a=$a+2)); do
+ ln -s ../black.png ${TMP}/anim/$a.png
+done
+
+for ((a=1; $a < 1000; a=$a+2)); do
+ ln -s ../white.png ${TMP}/anim/$a.png
+done
+
+mencoder "mf://${TMP}/anim/*.png" -v -vf-clr -mf fps=60 -o "${OUT}" -ovc lavc
+exitcode=$?
+rm -rf ${TMP}
+
+exit ${exitcode}