[Spice-devel] [PATCH spice-server v3 2/2] Some automatic check on video encoders

Frediano Ziglio fziglio at redhat.com
Wed Mar 22 16:20:52 UTC 2017


Stress a bit video encoders.
This check different combination of
- encoder type;
- image formats;
- image clipping (encoding partial frames);
- handling frames split into chunks.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 configure.ac                |  1 +
 server/tests/Makefile.am    |  7 +++++++
 server/tests/video-encoders | 25 +++++++++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100755 server/tests/video-encoders

Changes since v2:
- enable check only if --enable-extra-checks is used;
- fix make syntax-check;
- fix make dist.

diff --git a/configure.ac b/configure.ac
index 42ce1c1..fa6faed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,6 +100,7 @@ if test "x$enable_gstreamer" != "xno" && test "x$enable_gstreamer" != "x1.0"; th
     ])
 fi
 AM_CONDITIONAL(HAVE_GSTREAMER, test "x$have_gstreamer_0_10" = "xyes" || test "x$have_gstreamer_1_0" = "xyes")
+AM_CONDITIONAL(HAVE_GSTREAMER_1_0, test "x$have_gstreamer_1_0" = "xyes")
 
 AS_IF([test "x$enable_gstreamer" = "xyes"],
       [AC_MSG_ERROR("GStreamer support requested but not found")],
diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
index 6cd6f49..f1e28d6 100644
--- a/server/tests/Makefile.am
+++ b/server/tests/Makefile.am
@@ -77,6 +77,13 @@ endif
 TESTS = $(check_PROGRAMS)			\
 	$(NULL)
 
+if ENABLE_EXTRA_CHECKS
+if HAVE_GSTREAMER_1_0
+TESTS += video-encoders
+endif
+endif
+EXTRA_DIST += video-encoders
+
 noinst_LIBRARIES += \
 	libtest-stat1.a \
 	libtest-stat2.a \
diff --git a/server/tests/video-encoders b/server/tests/video-encoders
new file mode 100755
index 0000000..ca955c7
--- /dev/null
+++ b/server/tests/video-encoders
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -e
+
+base_test() {
+    echo "Running test with options: $*"
+    ./test-gst -i 'videotestsrc pattern=14 foreground-color=0x4080ff background-color=0x402000 kx=-2 ky=-4 kxy=14 kt=3 num-buffers=100 ! video/x-raw,width=1024,height=768 ! videoconvert qos=false' "$@"
+}
+
+# check different clippings
+# note that due to some internal alignment we are using odd number for sizes
+for clipping in '' '--clipping (10%,10%)x(409,307)'
+do
+    for encoder in mjpeg 'gstreamer:mjpeg --min-psnr 16' gstreamer:vp8 gstreamer:h264
+    do
+        for split in '' '--split-lines=40'
+        do
+            # TODO check if encoder is supported
+            for format in 16BIT 24BIT 32BIT RGBA
+            do
+                base_test -f $format -e $encoder $clipping $split
+            done
+        done
+    done
+done
-- 
2.9.3



More information about the Spice-devel mailing list