Skip to content

Commit

Permalink
Add runtime test using h26forge bitstreams
Browse files Browse the repository at this point in the history
Test is v4l2slh264dec can safely decode the bitstreams
generated by h26forge.

Signed-off-by: Benjamin Gaignard <[email protected]>
  • Loading branch information
Benjamin Gaignard committed Jan 9, 2025
1 parent 0b3751e commit 2ff6aab
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/core/rootfs-configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ rootfs_configs:
- unzip
- wget
script: "scripts/bookworm-gst-h26forge.sh"
test_overlay: "overlays/h26forge"
imagesize: 4GB
debos_memory: 8G
debos_scratchsize: 16G
Expand Down
60 changes: 60 additions & 0 deletions config/rootfs/debos/overlays/h26forge/usr/bin/h26forge-parser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh
#
# Copyright (C) 2025 Collabora Limited
# Author: Benjamin Gaignard <[email protected]>
#
# This module is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

set -e

if [ "$KERNELCI_LAVA" = "y" ]; then
alias test-result='lava-test-case'
alias test-exception='lava-test-raise'
else
alias test-result='echo'
alias test-exception='echo'
fi

if ! command -v gst-inspect-1.0 >/dev/null; then
echo "gst-inspect-1.0 not found. Please install it to proceed."
test-result h26forge-debian --result skip
exit 0
fi

# Check if v4l2slh264dec element exist
if command -v gst-inspect-1.0 --exists v4l2slh264dec>/dev/null; then
echo "v4l2slh264dec element is missing. Skipping the test"
test-result h26forge-debian --result skip
exit 0
fi

if [ ! -d /opt/h26forge/test_videos/ ]; then
echo "bitstreams test directory missing. Skipping the test"
test-result h26forge-debian --result skip
exit 0
fi

cd /opt/h26forge/test_videos/

for i in $(seq -f "%04g" 0 99); do
if command -v gst-launch-1.0 filesrc location=video$i.264.mp4 ! parsebin ! v4l2slh264dec ! fakesink>/dev/null; then
test-result h26forge-debian --result fail
exit 1
fi
done

test-result h26forge-debian --result pass

exit 0
23 changes: 23 additions & 0 deletions config/runtime/tests/h26forge-debian.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{# This test verifies if h26forge generate bitstream
# do not make h264 stateless decoder crash basic functionality:
-#}
- test:
timeout:
minutes: {{ job_timeout|default('15') }}
definitions:
- repository:
metadata:
format: Lava-Test Test Definition 1.0
name: {{ node.name }}
description: "h26forge test plan"
os:
- debian
scope:
- functional
run:
steps:
- KERNELCI_LAVA=y /usr/bin/h26forge-parser.sh

from: inline
name: {{ node.name }}
path: inline/{{ node.name }}.yaml

0 comments on commit 2ff6aab

Please sign in to comment.