From fef6a90d2b2f21d885b2ec2d348bfcdb7751c118 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 14 Jun 2016 05:25:33 +0300 Subject: vsp-lib: Use gen-image to generate frames at runtime Replace the build time reference frames generation system by runtime generation of the frames. This saves a lot of disk space and allows tests to easily use new reference frames. Signed-off-by: Laurent Pinchart --- scripts/vsp-runner.sh | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'scripts/vsp-runner.sh') diff --git a/scripts/vsp-runner.sh b/scripts/vsp-runner.sh index e92eda1..6aa72a2 100755 --- a/scripts/vsp-runner.sh +++ b/scripts/vsp-runner.sh @@ -4,33 +4,41 @@ set -e source vsp-lib.sh +genimage='./gen-image' mediactl='media-ctl' yavta='yavta' -# ------------------------------------------------------------------------------ -# Format retrieval +# ----------------------------------------------------------------------------- +# Input frame generation # -frame_reference() { - format=$1 - size=$2 +generate_input_frame() { + local file=$1 + local format=$2 + local size=$3 - lcfmt=`echo $infmt | tr '[:upper:]' '[:lower:]'` + local alpha= + local options= case $format in ARGB555) - echo "frames/frame-reference-$lcfmt-$size-alpha255.bin" + alpha=255 ;; ABGR32 | ARGB32) - echo "frames/frame-reference-$lcfmt-$size-alpha200.bin" + alpha=200 ;; XRGB555 | XBGR32 | XRGB32) - echo "frames/frame-reference-$lcfmt-$size-alpha0.bin" + alpha=0 ;; *) - echo "frames/frame-reference-$lcfmt-$size.bin" + alpha=255 ;; esac + + $(format_v4l2_is_yuv $format) && options="$options -y" + + $genimage -f $format -s $size -a $alpha $options -o $file \ + frames/frame-reference-1024x768.pnm } # ------------------------------------------------------------------------------ @@ -105,8 +113,9 @@ execute() { input) rpf=rpf.$index size=$(vsp1_entity_get_size $rpf 0) + file=${rpf}.bin - file=$(frame_reference $infmt $size) + generate_input_frame $file $infmt $size if [ "x$options" = xinfinite ] ; then $yavta -c -n 4 -f $infmt -s $size --file=$file $options \ @@ -115,6 +124,8 @@ execute() { $yavta -c10 -n 4 -f $infmt -s $size --file=$file $options \ `$mediactl -d $mdev -e "$dev $rpf input"` fi + + rm -f $file ;; output) -- cgit v1.2.3