summaryrefslogtreecommitdiffstats
path: root/tests/fate-run.sh
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-03-14 14:04:55 -0300
committerJames Almer <jamrial@gmail.com>2019-03-14 14:15:46 -0300
commitd0c43e32427ec1efac364be0987a6aafa695527f (patch)
treeb1c66b7aff6cce563836422f329bccc770e08933 /tests/fate-run.sh
parenta8c5ae451184e879fc8ff1333c6f26f9542c8ebf (diff)
parenta70eac7a9b193e8434b5bed90bd72aa4cb688363 (diff)
downloadffmpeg-streaming-d0c43e32427ec1efac364be0987a6aafa695527f.zip
ffmpeg-streaming-d0c43e32427ec1efac364be0987a6aafa695527f.tar.gz
Merge commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363'
* commit 'a70eac7a9b193e8434b5bed90bd72aa4cb688363': tests: Convert image2pipe tests to non-legacy test scripts Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'tests/fate-run.sh')
-rwxr-xr-xtests/fate-run.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index f1a1e34..2d5dbf2 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -243,6 +243,53 @@ stream_remux(){
-f framecrc - || return
}
+# FIXME: There is a certain duplication between the avconv-related helper
+# functions above and below that should be refactored.
+ffmpeg2="$target_exec ${target_path}/ffmpeg"
+raw_src="${target_path}/tests/vsynth1/%02d.pgm"
+crcfile="tests/data/$test.lavf.crc"
+target_crcfile="${target_path}/$crcfile"
+
+[ "${V-0}" -gt 0 ] && echov=echov || echov=:
+
+echov(){
+ echo "$@" >&3
+}
+
+AVCONV_OPTS="-nostdin -nostats -y -cpuflags $cpuflags -threads $threads"
+DEC_OPTS="-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact"
+ENC_OPTS="$DEC_OPTS -threads $threads -dct fastint"
+
+run_avconv(){
+ $echov $ffmpeg2 $AVCONV_OPTS $*
+ $ffmpeg2 $AVCONV_OPTS $*
+}
+
+do_avconv(){
+ f="$1"
+ shift
+ set -- $* ${target_path}/$f
+ run_avconv $*
+ do_md5sum $f
+ echo $(wc -c $f)
+}
+
+do_avconv_crc(){
+ f="$1"
+ shift
+ run_avconv $* -f crc "$target_crcfile"
+ echo "$f $(cat $crcfile)"
+}
+
+lavf_image2pipe(){
+ t="${test#lavf-}"
+ t="${t%pipe}"
+ outdir="tests/data/lavf"
+ file=${outdir}/${t}pipe.$t
+ do_avconv $file $DEC_OPTS -f image2 -c:v pgmyuv -i $raw_src -f image2pipe "$ENC_OPTS -metadata title=lavftest" -t 1 -qscale 10
+ do_avconv_crc $file $DEC_OPTS -f image2pipe -i $target_path/$file
+}
+
lavffatetest(){
t="${test#lavf-fate-}"
ref=${base}/ref/lavf-fate/$t
OpenPOWER on IntegriCloud