fluster.sh: detect codecs

With the patchset to support VP8 and MPEG2 in Iris being around the
corner, add a way to detect the codecs supported by the M2M device
instead of relying on Venus vs Iris driver being a key decision point.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
This commit is contained in:
Dmitry Baryshkov
2026-07-09 11:07:50 +03:00
parent 50bb0faf8f
commit 90e9b0e496
+44 -9
View File
@@ -8,17 +8,21 @@ then
exit 1
fi
if [ -d /sys/bus/platform/drivers/qcom-iris ] && [ "$(find /sys/bus/platform/drivers/qcom-iris -name "*.video-codec")" != "" ]
DEV=$(find /sys/bus/platform/devices/ -name "*.video-codec")
if [ ! -e "$DEV" ]
then
DRV=iris
elif [ -d /sys/bus/platform/drivers/qcom-venus ] && [ "$(find /sys/bus/platform/drivers/qcom-venus -name "*.video-codec")" != "" ]
echo "$0: can't find videoc-codec device"
exit 2
fi
if [ ! -e "$DEV/driver" ]
then
DRV=venus
else
echo "$0: can't detect video driver, check that the device is bound"
exit 2
fi
DRV=$(basename $(readlink "$DEV/driver") | sed -e 's/qcom-//')
MACHINE="$1"
SKIPFILE="$(dirname $0)/${DRV}-${MACHINE}-skip.txt"
@@ -52,11 +56,42 @@ fi
# Skip the machine
shift
if [ "$DRV" = "iris" ]
if [ "$(which v4l2-ctl)" = "" ]
then
CODECS="VP9 H.264 H.265"
else
CODECS="VP9 H.264 H.265 VP8 MPEG2_VIDEO"
echo "$0: v4l2-ctl not found, please install v4l-utils"
exit 3
fi
fourcc_to_codec() {
case "$1" in
H264) echo "H.264" ;;
HEVC) echo "H.265" ;;
VP80) echo "VP8" ;;
VP90) echo "VP9" ;;
MPG2) echo "MPEG2_VIDEO" ;;
*) ;;
esac
}
CODECS=""
for vid in "$DEV"/video4linux/video*
do
for fourcc in $(v4l2-ctl -d "/dev/$(basename "$vid")" --list-formats-out 2>/dev/null | \
sed -n "s/.*'\(....\)'.*compressed.*/\1/p")
do
codec=$(fourcc_to_codec "$fourcc")
[ -n "$codec" ] || continue
case " $CODECS " in
*" $codec "*) ;;
*) CODECS="${CODECS:+$CODECS }$codec" ;;
esac
done
done
if [ -z "$CODECS" ]
then
echo "$0: no supported compressed formats found for $DEV"
exit 2
fi
DECODERS=""