From patchwork Mon Jun 12 15:39:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 18725 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C9EFAC31E9 for ; Mon, 12 Jun 2023 15:39:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4466F61E4B; Mon, 12 Jun 2023 17:39:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686584382; bh=m7vIRErT+TuQg3kCoah3Cz6fr8Ghx8pMtKscafzTPrY=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=MDQLYSS+mF+siVIlKJB1YQxHpYzbzeEJlzV6LgxdUXvgyt3c7tFAkR15f3GiZQ5gb PNqoMC3LCQfMSVv4A6ctXkE8tS4EIp0I/NlMFEhTDIzDmEU+MCF5GjkcbmHTBgx3xT il4rK/cdvETaxewGW6YTo7enRRjt6gUUuFE2Ky/DwOXoihQXp5IRFtto7S/zpp4ONR po5GbZZCmcoyf0Abh9FSeFDWzxPeUQRZBgv4RtELr8MXk09bhjowpv0xR2cyV1hEXP 2yp+Bi2uisQIu/5Pf0sA0Qe0+LhPdZUn1Nu5g0fj1Acp7g1HNk2dj33X+0GR2djfhB xdZlFIuZHRtEQ== Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C9BE261E4A for ; Mon, 12 Jun 2023 17:39:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="iXS8OErL"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686584379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gvVeaQq+qdPoJbG5swfGaWLwP/ixixeO6QBdjrUztNQ=; b=iXS8OErLTCtwK3RB46pWYm2EEcgJpQPfZO33UNRqg4RnmX3nizRsbRXxOLTp63+gIU4CvH YtxLtjjEOr5RSnyc3RyBLY4K9E8JF59XZK9AA/sejh+AVhehJ23Hl0vrf57DtPtj0z3OKP Q5Kpc4+9LcAuKua7rQ1DZ/xJeDg8e98= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-626-dkDrDbZxNuuauO5KSIiK4Q-1; Mon, 12 Jun 2023 11:39:36 -0400 X-MC-Unique: dkDrDbZxNuuauO5KSIiK4Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 48BF83823A03; Mon, 12 Jun 2023 15:39:36 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id A13BCC1604C; Mon, 12 Jun 2023 15:39:35 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Jun 2023 17:39:34 +0200 Message-Id: <20230612153934.5618-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [libcamera-devel] [PATCH] utils: ipu3-capture.sh: Fix the script to work with recent media-ctl versions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans de Goede via libcamera-devel From: Hans de Goede Reply-To: Hans de Goede Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- 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; } }