From patchwork Wed Nov 6 06:15:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ming Qian\(OSS\)" X-Patchwork-Id: 841985 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011051.outbound.protection.outlook.com [52.101.70.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 128321922FB for ; Wed, 6 Nov 2024 06:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873823; cv=fail; b=j3QKQcIgpAeL26gFxFOSDOcd5OuOYSH7Lu8yfIN0NNJWuR79d3uGOqCVZIqXmZm3127Okgp4hLorySZpJTMdySLhUYUoxTnOuyxp4MS1K1ivGsb5IbfNWfBWUE+20egAuVughqkFDPr+xdlFdFTKNWK9TLKH3fHgSAW0NEBTHcY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730873823; c=relaxed/simple; bh=Jc6d7MjDrgy7PvyqchGCiZ+AqjoKDpV9uKQ4tvJnFxc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=gKHswamxlh40j71xkQg+9EHwB1Ks2kFmGmPyRtk9YSOo3ELD44Kjl7FIGM+++/+OS7kNX+2ApSfsLONzWj88KNpCzD/rO4R1pwsIQaX3HBKQuFZWdT2D2Uoayd2lCdVePiqWrs7mdtEg0Ja4kzC97qp5ZjLRvGpNzg11Owe+yS0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=AoM3fOHZ; arc=fail smtp.client-ip=52.101.70.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="AoM3fOHZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IaHkoU3Ty2A/yWSRBxJxxLsRVw55ozQtGXqNFxw7sHp9JOIeyEmpH4ck2v5x3j3xyFVaZrVDfqcNd5eNz3PzZT9nMPIbzPTqtHt9WixPlO56w+lOhdMPCW1even4TzrbjxESzAYmwZru4WPR6Js6hxTslZsRE8i7+B2URMuv8ZL9uokBFtbdptg0VeS5RrNvsFXn2RHEjUeQ2pfxnRz3Awq17FrdU/XdcANedcPMk2Fi8TMTrBBE/jG5K3NCV+bX2OUojbXRhygKfrcsVO9vQsEOLQg4AM7GqtoBn2YcurxDkxUdLPNXDKQc9+hTTn2mDvx6Vvjcdho6zROoZn3uZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FTRHhP7KH0T57Am0hgobO91+Ll7J2bwoMr724wGaPeo=; b=QiO7ecH1CJ41ezMBNqQkcnTa4hP1lpwezuS1p5HJLojPTAlRJeXOVP51/Ez7yVLkbCDmGkQy0EWYRtm9IOYPFQI2EtfAaRrtNlLhWXvL8KdRBOQuXg9GA+4UiF8kFHtxxK9RLyjL4577mb6YcuRmdyIm4uSw90p1m9nPgQahyEAXwmY4ci2NjckLESseDQIPT8P/alcFBulXzbL8a8KNA9qXxiZzvhHy1EVQnqKFUyqtgc1xGEYQbSI/aiN1q+vZD63iYGFkeqENeBks2dwQ8Rjbtj4oy7nVmcbI+ElNFyY3oGS6XdAL6JhmQTrOw1jYWXXGEkQpG7f69b1bABh+lQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FTRHhP7KH0T57Am0hgobO91+Ll7J2bwoMr724wGaPeo=; b=AoM3fOHZr7az8DhvT876BlMmsz+ZMj7rovu0/a+OUrSZoLLb08ZSG9ZH1SBRr3OKRQ1LdTtRuV6cL8z14LG3sIC1XGNbSqDi9FCWWa9AG+DxZZGBE1urS3xDCr0zmxkuYE+UolW3a3pQMdhC/dNCBbsQ32l59rRkvfijTcpLcBpuZMMsOkbsIwu/d8WimC0MKoMeQn7QiRHuhaoXDL6ho907il/sa3Ehv99BOWc5/cblnqP7btSLfPzRXX2lnWWX0viF9q7xC3ocsqgpS4LrTZ6LpiQGSkm9MyUPAqZX/2G7Ve6KZAhbuMFz7731/EuGazpwu4Lib1hysyXjqbqsbQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) by DU4PR04MB10599.eurprd04.prod.outlook.com (2603:10a6:10:593::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Wed, 6 Nov 2024 06:16:59 +0000 Received: from PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87]) by PAXPR04MB8254.eurprd04.prod.outlook.com ([fe80::2755:55ac:5d6f:4f87%3]) with mapi id 15.20.8114.031; Wed, 6 Nov 2024 06:16:59 +0000 From: ming.qian@oss.nxp.com To: linux-media@vger.Kernel.org, hverkuil-cisco@xs4all.nl Cc: laurent.pinchart@ideasonboard.com, tfiga@chromium.org, ribalda@chromium.org, yunkec@google.com, xiahong.bao@nxp.com, ming.zhou@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, ming.qian@nxp.com Subject: [PATCH v3 3/4] v4l2-ctl: Support V4L2_CTRL_TYPE_RECT Date: Wed, 6 Nov 2024 15:15:36 +0900 Message-ID: <20241106061537.211002-4-ming.qian@oss.nxp.com> X-Mailer: git-send-email 2.43.0-rc1 In-Reply-To: <20241106061537.211002-1-ming.qian@oss.nxp.com> References: <20241106061537.211002-1-ming.qian@oss.nxp.com> X-ClientProxiedBy: SG2PR06CA0250.apcprd06.prod.outlook.com (2603:1096:4:ac::34) To PAXPR04MB8254.eurprd04.prod.outlook.com (2603:10a6:102:1cd::24) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8254:EE_|DU4PR04MB10599:EE_ X-MS-Office365-Filtering-Correlation-Id: f5170298-b7d0-4dd7-ab85-08dcfe2a9ef7 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: GFRqnVRpSTZRErcNhbdv5lmCOt2DkjcsAmtShd2Z0Zuf05Dt++WjycaDOi2EuQVc59TI1hKg2tQsb4Yy5v+UImyNpqi0SR8xnN5uNPJUDNw1hVU9JL/6JncRsolkPonbmOYYeyoUJL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GGPQtGonyQv1Rwu84rKFv9oHldOZqSBLpLtjFxv5pdla97lnwu1FSjr46gRR/75DQ7nTywkCnJxwsAHKpK61iRs2H9tPuWtwPuKw5EghLfHbi8YoA35BvdxgG8Gc/PnwSyiUbDWwOi5rbd09t+oYuPa7ggwTk19H/DE0x+tuW3F8IA7YLnC0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8254.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8spMKTuSCImDCfMTb6B4GQOlc5jc+BBU1LM9+QfzpFUWJg38KqjFWKeIhNWXZreCLs+N+ZCuov309gBq4N0iSocxjmNtM/J+0AmeCFP0ZKqoFPJHdGSTBOB3+XRBN2dH2ObU2zRVpCpy2EC7WIKZaMfgeF7C6mqQsv5xqAkVKUGykewtnbY54vBnH0ReBtrOvKGsDWAE1SZooJIiP58mZRuLI9jVWSYzvP58Bickc+DaHpYxX6VzGfexzG8rj9Gfbx+CDTjiyejmJ32r1YdKyOUF5f73KWVrJpEz0euTI20UmgznTKnxADI0vcNeM0qXoMShFXvhNZaK97BM7dUxOUiXc3u4PBMZM+rBNwtjT992PU2ziXYYYmVlJs+bAsJvuOKtx5bLjYZRf29dHhxJC3HUcNjs0T39Yw5kyb32Lud9xdn4LLMNT/AlP2lYwcx8rOfatCKvweemqZTFjUtP6brkhgLvz6RGEJ+cX720uIyq7Bdn+SpJ3/+29CGkyZYmiVpilt3Ne/3X5VAptbEbQ821QfUp+RUw0Ypj1t62qUQxy7Sy5VoBbBHLlNXtsY6vnfHId6LiMR7USprvvuO0Ch63F+hIP6XJDPT9rihb4LRAtQv6+D7BsH8iTh2q29+buC9E987hk6m/7rfsd98lVjezku1OTnCP59SAr1aZCKi+qYZ+6c+hlB8kGKM+1egfW2Lrzv7BeKa3/tVGVcWLaI9ZtvNESRuqJCngU3wGqWNbFUKFhXyPJxZHA5x3eiJt3gWUGg0MUFwHwd9L5nkQIDiXRs4JFidDTzxfXn8IRV4aDXsJlCwff8PiAa9841u2WlVTSx9lczPdkT1OUO9nksQ0Yh7PbUpH6d5zSvso3k5fuMG7CtHKOglsfvgvsBQmulK6XJazxZ6FQIYFcMlicNbMB6dsYWHKheahP3jzm/PcGNza9gLIv+MruyqyKv8SC/YSZf18GYxMf92xyJcYKI23hxib0lT3QfBCv58tiQKsCeiefHEYvcBjdao0WJoJrMMN1BpLNJ30vN/cWwsTKTfP4BXHAg30ABUCrQIJnG4n9ZcIsrq2Mm+7EkMQx0swtZHksxRdjbImXeQbIczvUSYZEQk4CGzrADk9Gwmrk9pa4WywUPeWnv5kk+wZCHtmrWNHtCv0RFOs2ba0lkunwaPZzgV2wQ9FJqJf/rrG6BNG7l0mVyvjh5Q9td+J+K856w9twTor2HEWpiZcKl/ThHtCizKElCjkM/Ammp4GeRjo+R0xfPPFqarBcpsIUT+ZLjg/k8JlEfKigoq7hklnHQohRxEFK/IqdQOHbpEzZ/oRt2EZ8aDD4LtuzSaalU9zE6S95wR9JxNyWjAb4QV4Q4e7gFRq7lyoFAH7is3NpvedWKtQBR6//3ofnNqjlrU7u5z/nli7SfOBS8iS1DOcZvLbhQj/hH/sd65arKj4uBwrF3AiyGXH9ONnTTIlNqRk5crmcTb4fAt2fKRKedwD0i7TUCOafL1SqY6ddFnpdpN7gVjNs3itayH7gsr3FMUOFxeOgSz+5+iQ6O39xfNrIixt0xPa/qS/DJlYeLuMNwcc6+Jb8XGEtV+P9mDF7BNi X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5170298-b7d0-4dd7-ab85-08dcfe2a9ef7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8254.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2024 06:16:59.1446 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GzX9qufVTT+sqXdnq9EPSN/m5TbnCzojARFGSdBNiqc4dANGiXH/5ikp/5a0dgOt2Gc1UhgSuy3ARDqCUqVBwQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB10599 From: Yunke Cao Tested with VIVID ./v4l2-ctl -C rect -d 0 rect: (200,100)/300x400 ./v4l2-ctl -c rect="(0,0)/1000x2000" ./v4l2-ctl -C rect -d 0 rect: (0,0)/1000x2000 Signed-off-by: Yunke Cao Signed-off-by: Ming Qian --- utils/v4l2-ctl/v4l2-ctl-common.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp index 40667575fcc7..1859292f6f77 100644 --- a/utils/v4l2-ctl/v4l2-ctl-common.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp @@ -614,6 +614,11 @@ static void print_value(int fd, const v4l2_query_ext_ctrl &qc, const v4l2_ext_co case V4L2_CTRL_TYPE_AREA: printf("%dx%d", ctrl.p_area->width, ctrl.p_area->height); break; + case V4L2_CTRL_TYPE_RECT: + printf("(%d,%d)/%ux%u", + ctrl.p_rect->left, ctrl.p_rect->top, + ctrl.p_rect->width, ctrl.p_rect->height); + break; default: printf("unsupported payload type"); break; @@ -702,6 +707,9 @@ static void print_qctrl(int fd, const v4l2_query_ext_ctrl &qc, case V4L2_CTRL_TYPE_AREA: printf("%31s %#8.8x (area) :", s.c_str(), qc.id); break; + case V4L2_CTRL_TYPE_RECT: + printf("%31s %#8.8x (rect) :", s.c_str(), qc.id); + break; case V4L2_CTRL_TYPE_HDR10_CLL_INFO: printf("%31s %#8.8x (hdr10-cll-info):", s.c_str(), qc.id); break; @@ -1279,6 +1287,11 @@ void common_set(cv4l_fd &_fd) sscanf(set_ctrl.second.c_str(), "%ux%u", &ctrl.p_area->width, &ctrl.p_area->height); break; + case V4L2_CTRL_TYPE_RECT: + sscanf(set_ctrl.second.c_str(), "(%d,%d)/%ux%u", + &ctrl.p_rect->left, &ctrl.p_rect->top, + &ctrl.p_rect->width, &ctrl.p_rect->height); + break; default: fprintf(stderr, "%s: unsupported payload type\n", qc.name);