From cbc2cd8b609abf7e09bc1d8d56435087a6427fed Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 20 Jun 2016 01:15:31 +0300 Subject: tests: Add WPF flip update tests Test updating the vertical and horizontal flip controls during video streaming. Signed-off-by: Laurent Pinchart --- tests/vsp-unit-test-0012.sh | 91 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 tests/vsp-unit-test-0012.sh (limited to 'tests/vsp-unit-test-0012.sh') diff --git a/tests/vsp-unit-test-0012.sh b/tests/vsp-unit-test-0012.sh new file mode 100755 index 0000000..a536ca9 --- /dev/null +++ b/tests/vsp-unit-test-0012.sh @@ -0,0 +1,91 @@ +#!/bin/sh + +# +# Test runtime modification of horizontal and vertical flipping on WPF.0. +# + +source vsp-lib.sh + +features="rpf.0 wpf.0 wpf.0[control:'Vertical+Flip']" +optional_features="wpf.0[control:'Horizontal+Flip']" + +directions="horizontal vertical" +dir_horizontal_control="Horizontal+Flip" +dir_horizontal_label="hflip" +dir_vertical_control="Vertical+Flip" +dir_vertical_label="vflip" + +format="RGB24" + +get_var() { + echo $(eval echo \$dir_$1_$2) +} + +flip_control() { + local direction=$1 + local value=$2 + local control=$(get_var $direction control) + + vsp1_set_control wpf.0 "$control" $value +} + +reset_controls() { + # Reset all controls to their default value + local direction + + for direction in $* ; do + flip_control $direction 0 + done +} + +test_flipping() { + local direction=$1 + local label="$(get_var $direction label)" + + test_start "$label" + + pipe_configure rpf-wpf 0 0 + format_configure rpf-wpf 0 0 ARGB32 1024x768 $format + + vsp_runner rpf.0 --count=6 & + vsp_runner wpf.0 --count=6 --skip=0 --buffers=1 --pause=3 & + + vsp_runner_wait wpf.0 + result=$(compare_frames $label=0) + + [ $result = fail ] && { + test_complete $result ; + return + } + + flip_control $direction 1 + + vsp_runner_resume wpf.0 + wait + + result=$(compare_frames $label=1) + + test_complete $result +} + +test_main() { + # Check the supported directions and reset the associated controls + local supported_directions + + for direction in $directions ; do + $(vsp1_has_feature "wpf.0[control:'$(get_var $direction control)']") && { + supported_directions="$supported_directions $direction" ; + flip_control $direction 0 + } + done + + local directions=$supported_directions + + for direction in $directions ; do + reset_controls $directions + test_flipping $direction + done +} + +test_init $0 "$features" "$optional_features" +test_run -- cgit v1.2.3