From 723c83e6a3a6cc9306010ab51a3a7b9b861ef843 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 5 Apr 2025 01:16:42 +0300 Subject: vsp-lib: Support specifying pipeline internal format for RPF -> WPF The RPF can perform color space conversion, converting between RGB and YUV formats. Testing this feature requires specifying different formats on the RPF input and output. Add a --midfmt argument to the format_rpf_wpf() function to specify the RPF output format, and propagate it through the pipeline up to the WPF input. Signed-off-by: Laurent Pinchart --- scripts/vsp-lib.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/vsp-lib.sh') diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh index ba87de5..d872290 100755 --- a/scripts/vsp-lib.sh +++ b/scripts/vsp-lib.sh @@ -789,6 +789,7 @@ format_rpf_wpf() { local infmt=$(format_v4l2_to_mbus $3) local size=$4 local outfmt=$(format_v4l2_to_mbus $5) + local midfmt=$infmt local rpfcrop= local wpfcrop= local rpfoutsize= @@ -802,6 +803,9 @@ format_rpf_wpf() { for option in $* ; do case $option in + --midfmt=*) + midfmt=$(format_v4l2_to_mbus ${option/--midfmt=/}) + ;; --rpfcrop=*) rpfcrop=${option/--rpfcrop=/} ;; @@ -831,8 +835,8 @@ format_rpf_wpf() { fi $mediactl -d $mdev -V "'$dev rpf.$rpf':0 [fmt:$infmt/$size $rpfcrop]" - $mediactl -d $mdev -V "'$dev rpf.$rpf':1 [fmt:$infmt/$rpfoutsize]" - $mediactl -d $mdev -V "'$dev wpf.$wpf':0 [fmt:$infmt/$rpfoutsize $wpfcrop]" + $mediactl -d $mdev -V "'$dev rpf.$rpf':1 [fmt:$midfmt/$rpfoutsize]" + $mediactl -d $mdev -V "'$dev wpf.$wpf':0 [fmt:$midfmt/$rpfoutsize $wpfcrop]" $mediactl -d $mdev -V "'$dev wpf.$wpf':1 [fmt:$outfmt/$outsize]" } -- cgit v1.2.3