From c49958d0b456619c32a04d074f592cc1665a24b5 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 12 Jun 2023 17:39:34 +0200 Subject: utils: ipu3-capture.sh: Fix the script to work with recent media-ctl versions Recent media-ctl versions include the framerate in the fmt property output: - entity 37: ov5693 4-0036 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev6 pad0: Source [fmt:SBGGR10_1X10/2592x1944@1/30 crop.bounds:(16,6)/2592x1944 crop:(16,6)/2592x1944] -> "ipu3-csi2 1":0 [ENABLED] This resulted in $sensor_size getting set to: "2592x1944@1 30", which causes the script to fail. Fix this by: 1. Replacing the gsub() to remove the '/' between e.g. SBGGR10_1X10 and 2592x1944 with a sub() so that only that first '/' gets replaced (resulting in a $sensor_size of "2592x1944@1/30" instead). 2. Adding a new sub() to remove the @1/30 suffix. Signed-off-by: Hans de Goede Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- utils/ipu3/ipu3-capture.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/ipu3/ipu3-capture.sh b/utils/ipu3/ipu3-capture.sh index ba6147b4..9294d025 100755 --- a/utils/ipu3/ipu3-capture.sh +++ b/utils/ipu3/ipu3-capture.sh @@ -63,7 +63,8 @@ parse_pipeline() { if (sensor) { gsub(\".*fmt:\", \"\"); gsub(\"[] ].*\", \"\"); - gsub(\"/\", \" \"); + sub(\"/\", \" \"); + sub(\"@[0-9]+/[0-9]+\", \"\"); format=\$0; } } -- cgit v1.2.1