From patchwork Tue May 3 14:38:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xavier Roumegue (OSS)" X-Patchwork-Id: 12835863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46753C433F5 for ; Tue, 3 May 2022 14:39:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237199AbiECOmp (ORCPT ); Tue, 3 May 2022 10:42:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235833AbiECOmn (ORCPT ); Tue, 3 May 2022 10:42:43 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70055.outbound.protection.outlook.com [40.107.7.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B29B53585B for ; Tue, 3 May 2022 07:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l6b7F076lzojY3JEarSsLbFT3b91KFl8aAzDNWEq23Q3vyNrbJ5LdLtSoOH2hCl2MGWOBP3lm9tu54mpC0VxuuYA3ev+nYo7USrUjdm3gvS12M4pzh4EqwGOYLbvPbzzLRC2D8v9o0iiqH6yleSsIZpmOp+LODLfC9lc79lYMtQeUIYiGAleZZCpsI5pR0mJO0hm/U0CAFkTb1PB2cx4kT5vJRlF8GaLr6JF7zs2pRJpwr3oN5JmzDKvKApOiVwvSNVdKCbaRT2hI8UHw3vzWBraLlHMpUC6k9xcwrKeZh1WV4tGS1u/Ia+2MLMTKNjgIcI/LOlZs8WNrYaPkxHVlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=v1ifANULpNERXTFDtyaVjdR2acqQk8YXcMLSAvBOSaQ=; b=O3wdfegh/cCXJQToLEz41YqFKX3NW4TlogRsMqrOMI3BgrSkS1K/BgDymzUiQWYRtua6mwVO97C2NA+XOzcbLLJqQ6mBW0hvYJMn9n70EfobfKXX6HFF2g7C1Z6CgSr0kWZVqTYpvgGLKKhUOE2ZLhqVqKcgckQhwJeyyYPG/q8lG9vil8G4g6NjWEZgQzjXg+lLVyXtyj3my4A6EWvrIGO4X/a/nemgbZR7QBSC2oraCKxjWDeQzL8bDqv9Fmq9/x7yaUiwxtQd1gdewyVY0wrZKlzeZ8pLrWTEDF7iC6wTJTEpSGpBqhzBusA3E/6joHsxOvyQdFMYMwGs9VBVdg== 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=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v1ifANULpNERXTFDtyaVjdR2acqQk8YXcMLSAvBOSaQ=; b=bgLPmbAyIWmP8q6TZx/0uHNn0GfxRPQ++gQLtsi1TfuZy3NdGfs3CoWwYTrkmsnmmz4j2KLo451m3h59lXXdvd4Xc4Xezzw9RmFQn++1ZDF88d9eYmYJ+CiQdY0V1r6VAeUXomntl+qO12LQIQPpJxgnb5OanAjaxLCNt9lfNQU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8700.eurprd04.prod.outlook.com (2603:10a6:20b:43f::8) by DBBPR04MB7836.eurprd04.prod.outlook.com (2603:10a6:10:1f3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Tue, 3 May 2022 14:39:07 +0000 Received: from AM9PR04MB8700.eurprd04.prod.outlook.com ([fe80::9120:6407:db5d:462c]) by AM9PR04MB8700.eurprd04.prod.outlook.com ([fe80::9120:6407:db5d:462c%7]) with mapi id 15.20.5206.014; Tue, 3 May 2022 14:39:07 +0000 From: Xavier Roumegue To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: Xavier Roumegue , linux-media@vger.kernel.org Subject: [PATCH v2 1/2] v4l2-utils: Change get_(cap_compose|out_crop)_rect() return type to void Date: Tue, 3 May 2022 16:38:11 +0200 Message-Id: <20220503143812.982985-1-xavier.roumegue@oss.nxp.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: PR0P264CA0196.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::16) To AM9PR04MB8700.eurprd04.prod.outlook.com (2603:10a6:20b:43f::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf9b3f68-0429-46a7-c690-08da2d12ad08 X-MS-TrafficTypeDiagnostic: DBBPR04MB7836:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: krHEuFnMZJOiKnYp6J8nu8012rckmSuC0DWHpV8jRVh4EjoaHAXXTYTw4chHN12l+1DP1hQiTrfPJsJa4/aDeaVg/7f1DWp09L2vEZlrdtZFvrebzbYHbIdaqmxbmZTAau2WWjizz7qY6Z7DWdYnYWe5GTR3E7Z4H4CAVrMd6LjjVhhZwhHeXQVckyNRFqnudYlh+s2MkRMPATdHvOz1PntY2LbduClQXy9qcvljTKYCi1y5/IpDXh3s1mZooSdBQxIX9Te1eL6GQcJukHP1YYWxc0CZRESV7rQKwZb2BUdjuPSh+U2uMWv+/bV1IAo06ilu3bLdWFyAUMuVwlchIqrJstGLHGo9qVWXcOOrW5VMcwKE5Wc5JrNff7ZosXRCk5gjoUUh4BfIh60ckE8Kh+KN/LWzT8//GEgBR3AM1NhU7VVR+z8Qb93ncSALg/JDzqrd3o1qHZzg1YQN51/DF8UJSq81xLgJlfb655vGKfQXMqeIgM7X6asFlMKnkgyO3un7FRccebtPn87Cs4EJvdNM/yGQCGCpjHC0+0MK8GUWdxDC8hYbFgok77EqOCZQ8j2L8wjg6InCCHRTJzZvyPAjN7E7Ox3i33TwKm7FRzfbuMMJEpXGNhAj3LW+kocHI4TNGpELUObDzVl5qd2Qig== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8700.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(2906002)(8936002)(5660300002)(83380400001)(316002)(66946007)(8676002)(66476007)(66556008)(4326008)(186003)(44832011)(2616005)(1076003)(52116002)(6666004)(6506007)(6512007)(38100700002)(508600001)(6486002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: idwZotH6h97ghNT/XHnevDrETAxI+j8x9H5oq/rvVSzAKqulE6PdsT0QdNVY5q9Cf0efYceMYNca3X9LYLL+eqB2ZGFhwreaIrow+ZmWyeRmVQOmiorG9o6z7ba7939RSzc6A48o9TTlECjmpNKNOvwrNaKIqLMO1OtB6y05N4XddQ1bpicosWWA74bVRcUpAqFi99/oYktBP5VwNNS8v6LTXAsNE25ftx9rOSMRrZDZdGP520V/6q5dQq3Hf9lcC4R2uiPeuLk6Jiah7s1GSLE3hB+L7U0GEclOgCV6yCOCZItbAQy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O+AOpQVvxXA+zV8fj5eEHzyGmeBZW/rKjBqZds2Hw+QOOMt3zs11Y16FoS1ZJgf08BRftTWfUzpulX7u+2Hal89Ro0lYF4QEb7F2PBn3bxXIUXj8kTaDqvJrqrvaP31+qZpMx9CHUg3qapJGV/Z1S4ejxhF6OHFTdyoqTAvA5SoHxSBFp77ykGbodruwh6fvLoIcum+UWpWBvOQDYm5YzCFBR4VLaoe3ogrVbzDQOiMvTlADpZzE9lIcdhTmyLBxjebIFpNBjJch7yBXdsHgFdt1CwTzK5dBmfgUt7SB7IiSWNmoa3IzSWsL+f10YETvhxW/UNnOuI4bfU+0jI3Mcg+D9StmOzWve5UjvuB7QnIHSAoyKUq80lBfCnWDBrXyfXLbWM+V5Br0jsU0HDYPD+S4Qy2+1AE X-MS-Exchange-AntiSpam-MessageData-1: rC1b7509GVm1aymLKGEotCuB+mgflWRgnbU= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf9b3f68-0429-46a7-c690-08da2d12ad08 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8700.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2022 14:39:07.1728 (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: L77YeEFchQk7aoHs28On/YMNKEc/thXenDhqRync8PRopaWQK+V1p22Ab9Ah3M8vgxl84Mx8wMiz5LXcreBkSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7836 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Those functions always return 0, hence change their prototype to void. Signed-off-by: Xavier Roumegue --- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 7f6482d6..8a06c754 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -394,7 +394,7 @@ static enum codec_type get_codec_type(cv4l_fd &fd) return NOT_CODEC; } -static int get_cap_compose_rect(cv4l_fd &fd) +static void get_cap_compose_rect(cv4l_fd &fd) { cv4l_disable_trace dt(fd); v4l2_selection sel; @@ -407,14 +407,12 @@ static int get_cap_compose_rect(cv4l_fd &fd) support_cap_compose = true; composed_width = sel.r.width; composed_height = sel.r.height; - return 0; - } - - support_cap_compose = false; - return 0; + } else { + support_cap_compose = false; + } } -static int get_out_crop_rect(cv4l_fd &fd) +static void get_out_crop_rect(cv4l_fd &fd) { cv4l_disable_trace dt(fd); v4l2_selection sel; @@ -427,11 +425,9 @@ static int get_out_crop_rect(cv4l_fd &fd) support_out_crop = true; cropped_width = sel.r.width; cropped_height = sel.r.height; - return 0; + } else { + support_out_crop = false; } - - support_out_crop = false; - return 0; } static void set_time_stamp(cv4l_buffer &buf) From patchwork Tue May 3 14:38:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xavier Roumegue (OSS)" X-Patchwork-Id: 12835864 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D234C433EF for ; Tue, 3 May 2022 14:39:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237197AbiECOmr (ORCPT ); Tue, 3 May 2022 10:42:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237201AbiECOmp (ORCPT ); Tue, 3 May 2022 10:42:45 -0400 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140075.outbound.protection.outlook.com [40.107.14.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40D1A35A92 for ; Tue, 3 May 2022 07:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gtQO76er1LSqoXLdqRrhJ5ZQv//ZxR9Au5FFZaWKevWDhtEExMcfcYj1LdJczroOzZ5F5CsaFatLOPErKE35ZLijZn/uK/2d72oxCfEU2IH2EZtYI1LctYQyAbyg2fRlVzQ7RU2hJZKmBT/IS7F5pWTA4h+LO6EGFoo89/hYjoOSmAOGzthzXYjdoct4f6j3mabFAW3dv9DFRqDnnVNXAq3M5TWa3abf6NPhFb8sVfHtlAOlxx6ykchhbOpztlYe+WD/SVzpQKKOoUkhGEUWNs2JK/BaxYICH+ERmCjPPq+QYJOqJ26uX86a1NY/F5XEjjzDH+FAmFKu3K9SF0yfHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=D5pC33qTD9J9dlBpMN40I+7o0AvFKozoFnNBhwLcjNE=; b=fZAxoacRmEV1S1BSC1QsXHM78+tMQ98PiNvqls+BYMcDbAu9azPZPiDGe1CTi8qeHFdc6d8hDD7pSURWz9ugAVvyr65z/k4kw2a8AglTg29PHEcRA/vZnj6X8sKvTmDi+H/IbObewlNvVKtryigoZUVWkgbtxHmWC9z9hxGkbjUD/jKItoo2vsmdRcXIsdCoSmlQrBhz00hf2SFG9v5Bmun/Xv3gLFRzRMv8VlXFF4OfqW5PeXCLAVcR9HxYwCNHhscwZN/apfS7DdMPrKDc1bTw12YsULwOitB0umOVRvsUxhRnJFAd7/SKtbAABTVJ3wDsNdPLQ3yhbaSfjj0UoA== 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=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D5pC33qTD9J9dlBpMN40I+7o0AvFKozoFnNBhwLcjNE=; b=OgaNr+UpYR8k48UXTx1q/wOyQAzSaHUSNv9xdg73v0+bQHfskRt/go+ykB2x0wSeFnEA0Y3DwrpfG5qXaFzFNCOKb7Om2UJuSCSE597/I2wvpT9Fve6oAleF5QAlwm9JAwRD2oPhickFnEbO4jxgq0tlweGWBvVSL1kLj5ZqWoQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8700.eurprd04.prod.outlook.com (2603:10a6:20b:43f::8) by VI1PR04MB3133.eurprd04.prod.outlook.com (2603:10a6:802:9::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Tue, 3 May 2022 14:39:09 +0000 Received: from AM9PR04MB8700.eurprd04.prod.outlook.com ([fe80::9120:6407:db5d:462c]) by AM9PR04MB8700.eurprd04.prod.outlook.com ([fe80::9120:6407:db5d:462c%7]) with mapi id 15.20.5206.014; Tue, 3 May 2022 14:39:08 +0000 From: Xavier Roumegue To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: Xavier Roumegue , linux-media@vger.kernel.org Subject: [PATCH v2 2/2] v4l2-utils: read/write full frame from/to file for m2m non codec driver Date: Tue, 3 May 2022 16:38:12 +0200 Message-Id: <20220503143812.982985-2-xavier.roumegue@oss.nxp.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220503143812.982985-1-xavier.roumegue@oss.nxp.com> References: <20220503143812.982985-1-xavier.roumegue@oss.nxp.com> X-ClientProxiedBy: PR0P264CA0196.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1f::16) To AM9PR04MB8700.eurprd04.prod.outlook.com (2603:10a6:20b:43f::8) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 545859f6-9a88-45ae-9a88-08da2d12ae11 X-MS-TrafficTypeDiagnostic: VI1PR04MB3133:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PnghuvHC+rOrRdlH92UdQNyYgyG5fKCwPm0i9zx2AldnnPOAQxVrD+VEwevH5pJyVo4UiRHwMO6ToBO6jk51G25mW7zWSADnWU4kdEJk36jRTjj3WQuWiyzUbfQe11slB0eaHUpvdQ2YdXdJgtrnF5Leb8UwsbMR08rL1rs2tBlZ4dt6u1usWplGZf7liDbTJPjkfBOwBZamSlb7PSIwFOuo3B3BG5l17JSfqw0f3ZrjPcYfbQRFnx58+GPlf9MLy8meOH5Oj91qYBL7sKTRs1vHmd/JUAgs1FMEzOPeg+IU6FBRxLvbTXDckPNGg+axH66V/6+DB8dLfXKWWEplNxwAfaMcGmScLCEas+zSXcRHjNjdcpuehmMhAAhH3lDqlk2m4ZCODz6H2kF17vCz8e8ARzhaKKcsLkEfIej4dRwHYoOq6t98N8FvegK6Zpj3cTDaqV7guCooF4+/SDO1Qs+jZh7YDQ/VKl0JHq7FvQ0H5SUiKpAZsMh147qMmY9xQvhE/HWLmxqOeBubX/IdXuJRdszY+tC5yF4LocuodlkL49nt0FApV8NF9bYbRs1db/QpKr1pSX/yJCONm+L2EZ6Bkn+Jkn4b6pSm59yRIxv28UPum2jSRioB0HvPZ0gvBwnB0rTSSo9xLeaC24WzIA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8700.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(2616005)(6666004)(6512007)(83380400001)(508600001)(6506007)(6486002)(186003)(1076003)(5660300002)(44832011)(8936002)(2906002)(316002)(8676002)(66476007)(66946007)(66556008)(52116002)(38100700002)(86362001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: ABbZOZDlgpib0dvcy6labbF2U/KQ7rw5cfJh+ULQRayIrMAJQ0rtFM6So+S1B2NDNPa733gX4xmdohNgkaqLzNFiykDXlODNi+78Xt11PIAaS4G7d2h7ei10smofuclEoZL+X0lIoVpGE2o8AWHCBJXJSIzwmdbzl2rjNUGQaqXvLv332FM/PFhArLiPPQuT/1fKPPV9Co7WbowvuPQ/pXzmrCX/r2OTadGcf8k6qAkB+9H7xDagyGQ8f78carGvPVOZyk/6wPK9xEUZLRIyvNiM1uuto4WNS9e2ny1xKUKwlg4/yPCY2YsqYJ66TDp0XIgVzPbGw46xnm8EOEQu6EhgWAMIOak3h7eHV1Iynxg9FDwgW1f84rzOGkWmUVOTB3+BCdriiJ6BrEk1MxgYc+24LXHRVlXwNDtBdjhT7jl4CuKCnva02wL28i5cOKJO0z9ckvZI2AR1YL5JSJ+6Jfn6ZYHiDiXlwSwkAM20ycVV/JTHv2YEeObt51G980ZCHS0Cu2P7AjM9xDnx7BxA9OvQ+spZGxXETSfajS7rYWNC6KtFbtZmImA8wo1sDKoLHKjH0pEqRqSdy5LdgOnzRfbduGQEoaEa/L7jYKWgnl8RjFHrIIMATr0kJQgmMGxFvJH4bHbwqHfpUYFfd3s2wsu9v5B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EsGQXpaXchNMNdQH4Fq5T6+Ne8QqFGtiffAcsKfELCLjqzSQM0+agAyONY/enxfH5C X-MS-Exchange-AntiSpam-MessageData-1: OqDVDOXAzH9kKqYjQS388FYvcb9jn2l6WjY= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 545859f6-9a88-45ae-9a88-08da2d12ae11 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8700.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2022 14:39:08.9240 (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: 9wAcfvR28pfLEhlKMkof12Gdh1iGCz0eC1mBB5bgj2ykqvupZQsH3a/9qpm3bPLasxk+xGm/B5SDhLgMSkhK/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3133 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org In case of m2m operations with a non codec capable driver, the entire frame should be read/written from/to the file while writing/reading the output/capture buffer in case of crop/compose operations. fixes: d1b18e65fbdf (v4l2-ctl: Add support for crop and compose selection in streaming) Signed-off-by: Xavier Roumegue --- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 28 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 8a06c754..0f9f31f5 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -89,6 +89,8 @@ enum codec_type { DECODER }; +static enum codec_type codec_type; + #define QUEUE_ERROR -1 #define QUEUE_STOPPED -2 @@ -352,7 +354,7 @@ void streaming_usage() V4L_STREAM_PORT); } -static enum codec_type get_codec_type(cv4l_fd &fd) +static void get_codec_type(cv4l_fd &fd) { cv4l_disable_trace dt(fd); struct v4l2_fmtdesc fmt_desc = {}; @@ -361,11 +363,13 @@ static enum codec_type get_codec_type(cv4l_fd &fd) int num_out_fmts = 0; int num_compressed_out_fmts = 0; + codec_type = NOT_CODEC; + if (!fd.has_vid_m2m()) - return NOT_CODEC; + return; if (fd.enum_fmt(fmt_desc, true, 0, fd.g_type())) - return NOT_CODEC; + return; do { if (fmt_desc.flags & V4L2_FMT_FLAG_COMPRESSED) @@ -375,7 +379,7 @@ static enum codec_type get_codec_type(cv4l_fd &fd) if (fd.enum_fmt(fmt_desc, true, 0, v4l_type_invert(fd.g_type()))) - return NOT_CODEC; + return; do { if (fmt_desc.flags & V4L2_FMT_FLAG_COMPRESSED) @@ -384,14 +388,14 @@ static enum codec_type get_codec_type(cv4l_fd &fd) } while (!fd.enum_fmt(fmt_desc)); if (num_compressed_out_fmts == 0 && num_compressed_cap_fmts == num_cap_fmts) { - return ENCODER; + codec_type = ENCODER; + return; } if (num_compressed_cap_fmts == 0 && num_compressed_out_fmts == num_out_fmts) { - return DECODER; + codec_type = DECODER; + return; } - - return NOT_CODEC; } static void get_cap_compose_rect(cv4l_fd &fd) @@ -1105,7 +1109,8 @@ restart: if (fmt.g_pixelformat() == V4L2_PIX_FMT_FWHT_STATELESS) res = read_fwht_frame(fmt, static_cast(buf), fin, sz, expected_len, buf_len); - else if (support_out_crop && v4l2_fwht_find_pixfmt(fmt.g_pixelformat())) + else if (codec_type != NOT_CODEC && + support_out_crop && v4l2_fwht_find_pixfmt(fmt.g_pixelformat())) res = read_write_padded_frame(fmt, static_cast(buf), fin, sz, expected_len, buf_len, true); else @@ -1365,7 +1370,8 @@ static void write_buffer_to_file(cv4l_fd &fd, cv4l_queue &q, cv4l_buffer &buf, } if (host_fd_to >= 0) sz = fwrite(comp_ptr[j] + offset, 1, used, fout); - else if (support_cap_compose && v4l2_fwht_find_pixfmt(fmt.g_pixelformat())) + else if (codec_type != NOT_CODEC && + support_cap_compose && v4l2_fwht_find_pixfmt(fmt.g_pixelformat())) read_write_padded_frame(fmt, static_cast(q.g_dataptr(buf.g_index(), j)) + offset, fout, sz, used, used, false); else @@ -2258,7 +2264,6 @@ static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out, bool have_eos = subscribe_event(fd, V4L2_EVENT_EOS); bool is_encoder = false; - enum codec_type codec_type = get_codec_type(fd); bool ignore_count_skip = codec_type == ENCODER; if (have_eos) { @@ -2864,6 +2869,7 @@ void streaming_set(cv4l_fd &fd, cv4l_fd &out_fd, cv4l_fd &exp_fd) get_cap_compose_rect(fd); get_out_crop_rect(fd); + get_codec_type(fd); if (do_cap && do_out && out_fd.g_fd() < 0) streaming_set_m2m(fd, exp_fd);