From 9007d37939b971930252fd74b973b0d9c0c83eed Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 1 Mar 2022 22:35:16 +0200 Subject: utils: rkisp1: Fix sensor format parsing With sensors supporting crop, the regexp used to parse the media-ctl output isn't correct as the pad configuration may span multiple lines and contain other parameters. Fix it. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder --- utils/rkisp1/rkisp1-capture.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/rkisp1') diff --git a/utils/rkisp1/rkisp1-capture.sh b/utils/rkisp1/rkisp1-capture.sh index d5ebe5b1..eee6b802 100755 --- a/utils/rkisp1/rkisp1-capture.sh +++ b/utils/rkisp1/rkisp1-capture.sh @@ -51,7 +51,7 @@ get_sensor_format() { local format local sensor=$1 - format=$($mediactl --get-v4l2 "'$sensor':0" | sed 's/\[\([^ ]*\).*/\1/') + format=$($mediactl --get-v4l2 "'$sensor':0" | grep 'fmt:' | sed 's/.*\(fmt:\S*\).*/\1/') sensor_mbus_code=$(echo $format | sed 's/fmt:\([A-Z0-9_]*\).*/\1/') sensor_size=$(echo $format | sed 's/[^\/]*\/\([0-9x]*\).*/\1/') -- cgit v1.2.1