summaryrefslogtreecommitdiff
path: root/scripts/vsp-runner.sh
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2016-06-14 05:25:33 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2016-06-19 15:26:01 +0300
commitfef6a90d2b2f21d885b2ec2d348bfcdb7751c118 (patch)
tree10620fdfdcbe6764320c0b6d5a8f8801027fea58 /scripts/vsp-runner.sh
parent6ca13666c26995ebc4ef9d612d88517702bab1ee (diff)
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 <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'scripts/vsp-runner.sh')
-rwxr-xr-xscripts/vsp-runner.sh33
1 files changed, 22 insertions, 11 deletions
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)