From patchwork Fri Aug 30 15:26:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21104 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 DD5B3C32C2 for ; Fri, 30 Aug 2024 15:27:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 66C30634CA; Fri, 30 Aug 2024 17:27:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="eW6hBnlZ"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D01A76341E for ; Fri, 30 Aug 2024 17:27:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031650; 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: in-reply-to:in-reply-to:references:references; bh=siZf+NQlnAsFmn+rrRKg9pet6fPyIfLrQQPzkgpvnTM=; b=eW6hBnlZ1ORa3NL8eAQTGsLcyZfMQt98PcpN8Nd0vxKsoCYEhN5QihmsplINrgYafFYaBa KyfW5o4lwyLIhpPtqyHLobQL2iyCoZKIk96xyTiEBhPS5lnE5p8ZE94nc2P8sEyJYONFH6 l5dIhJRXAGGfvD37Wli19U32VFf3ZZY= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-259-JIgBMlZoOgukYOqrNlSZrQ-1; Fri, 30 Aug 2024 11:27:29 -0400 X-MC-Unique: JIgBMlZoOgukYOqrNlSZrQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C52AE1955D4D for ; Fri, 30 Aug 2024 15:27:28 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6F1451956048; Fri, 30 Aug 2024 15:27:27 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 01/20] tests: Add a missing iostream include Date: Fri, 30 Aug 2024 17:26:58 +0200 Message-ID: <20240830152721.1420313-2-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" generated_serializer_test.cpp uses iostream without including it, relying on imports from another included header. Let's include iostream there. Signed-off-by: Milan Zamazal Reviewed-by: Laurent Pinchart --- .../generated_serializer/generated_serializer_test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/serialization/generated_serializer/generated_serializer_test.cpp b/test/serialization/generated_serializer/generated_serializer_test.cpp index 4b11d67f..dd696885 100644 --- a/test/serialization/generated_serializer/generated_serializer_test.cpp +++ b/test/serialization/generated_serializer/generated_serializer_test.cpp @@ -6,6 +6,7 @@ */ #include +#include #include #include From patchwork Fri Aug 30 15:26:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21105 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 9BCDEC32D5 for ; Fri, 30 Aug 2024 15:27:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1299B634CC; Fri, 30 Aug 2024 17:27:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="aCZKswmA"; dkim-atps=neutral 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 25B2D6341E for ; Fri, 30 Aug 2024 17:27:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031652; 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: in-reply-to:in-reply-to:references:references; bh=PJQRA5gnXHlb90quavd8QuEFBAUcGjg2/CPlNE8X2pQ=; b=aCZKswmAeEeVX1CN4tWyCfiVSf0G93DM9FMCKt6EvLiLh+mI5qJdZSGYJEYjab/u2Tcpfv 9U3rMeegNXrXiEMY9Vn+e+RRQN0lLqXGh8urOWTPwDd0FUg8Jt/e1WpkmkevqA1vbrd1cJ /tlMvi9Z0r7IUoIE563U6jhWlwMZW0I= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-bv1r2zAGO3uJNjn1rt0oOg-1; Fri, 30 Aug 2024 11:27:31 -0400 X-MC-Unique: bv1r2zAGO3uJNjn1rt0oOg-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 57C941956095 for ; Fri, 30 Aug 2024 15:27:30 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 163BA1956048; Fri, 30 Aug 2024 15:27:28 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 02/20] libcamera: ipu3: Remove unused includes Date: Fri, 30 Aug 2024 17:26:59 +0200 Message-ID: <20240830152721.1420313-3-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The includes that are not used can be removed. Signed-off-by: Milan Zamazal Reviewed-by: Laurent Pinchart --- src/ipa/ipu3/algorithms/af.cpp | 3 --- src/ipa/ipu3/algorithms/agc.cpp | 1 - src/ipa/ipu3/algorithms/blc.cpp | 2 -- src/ipa/ipu3/ipu3.cpp | 5 ----- src/libcamera/pipeline/ipu3/ipu3.cpp | 1 - 5 files changed, 12 deletions(-) diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp index 29eb7355..cf68fb59 100644 --- a/src/ipa/ipu3/algorithms/af.cpp +++ b/src/ipa/ipu3/algorithms/af.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -23,8 +22,6 @@ #include -#include "libipa/histogram.h" - /** * \file af.h */ diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index 0e0114f6..3378c4fd 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -9,7 +9,6 @@ #include #include -#include #include #include diff --git a/src/ipa/ipu3/algorithms/blc.cpp b/src/ipa/ipu3/algorithms/blc.cpp index 257f40e2..fa4b9272 100644 --- a/src/ipa/ipu3/algorithms/blc.cpp +++ b/src/ipa/ipu3/algorithms/blc.cpp @@ -7,8 +7,6 @@ #include "blc.h" -#include - /** * \file blc.h * \brief IPU3 Black Level Correction control diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index cdcdf1fb..656c51fc 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -32,12 +32,7 @@ #include "libcamera/internal/mapped_framebuffer.h" #include "libcamera/internal/yaml_parser.h" -#include "algorithms/af.h" #include "algorithms/agc.h" -#include "algorithms/algorithm.h" -#include "algorithms/awb.h" -#include "algorithms/blc.h" -#include "algorithms/tone_mapping.h" #include "libipa/camera_sensor_helper.h" #include "ipa_context.h" diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 2071c338..29172f34 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -6,7 +6,6 @@ */ #include -#include #include #include #include From patchwork Fri Aug 30 15:27:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21106 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 5FA74C324C for ; Fri, 30 Aug 2024 15:27:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0F1DB634D5; Fri, 30 Aug 2024 17:27:41 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="bsfAf/bM"; dkim-atps=neutral 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 B07BD634CB for ; Fri, 30 Aug 2024 17:27:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031655; 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: in-reply-to:in-reply-to:references:references; bh=gDHVeNMFKSWnDfjkPStA5LXfRtrx/FL2tfHLlZgv4Do=; b=bsfAf/bMw0mgtWgeWMBx5Rux4K3hZCf6jhYbeAGYR5pRJNF+Ue9w7KGeSwnuuJW4zlLQhf kFHypz6h1/XT2iGUNykpaggIqb86IV2TXpU0KfqLuVek2kVdmlGqahy+x0WhgMRCyUORxw FHaeOUBh6XYtWeq58ZcD4fqTDx9c51g= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-620-ZRGkGD30N-iNK7J8lXKVMA-1; Fri, 30 Aug 2024 11:27:33 -0400 X-MC-Unique: ZRGkGD30N-iNK7J8lXKVMA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 450651956095 for ; Fri, 30 Aug 2024 15:27:32 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D3E5B1956048; Fri, 30 Aug 2024 15:27:30 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 03/20] libcamera: ipu3: Replace wrong include Date: Fri, 30 Aug 2024 17:27:00 +0200 Message-ID: <20240830152721.1420313-4-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" v4l2_videodevice.h is not used but logging is imported through it. Remove the unused include and include log.h instead. Signed-off-by: Milan Zamazal Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/frames.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/ipu3/frames.cpp b/src/libcamera/pipeline/ipu3/frames.cpp index 88eb9d05..bc0526a7 100644 --- a/src/libcamera/pipeline/ipu3/frames.cpp +++ b/src/libcamera/pipeline/ipu3/frames.cpp @@ -7,12 +7,13 @@ #include "frames.h" +#include + #include #include #include "libcamera/internal/framebuffer.h" #include "libcamera/internal/pipeline_handler.h" -#include "libcamera/internal/v4l2_videodevice.h" namespace libcamera { From patchwork Fri Aug 30 15:27:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21107 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 BCF0DC32C2 for ; Fri, 30 Aug 2024 15:27:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4E018634E1; Fri, 30 Aug 2024 17:27:45 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="KdM87X36"; dkim-atps=neutral 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 0446863471 for ; Fri, 30 Aug 2024 17:27:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031659; 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: in-reply-to:in-reply-to:references:references; bh=ywSY6p4fFmH8QIDlsFFlK08JzmSG6iwY6VoDTSN2CvM=; b=KdM87X36URtxO0UqhYEK6zJChhOh0FH1zWYAiNUSXyzQ4aO9AdzGMwuU8pitPh27BRkgxn iJtOE2Xv7Sz8zlCbwVqv7OUfr0R+wQDC7Y9P4QIN4fN5+XsxIg4IE+41cIShlcoI6s0BBH xnzT1ibjGeEsd08yYMXzWSHlJ01qxTA= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-114-8ItqOCIrPa6UJlEjEke0pQ-1; Fri, 30 Aug 2024 11:27:34 -0400 X-MC-Unique: 8ItqOCIrPa6UJlEjEke0pQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0FE2B1955BEF for ; Fri, 30 Aug 2024 15:27:34 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A569F1956048; Fri, 30 Aug 2024 15:27:32 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 04/20] libcamera: ipu3: Formatting improvements Date: Fri, 30 Aug 2024 17:27:01 +0200 Message-ID: <20240830152721.1420313-5-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. Signed-off-by: Milan Zamazal --- src/ipa/ipu3/algorithms/agc.cpp | 31 ++++++++++----------- src/ipa/ipu3/algorithms/blc.cpp | 4 +-- src/ipa/ipu3/ipu3.cpp | 11 ++++---- src/libcamera/pipeline/ipu3/ipu3.cpp | 40 +++++++++++++++------------- 4 files changed, 45 insertions(+), 41 deletions(-) diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index 3378c4fd..548b64a4 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -14,6 +14,7 @@ #include #include + #include #include "libipa/histogram.h" @@ -136,11 +137,9 @@ Histogram Agc::parseStatistics(const ipu3_uapi_stats_3a *stats, reinterpret_cast( &stats->awb_raw_buffer.meta_data[cellPosition]); - rgbTriples_.push_back({ - cell->R_avg, - (cell->Gr_avg + cell->Gb_avg) / 2, - cell->B_avg - }); + rgbTriples_.push_back({ cell->R_avg, + (cell->Gr_avg + cell->Gb_avg) / 2, + cell->B_avg }); /* * Store the average green value to estimate the @@ -184,9 +183,10 @@ double Agc::estimateLuminance(double gain) const blueSum += std::min(std::get<2>(rgbTriples_[i]) * gain, 255.0); } - double ySum = redSum * rGain_ * 0.299 - + greenSum * gGain_ * 0.587 - + blueSum * bGain_ * 0.114; + double ySum = + redSum * rGain_ * 0.299 + + greenSum * gGain_ * 0.587 + + blueSum * bGain_ * 0.114; return ySum / (bdsGrid_.height * bdsGrid_.width) / 255; } @@ -216,8 +216,8 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, * The Agc algorithm needs to know the effective exposure value that was * applied to the sensor when the statistics were collected. */ - utils::Duration exposureTime = context.configuration.sensor.lineDuration - * frameContext.sensor.exposure; + utils::Duration exposureTime = + context.configuration.sensor.lineDuration * frameContext.sensor.exposure; double analogueGain = frameContext.sensor.gain; utils::Duration effectiveExposureValue = exposureTime * analogueGain; @@ -241,12 +241,13 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, metadata.set(controls::ExposureTime, exposureTime.get()); /* \todo Use VBlank value calculated from each frame exposure. */ - uint32_t vTotal = context.configuration.sensor.size.height - + context.configuration.sensor.defVBlank; - utils::Duration frameDuration = context.configuration.sensor.lineDuration - * vTotal; + uint32_t vTotal = + context.configuration.sensor.size.height + + context.configuration.sensor.defVBlank; + utils::Duration frameDuration = + context.configuration.sensor.lineDuration * + vTotal; metadata.set(controls::FrameDuration, frameDuration.get()); - } REGISTER_IPA_ALGORITHM(Agc, "Agc") diff --git a/src/ipa/ipu3/algorithms/blc.cpp b/src/ipa/ipu3/algorithms/blc.cpp index fa4b9272..35748fb2 100644 --- a/src/ipa/ipu3/algorithms/blc.cpp +++ b/src/ipa/ipu3/algorithms/blc.cpp @@ -55,8 +55,8 @@ void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context, * tuning processes. This is a first rough approximation. */ params->obgrid_param.gr = 64; - params->obgrid_param.r = 64; - params->obgrid_param.b = 64; + params->obgrid_param.r = 64; + params->obgrid_param.b = 64; params->obgrid_param.gb = 64; /* Enable the custom black level correction processing */ diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 656c51fc..e6b2b5bb 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -24,10 +24,11 @@ #include #include +#include + #include #include #include -#include #include "libcamera/internal/mapped_framebuffer.h" #include "libcamera/internal/yaml_parser.h" @@ -308,8 +309,8 @@ int IPAIPU3::init(const IPASettings &settings, /* Clean context */ context_.configuration = {}; - context_.configuration.sensor.lineDuration = sensorInfo.minLineLength - * 1.0s / sensorInfo.pixelRate; + context_.configuration.sensor.lineDuration = + sensorInfo.minLineLength * 1.0s / sensorInfo.pixelRate; /* Load the tuning data file. */ File file(settings.configurationFile); @@ -472,8 +473,8 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo, context_.frameContexts.clear(); /* Initialise the sensor configuration. */ - context_.configuration.sensor.lineDuration = sensorInfo_.minLineLength - * 1.0s / sensorInfo_.pixelRate; + context_.configuration.sensor.lineDuration = + sensorInfo_.minLineLength * 1.0s / sensorInfo_.pixelRate; context_.configuration.sensor.size = sensorInfo_.outputSize; /* diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 29172f34..6b4fe486 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -18,12 +18,13 @@ #include #include #include -#include -#include #include #include #include +#include +#include + #include "libcamera/internal/camera.h" #include "libcamera/internal/camera_lens.h" #include "libcamera/internal/camera_sensor.h" @@ -417,9 +418,9 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, Spanresolution().shrunkBy({ 1, 1 }) - .alignedDownTo(ImgUDevice::kOutputMarginWidth, - ImgUDevice::kOutputMarginHeight); + Size minSize = sensor->resolution() + .shrunkBy({ 1, 1 }) + .alignedDownTo(ImgUDevice::kOutputMarginWidth, + ImgUDevice::kOutputMarginHeight); /* * Either the smallest margin-aligned size larger than the viewfinder * size or the adjusted sensor resolution. */ minSize = kViewfinderSize.grownBy({ 1, 1 }) - .alignedUpTo(ImgUDevice::kOutputMarginWidth, - ImgUDevice::kOutputMarginHeight) - .boundedTo(minSize); + .alignedUpTo(ImgUDevice::kOutputMarginWidth, + ImgUDevice::kOutputMarginHeight) + .boundedTo(minSize); /* * Re-scale in the sensor's native coordinates. Report (0,0) as @@ -1116,19 +1118,19 @@ int PipelineHandlerIPU3::registerCameras() * returned through the ImgU main and secondary outputs. */ data->cio2_.bufferReady().connect(data.get(), - &IPU3CameraData::cio2BufferReady); + &IPU3CameraData::cio2BufferReady); data->cio2_.bufferAvailable.connect( data.get(), &IPU3CameraData::queuePendingRequests); data->imgu_->input_->bufferReady.connect(&data->cio2_, - &CIO2Device::tryReturnBuffer); + &CIO2Device::tryReturnBuffer); data->imgu_->output_->bufferReady.connect(data.get(), - &IPU3CameraData::imguOutputBufferReady); + &IPU3CameraData::imguOutputBufferReady); data->imgu_->viewfinder_->bufferReady.connect(data.get(), - &IPU3CameraData::imguOutputBufferReady); + &IPU3CameraData::imguOutputBufferReady); data->imgu_->param_->bufferReady.connect(data.get(), - &IPU3CameraData::paramBufferReady); + &IPU3CameraData::paramBufferReady); data->imgu_->stat_->bufferReady.connect(data.get(), - &IPU3CameraData::statBufferReady); + &IPU3CameraData::statBufferReady); /* Create and register the Camera instance. */ const std::string &cameraId = cio2->sensor()->id(); From patchwork Fri Aug 30 15:27:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21108 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 04468C32D6 for ; Fri, 30 Aug 2024 15:27:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 305C0634CD; Fri, 30 Aug 2024 17:27:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="BX/GPRtt"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 670DB634CB for ; Fri, 30 Aug 2024 17:27:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031659; 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: in-reply-to:in-reply-to:references:references; bh=97y4j6cbj7MpOmXAsRm2Btt19g0LOOX0e1/7evm3xAU=; b=BX/GPRtt+RkVmTdys1nP/Mq2chwx15dhCRtykwUSQ0/M/Us8Wu48B5pLVcpp6GxIvcV7mU vdqH7dJhHlTsCjFZMBpyFivZYK8161MTHHYPl4cYfxaokSoTaGeMRJAiDwDq8aJQ39Dl8L CUIMGQtp+AFItDbQ8qbBcVMtpQTwg9A= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-389-vB6-SIyyN5e1bVzqJq1h3Q-1; Fri, 30 Aug 2024 11:27:37 -0400 X-MC-Unique: vB6-SIyyN5e1bVzqJq1h3Q-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DD14B1955F42 for ; Fri, 30 Aug 2024 15:27:35 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6D71C1956048; Fri, 30 Aug 2024 15:27:34 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 05/20] libcamera: rkisp1: Remove unused includes Date: Fri, 30 Aug 2024 17:27:02 +0200 Message-ID: <20240830152721.1420313-6-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The includes that are not used can be removed. Signed-off-by: Milan Zamazal --- src/ipa/rkisp1/algorithms/agc.h | 1 - src/ipa/rkisp1/algorithms/awb.cpp | 2 -- src/ipa/rkisp1/algorithms/ccm.cpp | 4 ---- src/ipa/rkisp1/algorithms/dpf.cpp | 2 -- src/ipa/rkisp1/rkisp1.cpp | 2 -- src/ipa/rkisp1/utils.h | 1 - src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 -- 7 files changed, 14 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h index d64ff42c..aa86f2c5 100644 --- a/src/ipa/rkisp1/algorithms/agc.h +++ b/src/ipa/rkisp1/algorithms/agc.h @@ -15,7 +15,6 @@ #include #include "libipa/agc_mean_luminance.h" -#include "libipa/histogram.h" #include "algorithm.h" diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index b40f405f..a5972015 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -8,8 +8,6 @@ #include "awb.h" #include -#include -#include #include diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp index ca80112a..47a8b7e5 100644 --- a/src/ipa/rkisp1/algorithms/ccm.cpp +++ b/src/ipa/rkisp1/algorithms/ccm.cpp @@ -7,10 +7,6 @@ #include "ccm.h" -#include -#include -#include -#include #include #include diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 079cc2c3..94080b28 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -7,8 +7,6 @@ #include "dpf.h" -#include - #include #include diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 79ae9289..55269579 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -6,8 +6,6 @@ */ #include -#include -#include #include #include diff --git a/src/ipa/rkisp1/utils.h b/src/ipa/rkisp1/utils.h index 450f2244..5f38b50b 100644 --- a/src/ipa/rkisp1/utils.h +++ b/src/ipa/rkisp1/utils.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include namespace libcamera { diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 710d9573..5ff8eb9c 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -6,8 +6,6 @@ */ #include -#include -#include #include #include #include From patchwork Fri Aug 30 15:27:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21109 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 0947FC32D7 for ; Fri, 30 Aug 2024 15:27:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4EF26634DD; Fri, 30 Aug 2024 17:27:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="ZrHs/hF4"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8DA1C634CD for ; Fri, 30 Aug 2024 17:27:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031659; 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: in-reply-to:in-reply-to:references:references; bh=pGplRR87kOfW0wQVbOTmZ8UmxjSQD6qIhfe6qeyQVvo=; b=ZrHs/hF4RnHLrB//KArwILwTbqDABRnFMJiFii3o/QXx8tqK2t13k1KbbPq5PMPHKiL/JR cvNpRtbc0/Z1Y+0sQsfKs7Z/NlHfbPe02QNkMAReySDu5Ras6WBhZC9XxG3ZHN6FBS1jJq sbRoF4oMvaaMIoTZeHstjIVkPlzojnY= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-609-W8HZjzsuOZOCehhDV3wvvA-1; Fri, 30 Aug 2024 11:27:38 -0400 X-MC-Unique: W8HZjzsuOZOCehhDV3wvvA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 518911955BFE for ; Fri, 30 Aug 2024 15:27:37 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3975D1956048; Fri, 30 Aug 2024 15:27:35 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 06/20] libcamera: rkisp1: Formatting improvements Date: Fri, 30 Aug 2024 17:27:03 +0200 Message-ID: <20240830152721.1420313-7-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. Signed-off-by: Milan Zamazal --- src/ipa/rkisp1/algorithms/awb.cpp | 18 +++++++++--------- src/ipa/rkisp1/algorithms/dpf.cpp | 4 ++-- src/ipa/rkisp1/rkisp1.cpp | 20 +++++++++++--------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index a5972015..35435fe2 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -12,6 +12,7 @@ #include #include + #include /** @@ -209,10 +210,9 @@ void Awb::process(IPAContext &context, double blueMean; metadata.set(controls::AwbEnable, frameContext.awb.autoEnabled); - metadata.set(controls::ColourGains, { - static_cast(frameContext.awb.gains.red), - static_cast(frameContext.awb.gains.blue) - }); + metadata.set(controls::ColourGains, + { static_cast(frameContext.awb.gains.red), + static_cast(frameContext.awb.gains.blue) }); if (rgbMode_) { greenMean = awb->awb_mean[0].mean_y_or_g; @@ -305,11 +305,11 @@ void Awb::process(IPAContext &context, activeState.awb.gains.automatic.green = 1.0; LOG(RkISP1Awb, Debug) << std::showpoint - << "Means [" << redMean << ", " << greenMean << ", " << blueMean - << "], gains [" << activeState.awb.gains.automatic.red << ", " - << activeState.awb.gains.automatic.green << ", " - << activeState.awb.gains.automatic.blue << "], temp " - << activeState.awb.temperatureK << "K"; + << "Means [" << redMean << ", " << greenMean << ", " << blueMean + << "], gains [" << activeState.awb.gains.automatic.red << ", " + << activeState.awb.gains.automatic.green << ", " + << activeState.awb.gains.automatic.blue << "], temp " + << activeState.awb.temperatureK << "K"; } REGISTER_IPA_ALGORITHM(Awb, "Awb") diff --git a/src/ipa/rkisp1/algorithms/dpf.cpp b/src/ipa/rkisp1/algorithms/dpf.cpp index 94080b28..ef1f25d7 100644 --- a/src/ipa/rkisp1/algorithms/dpf.cpp +++ b/src/ipa/rkisp1/algorithms/dpf.cpp @@ -116,8 +116,8 @@ int Dpf::init([[maybe_unused]] IPAContext &context, } config_.rb_flt.fltsize = values.size() == RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS - ? RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 - : RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9; + ? RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9 + : RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9; std::copy_n(values.begin(), values.size(), std::begin(config_.rb_flt.spatial_coeff)); diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 55269579..3c13c82e 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -17,10 +17,11 @@ #include #include +#include + #include #include #include -#include #include "libcamera/internal/formats.h" #include "libcamera/internal/mapped_framebuffer.h" @@ -162,8 +163,8 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision, return -ENODEV; } - context_.configuration.sensor.lineDuration = sensorInfo.minLineLength - * 1.0s / sensorInfo.pixelRate; + context_.configuration.sensor.lineDuration = + sensorInfo.minLineLength * 1.0s / sensorInfo.pixelRate; /* Load the tuning data file. */ File file(settings.configurationFile); @@ -264,12 +265,13 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig, context_.configuration.sensor.maxAnalogueGain = context_.camHelper->gain(maxGain); - context_.configuration.raw = std::any_of(streamConfig.begin(), streamConfig.end(), - [](auto &cfg) -> bool { - PixelFormat pixelFormat{ cfg.second.pixelFormat }; - const PixelFormatInfo &format = PixelFormatInfo::info(pixelFormat); - return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW; - }); + context_.configuration.raw = + std::any_of(streamConfig.begin(), streamConfig.end(), + [](auto &cfg) -> bool { + PixelFormat pixelFormat{ cfg.second.pixelFormat }; + const PixelFormatInfo &format = PixelFormatInfo::info(pixelFormat); + return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW; + }); for (auto const &a : algorithms()) { Algorithm *algo = static_cast(a.get()); From patchwork Fri Aug 30 15:27:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21110 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 9E6ECC324C for ; Fri, 30 Aug 2024 15:27:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2C2A6634CF; Fri, 30 Aug 2024 17:27:52 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Ui9pZYpV"; dkim-atps=neutral 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 8975A63466 for ; Fri, 30 Aug 2024 17:27:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031661; 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: in-reply-to:in-reply-to:references:references; bh=qA1gJunqwrhQNHv6mgvw3Oqz7n7Qrd+6PlT3tQiaALM=; b=Ui9pZYpVfohSHp5iTVJQo07JXrP+gSPdoyxRfRmYJnE1lROaUEMrHHDL6tvi9B6ruoo6J9 RXoHroSAptzk+B9WVX8k6piDdh1nAZ3AS7yvtDQbYqk3KMmetUJ9vTmKbxnx92BPbeICQy jIclqQspyBXSrNlatjgTeaAFGxLGzPA= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-102-zJjQrjfgMluSYLLU5-cHnA-1; Fri, 30 Aug 2024 11:27:40 -0400 X-MC-Unique: zJjQrjfgMluSYLLU5-cHnA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 44A141955F4A for ; Fri, 30 Aug 2024 15:27:39 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DB2801956048; Fri, 30 Aug 2024 15:27:37 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 07/20] libcamera: libipa: Remove unused includes Date: Fri, 30 Aug 2024 17:27:04 +0200 Message-ID: <20240830152721.1420313-8-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The includes that are not used can be removed. Signed-off-by: Milan Zamazal --- src/ipa/libipa/histogram.h | 1 - src/ipa/libipa/matrix.h | 1 - src/ipa/libipa/matrix_interpolator.cpp | 7 ------- src/ipa/libipa/matrix_interpolator.h | 2 -- src/ipa/libipa/pwl.cpp | 2 -- src/ipa/libipa/pwl.h | 3 --- src/ipa/libipa/vector.h | 2 -- 7 files changed, 18 deletions(-) diff --git a/src/ipa/libipa/histogram.h b/src/ipa/libipa/histogram.h index 032adca0..6fd64168 100644 --- a/src/ipa/libipa/histogram.h +++ b/src/ipa/libipa/histogram.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include #include diff --git a/src/ipa/libipa/matrix.h b/src/ipa/libipa/matrix.h index 8aa8f343..5471e697 100644 --- a/src/ipa/libipa/matrix.h +++ b/src/ipa/libipa/matrix.h @@ -7,7 +7,6 @@ #pragma once #include -#include #include #include diff --git a/src/ipa/libipa/matrix_interpolator.cpp b/src/ipa/libipa/matrix_interpolator.cpp index 04ca177f..d5188f8a 100644 --- a/src/ipa/libipa/matrix_interpolator.cpp +++ b/src/ipa/libipa/matrix_interpolator.cpp @@ -6,15 +6,8 @@ */ #include "matrix_interpolator.h" -#include -#include - #include -#include "libcamera/internal/yaml_parser.h" - -#include "matrix.h" - /** * \file matrix_interpolator.h * \brief Helper class for interpolating maps of matrices diff --git a/src/ipa/libipa/matrix_interpolator.h b/src/ipa/libipa/matrix_interpolator.h index 087c4fd1..afbce538 100644 --- a/src/ipa/libipa/matrix_interpolator.h +++ b/src/ipa/libipa/matrix_interpolator.h @@ -7,10 +7,8 @@ #pragma once -#include #include #include -#include #include diff --git a/src/ipa/libipa/pwl.cpp b/src/ipa/libipa/pwl.cpp index 9b213754..88fe2022 100644 --- a/src/ipa/libipa/pwl.cpp +++ b/src/ipa/libipa/pwl.cpp @@ -8,10 +8,8 @@ #include "pwl.h" -#include #include #include -#include /** * \file pwl.h diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h index b6f93494..d4ec9f4f 100644 --- a/src/ipa/libipa/pwl.h +++ b/src/ipa/libipa/pwl.h @@ -7,14 +7,11 @@ #pragma once #include -#include #include #include #include #include -#include "libcamera/internal/yaml_parser.h" - #include "vector.h" namespace libcamera { diff --git a/src/ipa/libipa/vector.h b/src/ipa/libipa/vector.h index 556e0967..d14ad0de 100644 --- a/src/ipa/libipa/vector.h +++ b/src/ipa/libipa/vector.h @@ -6,10 +6,8 @@ */ #pragma once -#include #include #include -#include #include #include From patchwork Fri Aug 30 15:27:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21111 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 972E3C32D5 for ; Fri, 30 Aug 2024 15:27:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C78BE634E5; Fri, 30 Aug 2024 17:27:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="S3ibBiYn"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B1596634A6 for ; Fri, 30 Aug 2024 17:27:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031662; 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: in-reply-to:in-reply-to:references:references; bh=z44xCqW+kfXhJ8SPo2aVACIY1od8zKSLDirWic72JtE=; b=S3ibBiYnGaAYhcfU7FLquYxXj6cMQreC8eEgPAdwYnnEonw6a5Cukvy7IEQL36ioTzxrK4 RCPQY4v8FlDN9DGD6PNV0dIRshCf1zuFrvILPUhwK01Rn0lVXKSSvSCpNEDK4GMU8I3ETs lGn76r55h9h5dOLwSeAc9puWZofMljk= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-193-h5-ZGx1BP-KQ6aF0qLUSqw-1; Fri, 30 Aug 2024 11:27:41 -0400 X-MC-Unique: h5-ZGx1BP-KQ6aF0qLUSqw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E09E11955F08 for ; Fri, 30 Aug 2024 15:27:40 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9BBB91956048; Fri, 30 Aug 2024 15:27:39 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 08/20] libcamera: uvcvideo: Remove unused includes Date: Fri, 30 Aug 2024 17:27:05 +0200 Message-ID: <20240830152721.1420313-9-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The includes that are not used can be removed. Signed-off-by: Milan Zamazal --- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index 8a7409fc..133ff977 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -7,10 +7,8 @@ #include #include -#include #include #include -#include #include #include From patchwork Fri Aug 30 15:27:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21112 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 24016C32C2 for ; Fri, 30 Aug 2024 15:27:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4BFA66345A; Fri, 30 Aug 2024 17:27:56 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="XQoSj8F0"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9B6E2634CC for ; Fri, 30 Aug 2024 17:27:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031664; 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: in-reply-to:in-reply-to:references:references; bh=ddATjyIacXi0OQgfBu2gJ/AX6W6JHuM3ok8JBgs+RR0=; b=XQoSj8F05533sr/vER7f+Dfutq2JW1HFoW0SAkZ9NPCWJ5n/LZ2BJZwcVncdB3rVpZR9Iw 5Itgegluax6HLXlrQEqR/+ZmwcfFLjQfhg9yDC1NsHHRIAdJBfeGJJl7uTdnqvl/YxMO+R lgtAvzByIfIAeQ8+kNwXJh3aSIy1uV0= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-433-MTY3566DPEqgyOn8MaY32g-1; Fri, 30 Aug 2024 11:27:43 -0400 X-MC-Unique: MTY3566DPEqgyOn8MaY32g-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D597D1955BF1 for ; Fri, 30 Aug 2024 15:27:42 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5C5BE1956048; Fri, 30 Aug 2024 15:27:41 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 09/20] libcamera: uvcvideo: Formatting improvement Date: Fri, 30 Aug 2024 17:27:06 +0200 Message-ID: <20240830152721.1420313-10-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. Signed-off-by: Milan Zamazal --- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index 133ff977..706457c0 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -304,8 +304,8 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id, case V4L2_CID_EXPOSURE_AUTO: { int32_t ivalue = value.get() - ? V4L2_EXPOSURE_APERTURE_PRIORITY - : V4L2_EXPOSURE_MANUAL; + ? V4L2_EXPOSURE_APERTURE_PRIORITY + : V4L2_EXPOSURE_MANUAL; controls->set(V4L2_CID_EXPOSURE_AUTO, ivalue); break; } From patchwork Fri Aug 30 15:27:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21113 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 007BBC32D6 for ; Fri, 30 Aug 2024 15:27:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 423FF634CD; Fri, 30 Aug 2024 17:27:58 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="UHGAODi/"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B560B634CB for ; Fri, 30 Aug 2024 17:27:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031666; 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: in-reply-to:in-reply-to:references:references; bh=s6063w1R0fX9t1o4dkx/6Pu0BRIXYFXQ9EyZmMjjVr8=; b=UHGAODi/6dp3PwvDQ7u8v/9tBD1buLyoyuMVqlzdzc2NLt3TSyaS+HSnqWUWovUgY4epmy mGMcc0EFxMrKvjw5U1//XqzWAdE4G0NTYotwyq65fU94BpEIbrjK3dZS1Ny1M8Lh++ECtP Pia+4vsRutV5QrMkUwKaH65dXMdFWYY= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-47-p2LG4WyiOXCreEX2oDSNWQ-1; Fri, 30 Aug 2024 11:27:45 -0400 X-MC-Unique: p2LG4WyiOXCreEX2oDSNWQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A7E921955D53 for ; Fri, 30 Aug 2024 15:27:44 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 378B51955F43; Fri, 30 Aug 2024 15:27:42 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 10/20] libcamera: v4l2: Remove unused includes Date: Fri, 30 Aug 2024 17:27:07 +0200 Message-ID: <20240830152721.1420313-11-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The includes that are not used can be removed. Signed-off-by: Milan Zamazal --- src/libcamera/v4l2_device.cpp | 2 -- src/libcamera/v4l2_subdevice.cpp | 1 - src/libcamera/v4l2_videodevice.cpp | 1 - src/v4l2/v4l2_camera.h | 1 - src/v4l2/v4l2_camera_proxy.cpp | 1 - src/v4l2/v4l2_compat.cpp | 1 - src/v4l2/v4l2_compat_manager.cpp | 1 - 7 files changed, 8 deletions(-) diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 4a2048cf..68add4f2 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -8,8 +8,6 @@ #include "libcamera/internal/v4l2_device.h" #include -#include -#include #include #include #include diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 82824433..6eaa8f01 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -8,7 +8,6 @@ #include "libcamera/internal/v4l2_subdevice.h" #include -#include #include #include #include diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 6f32521f..76742e18 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h index 278cc33e..e4e9a626 100644 --- a/src/v4l2/v4l2_camera.h +++ b/src/v4l2/v4l2_camera.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 3f7c00a2..a020a2b0 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -8,7 +8,6 @@ #include "v4l2_camera_proxy.h" #include -#include #include #include #include diff --git a/src/v4l2/v4l2_compat.cpp b/src/v4l2/v4l2_compat.cpp index 6c9dca72..ff833f57 100644 --- a/src/v4l2/v4l2_compat.cpp +++ b/src/v4l2/v4l2_compat.cpp @@ -8,7 +8,6 @@ #include "v4l2_compat_manager.h" #include -#include #include #include #include diff --git a/src/v4l2/v4l2_compat_manager.cpp b/src/v4l2/v4l2_compat_manager.cpp index 6a00afb5..f53fb300 100644 --- a/src/v4l2/v4l2_compat_manager.cpp +++ b/src/v4l2/v4l2_compat_manager.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include From patchwork Fri Aug 30 15:27:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21114 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 AC570C32D8 for ; Fri, 30 Aug 2024 15:28:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 030FC634EC; Fri, 30 Aug 2024 17:28:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="aUG9jLyE"; dkim-atps=neutral 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 7E1876345A for ; Fri, 30 Aug 2024 17:27:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031668; 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: in-reply-to:in-reply-to:references:references; bh=M9bfMi4VqzY/pQXJHFXwQBnXfGeaU/HCwM+kT8xn3Z0=; b=aUG9jLyE1IJZcef6LLRhZ2UA/OMCmNjMiDRxx5hYKPPuK5WFsbCQBia8RrHui5HDopav3F Gf/YXicuegf0FEsE0QLPFl2rfzdoLZ8UKNuB7qBU66NUhbwujaLxkyjoTU0zXqqnLZSEAs jqieMej8ZD00zytjaRcca/FLZslVWu8= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-468-BnoPLefROkCWudutq6yXwg-1; Fri, 30 Aug 2024 11:27:47 -0400 X-MC-Unique: BnoPLefROkCWudutq6yXwg-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6AE9C1955F65 for ; Fri, 30 Aug 2024 15:27:46 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 10D501956048; Fri, 30 Aug 2024 15:27:44 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 11/20] libcamera: v4l2: Formatting improvements Date: Fri, 30 Aug 2024 17:27:08 +0200 Message-ID: <20240830152721.1420313-12-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. Signed-off-by: Milan Zamazal --- src/libcamera/v4l2_device.cpp | 17 ++++++------ src/libcamera/v4l2_subdevice.cpp | 4 +-- src/libcamera/v4l2_videodevice.cpp | 36 ++++++++++++------------- src/v4l2/v4l2_camera_proxy.cpp | 43 ++++++++++++++---------------- src/v4l2/v4l2_compat.cpp | 19 +++++++------ src/v4l2/v4l2_compat_manager.cpp | 4 +-- 6 files changed, 60 insertions(+), 63 deletions(-) diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 68add4f2..0da1c5ae 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -424,11 +424,12 @@ int V4L2Device::setFrameStartEnabled(bool enable) if (frameStartEnabled_ == enable) return 0; - struct v4l2_event_subscription event{}; + struct v4l2_event_subscription event { + }; event.type = V4L2_EVENT_FRAME_SYNC; unsigned long request = enable ? VIDIOC_SUBSCRIBE_EVENT - : VIDIOC_UNSUBSCRIBE_EVENT; + : VIDIOC_UNSUBSCRIBE_EVENT; int ret = ioctl(request, &event); if (enable && ret) return ret; @@ -744,7 +745,8 @@ void V4L2Device::updateControls(ControlList *ctrls, */ void V4L2Device::eventAvailable() { - struct v4l2_event event{}; + struct v4l2_event event { + }; int ret = ioctl(VIDIOC_DQEVENT, &event); if (ret < 0) { LOG(V4L2, Error) @@ -766,11 +768,10 @@ void V4L2Device::eventAvailable() static const std::map v4l2ToColorSpace = { { V4L2_COLORSPACE_RAW, ColorSpace::Raw }, - { V4L2_COLORSPACE_SRGB, { - ColorSpace::Primaries::Rec709, - ColorSpace::TransferFunction::Srgb, - ColorSpace::YcbcrEncoding::Rec601, - ColorSpace::Range::Limited } }, + { V4L2_COLORSPACE_SRGB, + { ColorSpace::Primaries::Rec709, + ColorSpace::TransferFunction::Srgb, + ColorSpace::YcbcrEncoding::Rec601, ColorSpace::Range::Limited } }, { V4L2_COLORSPACE_JPEG, ColorSpace::Sycc }, { V4L2_COLORSPACE_SMPTE170M, ColorSpace::Smpte170m }, { V4L2_COLORSPACE_REC709, ColorSpace::Rec709 }, diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 6eaa8f01..9f2ec479 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -17,11 +17,11 @@ #include #include -#include - #include #include +#include + #include "libcamera/internal/formats.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/media_object.h" diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 76742e18..1e913c88 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -606,13 +606,13 @@ int V4L2VideoDevice::open() if (caps_.isVideoCapture()) { notifierType = EventNotifier::Read; bufferType_ = caps_.isMultiplanar() - ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE - : V4L2_BUF_TYPE_VIDEO_CAPTURE; + ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + : V4L2_BUF_TYPE_VIDEO_CAPTURE; } else if (caps_.isVideoOutput()) { notifierType = EventNotifier::Write; bufferType_ = caps_.isMultiplanar() - ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE - : V4L2_BUF_TYPE_VIDEO_OUTPUT; + ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE + : V4L2_BUF_TYPE_VIDEO_OUTPUT; } else if (caps_.isMetaCapture()) { notifierType = EventNotifier::Read; bufferType_ = V4L2_BUF_TYPE_META_CAPTURE; @@ -699,14 +699,14 @@ int V4L2VideoDevice::open(SharedFD handle, enum v4l2_buf_type type) case V4L2_BUF_TYPE_VIDEO_OUTPUT: notifierType = EventNotifier::Write; bufferType_ = caps_.isMultiplanar() - ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE - : V4L2_BUF_TYPE_VIDEO_OUTPUT; + ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE + : V4L2_BUF_TYPE_VIDEO_OUTPUT; break; case V4L2_BUF_TYPE_VIDEO_CAPTURE: notifierType = EventNotifier::Read; bufferType_ = caps_.isMultiplanar() - ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE - : V4L2_BUF_TYPE_VIDEO_CAPTURE; + ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + : V4L2_BUF_TYPE_VIDEO_CAPTURE; break; default: LOG(V4L2, Error) << "Unsupported buffer type"; @@ -792,7 +792,7 @@ void V4L2VideoDevice::close() std::string V4L2VideoDevice::logPrefix() const { return deviceNode() + "[" + std::to_string(fd()) + - (V4L2_TYPE_IS_OUTPUT(bufferType_) ? ":out]" : ":cap]"); + (V4L2_TYPE_IS_OUTPUT(bufferType_) ? ":out]" : ":cap]"); } /** @@ -1133,7 +1133,7 @@ std::vector V4L2VideoDevice::enumPixelformats(uint32_t code) return {}; } - for (unsigned int index = 0; ; index++) { + for (unsigned int index = 0;; index++) { struct v4l2_fmtdesc pixelformatEnum = {}; pixelformatEnum.index = index; pixelformatEnum.type = bufferType_; @@ -1472,9 +1472,9 @@ std::unique_ptr V4L2VideoDevice::createBuffer(unsigned int index) * account, which is equal to the bytesPerGroup ratio of * the planes. */ - unsigned int stride = format_.planes[0].bpl - * formatInfo_->planes[i].bytesPerGroup - / formatInfo_->planes[0].bytesPerGroup; + unsigned int stride = + format_.planes[0].bpl * formatInfo_->planes[i].bytesPerGroup / + formatInfo_->planes[0].bytesPerGroup; plane.fd = fd; plane.offset = offset; @@ -1827,11 +1827,11 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer() FrameMetadata &metadata = buffer->_d()->metadata(); metadata.status = buf.flags & V4L2_BUF_FLAG_ERROR - ? FrameMetadata::FrameError - : FrameMetadata::FrameSuccess; + ? FrameMetadata::FrameError + : FrameMetadata::FrameSuccess; metadata.sequence = buf.sequence; - metadata.timestamp = buf.timestamp.tv_sec * 1000000000ULL - + buf.timestamp.tv_usec * 1000ULL; + metadata.timestamp = + buf.timestamp.tv_sec * 1000000000ULL + buf.timestamp.tv_usec * 1000ULL; if (V4L2_TYPE_IS_OUTPUT(buf.type)) return buffer; @@ -1875,7 +1875,7 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer() * API. */ unsigned int bytesused = multiPlanar ? planes[0].bytesused - : buf.bytesused; + : buf.bytesused; unsigned int remaining = bytesused; for (auto [i, plane] : utils::enumerate(buffer->planes())) { diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index a020a2b0..56c557b5 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -179,17 +179,17 @@ void V4L2CameraProxy::setFmtFromConfig(const StreamConfiguration &streamConfig) { const Size &size = streamConfig.size; - v4l2PixFormat_.width = size.width; - v4l2PixFormat_.height = size.height; - v4l2PixFormat_.pixelformat = V4L2PixelFormat::fromPixelFormat(streamConfig.pixelFormat)[0]; - v4l2PixFormat_.field = V4L2_FIELD_NONE; + v4l2PixFormat_.width = size.width; + v4l2PixFormat_.height = size.height; + v4l2PixFormat_.pixelformat = V4L2PixelFormat::fromPixelFormat(streamConfig.pixelFormat)[0]; + v4l2PixFormat_.field = V4L2_FIELD_NONE; v4l2PixFormat_.bytesperline = streamConfig.stride; - v4l2PixFormat_.sizeimage = streamConfig.frameSize; - v4l2PixFormat_.colorspace = V4L2_COLORSPACE_SRGB; - v4l2PixFormat_.priv = V4L2_PIX_FMT_PRIV_MAGIC; - v4l2PixFormat_.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; + v4l2PixFormat_.sizeimage = streamConfig.frameSize; + v4l2PixFormat_.colorspace = V4L2_COLORSPACE_SRGB; + v4l2PixFormat_.priv = V4L2_PIX_FMT_PRIV_MAGIC; + v4l2PixFormat_.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; v4l2PixFormat_.quantization = V4L2_QUANTIZATION_DEFAULT; - v4l2PixFormat_.xfer_func = V4L2_XFER_FUNC_DEFAULT; + v4l2PixFormat_.xfer_func = V4L2_XFER_FUNC_DEFAULT; sizeimage_ = streamConfig.frameSize; } @@ -207,11 +207,8 @@ void V4L2CameraProxy::querycap(std::shared_ptr camera) sizeof(capabilities_.bus_info)); /* \todo Put this in a header/config somewhere. */ capabilities_.version = KERNEL_VERSION(5, 2, 0); - capabilities_.device_caps = V4L2_CAP_VIDEO_CAPTURE - | V4L2_CAP_STREAMING - | V4L2_CAP_EXT_PIX_FORMAT; - capabilities_.capabilities = capabilities_.device_caps - | V4L2_CAP_DEVICE_CAPS; + capabilities_.device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING | V4L2_CAP_EXT_PIX_FORMAT; + capabilities_.capabilities = capabilities_.device_caps | V4L2_CAP_DEVICE_CAPS; memset(capabilities_.reserved, 0, sizeof(capabilities_.reserved)); } @@ -330,17 +327,17 @@ int V4L2CameraProxy::tryFormat(struct v4l2_format *arg) return -EINVAL; } - arg->fmt.pix.width = config.size.width; - arg->fmt.pix.height = config.size.height; - arg->fmt.pix.pixelformat = V4L2PixelFormat::fromPixelFormat(config.pixelFormat)[0]; - arg->fmt.pix.field = V4L2_FIELD_NONE; + arg->fmt.pix.width = config.size.width; + arg->fmt.pix.height = config.size.height; + arg->fmt.pix.pixelformat = V4L2PixelFormat::fromPixelFormat(config.pixelFormat)[0]; + arg->fmt.pix.field = V4L2_FIELD_NONE; arg->fmt.pix.bytesperline = config.stride; - arg->fmt.pix.sizeimage = config.frameSize; - arg->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; - arg->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; - arg->fmt.pix.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; + arg->fmt.pix.sizeimage = config.frameSize; + arg->fmt.pix.colorspace = V4L2_COLORSPACE_SRGB; + arg->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC; + arg->fmt.pix.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT; arg->fmt.pix.quantization = V4L2_QUANTIZATION_DEFAULT; - arg->fmt.pix.xfer_func = V4L2_XFER_FUNC_DEFAULT; + arg->fmt.pix.xfer_func = V4L2_XFER_FUNC_DEFAULT; return 0; } diff --git a/src/v4l2/v4l2_compat.cpp b/src/v4l2/v4l2_compat.cpp index ff833f57..a18d6cc9 100644 --- a/src/v4l2/v4l2_compat.cpp +++ b/src/v4l2/v4l2_compat.cpp @@ -5,8 +5,6 @@ * V4L2 compatibility layer */ -#include "v4l2_compat_manager.h" - #include #include #include @@ -18,17 +16,19 @@ #include +#include "v4l2_compat_manager.h" + #define LIBCAMERA_PUBLIC __attribute__((visibility("default"))) using namespace libcamera; -#define extract_va_arg(type, arg, last) \ -{ \ - va_list ap; \ - va_start(ap, last); \ - arg = va_arg(ap, type); \ - va_end(ap); \ -} +#define extract_va_arg(type, arg, last) \ + { \ + va_list ap; \ + va_start(ap, last); \ + arg = va_arg(ap, type); \ + va_end(ap); \ + } namespace { @@ -164,5 +164,4 @@ LIBCAMERA_PUBLIC int ioctl(int fd, unsigned long request, ...) return V4L2CompatManager::instance()->ioctl(fd, request, arg); } - } diff --git a/src/v4l2/v4l2_compat_manager.cpp b/src/v4l2/v4l2_compat_manager.cpp index f53fb300..54aba540 100644 --- a/src/v4l2/v4l2_compat_manager.cpp +++ b/src/v4l2/v4l2_compat_manager.cpp @@ -171,8 +171,8 @@ int V4L2CompatManager::openat(int dirfd, const char *path, int oflag, mode_t mod fops_.close(fd); int efd = eventfd(0, EFD_SEMAPHORE | - ((oflag & O_CLOEXEC) ? EFD_CLOEXEC : 0) | - ((oflag & O_NONBLOCK) ? EFD_NONBLOCK : 0)); + ((oflag & O_CLOEXEC) ? EFD_CLOEXEC : 0) | + ((oflag & O_NONBLOCK) ? EFD_NONBLOCK : 0)); if (efd < 0) return efd; From patchwork Fri Aug 30 15:27:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21116 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 1604AC32D9 for ; Fri, 30 Aug 2024 15:28:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 30AF9634ED; Fri, 30 Aug 2024 17:28:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="hsc8W9ef"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C483D63471 for ; Fri, 30 Aug 2024 17:27:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031672; 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: in-reply-to:in-reply-to:references:references; bh=Oamet7IwBoNlXGKxprtbvcgZm97rhUZjtxLNc/Ss54U=; b=hsc8W9effnyhB7zHzGhhOFpSVDICLbjGLpvzdVzeeJlz2ztqvO0dXUKuRIfoLX6v1mGPSB 6jo9WH9uAA+3bQFH9pShCHuJoUhYXsFvInZKWKPmqnMBA3ERtSe4krPu5z/d6AGVa6E/5c BhDy5XrvUZo3c4GTvDcQe+wCwFR6wOU= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-335-iPTWJ3O0PeeDtTVbGbL4SA-1; Fri, 30 Aug 2024 11:27:49 -0400 X-MC-Unique: iPTWJ3O0PeeDtTVbGbL4SA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 827611955D4F for ; Fri, 30 Aug 2024 15:27:48 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C4E011956048; Fri, 30 Aug 2024 15:27:46 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 12/20] libcamera: v4l2_subdevice: Formatting improvements Date: Fri, 30 Aug 2024 17:27:09 +0200 Message-ID: <20240830152721.1420313-13-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. In v4l2_subdevice.cpp, this causes larger changes, extracted to a separate patch. Signed-off-by: Milan Zamazal --- src/libcamera/v4l2_subdevice.cpp | 1306 ++++++++++++++++-------------- 1 file changed, 693 insertions(+), 613 deletions(-) diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 9f2ec479..38b448dc 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -90,616 +90,695 @@ namespace { const std::map mediaBusFormatInfo{ /* This table is sorted to match the order in linux/media-bus-format.h */ - { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, { - .name = "RGB444_2X8_PADHI_BE", - .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, { - .name = "RGB444_2X8_PADHI_LE", - .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, { - .name = "RGB555_2X8_PADHI_BE", - .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, { - .name = "RGB555_2X8_PADHI_LE", - .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB565_1X16, { - .name = "RGB565_1X16", - .code = MEDIA_BUS_FMT_RGB565_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_BGR565_2X8_BE, { - .name = "BGR565_2X8_BE", - .code = MEDIA_BUS_FMT_BGR565_2X8_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_BGR565_2X8_LE, { - .name = "BGR565_2X8_LE", - .code = MEDIA_BUS_FMT_BGR565_2X8_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB565_2X8_BE, { - .name = "RGB565_2X8_BE", - .code = MEDIA_BUS_FMT_RGB565_2X8_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB565_2X8_LE, { - .name = "RGB565_2X8_LE", - .code = MEDIA_BUS_FMT_RGB565_2X8_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB666_1X18, { - .name = "RGB666_1X18", - .code = MEDIA_BUS_FMT_RGB666_1X18, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 18, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_BGR888_1X24, { - .name = "BGR888_1X24", - .code = MEDIA_BUS_FMT_BGR888_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB888_1X24, { - .name = "RGB888_1X24", - .code = MEDIA_BUS_FMT_RGB888_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB888_2X12_BE, { - .name = "RGB888_2X12_BE", - .code = MEDIA_BUS_FMT_RGB888_2X12_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_RGB888_2X12_LE, { - .name = "RGB888_2X12_LE", - .code = MEDIA_BUS_FMT_RGB888_2X12_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_ARGB8888_1X32, { - .name = "ARGB8888_1X32", - .code = MEDIA_BUS_FMT_ARGB8888_1X32, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 32, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_Y8_1X8, { - .name = "Y8_1X8", - .code = MEDIA_BUS_FMT_Y8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UV8_1X8, { - .name = "UV8_1X8", - .code = MEDIA_BUS_FMT_UV8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY8_1_5X8, { - .name = "UYVY8_1_5X8", - .code = MEDIA_BUS_FMT_UYVY8_1_5X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY8_1_5X8, { - .name = "VYUY8_1_5X8", - .code = MEDIA_BUS_FMT_VYUY8_1_5X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV8_1_5X8, { - .name = "YUYV8_1_5X8", - .code = MEDIA_BUS_FMT_YUYV8_1_5X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU8_1_5X8, { - .name = "YVYU8_1_5X8", - .code = MEDIA_BUS_FMT_YVYU8_1_5X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY8_2X8, { - .name = "UYVY8_2X8", - .code = MEDIA_BUS_FMT_UYVY8_2X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY8_2X8, { - .name = "VYUY8_2X8", - .code = MEDIA_BUS_FMT_VYUY8_2X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV8_2X8, { - .name = "YUYV8_2X8", - .code = MEDIA_BUS_FMT_YUYV8_2X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU8_2X8, { - .name = "YVYU8_2X8", - .code = MEDIA_BUS_FMT_YVYU8_2X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_Y10_1X10, { - .name = "Y10_1X10", - .code = MEDIA_BUS_FMT_Y10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY10_2X10, { - .name = "UYVY10_2X10", - .code = MEDIA_BUS_FMT_UYVY10_2X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY10_2X10, { - .name = "VYUY10_2X10", - .code = MEDIA_BUS_FMT_VYUY10_2X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV10_2X10, { - .name = "YUYV10_2X10", - .code = MEDIA_BUS_FMT_YUYV10_2X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU10_2X10, { - .name = "YVYU10_2X10", - .code = MEDIA_BUS_FMT_YVYU10_2X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_Y12_1X12, { - .name = "Y12_1X12", - .code = MEDIA_BUS_FMT_Y12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_Y16_1X16, { - .name = "Y16_1X16", - .code = MEDIA_BUS_FMT_Y16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY8_1X16, { - .name = "UYVY8_1X16", - .code = MEDIA_BUS_FMT_UYVY8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY8_1X16, { - .name = "VYUY8_1X16", - .code = MEDIA_BUS_FMT_VYUY8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV8_1X16, { - .name = "YUYV8_1X16", - .code = MEDIA_BUS_FMT_YUYV8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU8_1X16, { - .name = "YVYU8_1X16", - .code = MEDIA_BUS_FMT_YVYU8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YDYUYDYV8_1X16, { - .name = "YDYUYDYV8_1X16", - .code = MEDIA_BUS_FMT_YDYUYDYV8_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY10_1X20, { - .name = "UYVY10_1X20", - .code = MEDIA_BUS_FMT_UYVY10_1X20, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY10_1X20, { - .name = "VYUY10_1X20", - .code = MEDIA_BUS_FMT_VYUY10_1X20, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV10_1X20, { - .name = "YUYV10_1X20", - .code = MEDIA_BUS_FMT_YUYV10_1X20, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU10_1X20, { - .name = "YVYU10_1X20", - .code = MEDIA_BUS_FMT_YVYU10_1X20, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 20, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUV8_1X24, { - .name = "YUV8_1X24", - .code = MEDIA_BUS_FMT_YUV8_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUV10_1X30, { - .name = "YUV10_1X30", - .code = MEDIA_BUS_FMT_YUV10_1X30, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 30, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_AYUV8_1X32, { - .name = "AYUV8_1X32", - .code = MEDIA_BUS_FMT_AYUV8_1X32, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 32, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY12_2X12, { - .name = "UYVY12_2X12", - .code = MEDIA_BUS_FMT_UYVY12_2X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY12_2X12, { - .name = "VYUY12_2X12", - .code = MEDIA_BUS_FMT_VYUY12_2X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV12_2X12, { - .name = "YUYV12_2X12", - .code = MEDIA_BUS_FMT_YUYV12_2X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU12_2X12, { - .name = "YVYU12_2X12", - .code = MEDIA_BUS_FMT_YVYU12_2X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_UYVY12_1X24, { - .name = "UYVY12_1X24", - .code = MEDIA_BUS_FMT_UYVY12_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_VYUY12_1X24, { - .name = "VYUY12_1X24", - .code = MEDIA_BUS_FMT_VYUY12_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YUYV12_1X24, { - .name = "YUYV12_1X24", - .code = MEDIA_BUS_FMT_YUYV12_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_YVYU12_1X24, { - .name = "YVYU12_1X24", - .code = MEDIA_BUS_FMT_YVYU12_1X24, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 24, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_SBGGR8_1X8, { - .name = "SBGGR8_1X8", - .code = MEDIA_BUS_FMT_SBGGR8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG8_1X8, { - .name = "SGBRG8_1X8", - .code = MEDIA_BUS_FMT_SGBRG8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG8_1X8, { - .name = "SGRBG8_1X8", - .code = MEDIA_BUS_FMT_SGRBG8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB8_1X8, { - .name = "SRGGB8_1X8", - .code = MEDIA_BUS_FMT_SRGGB8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, { - .name = "SBGGR10_ALAW8_1X8", - .code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, { - .name = "SGBRG10_ALAW8_1X8", - .code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, { - .name = "SGRBG10_ALAW8_1X8", - .code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, { - .name = "SRGGB10_ALAW8_1X8", - .code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, { - .name = "SBGGR10_DPCM8_1X8", - .code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, { - .name = "SGBRG10_DPCM8_1X8", - .code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, { - .name = "SGRBG10_DPCM8_1X8", - .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, { - .name = "SRGGB10_DPCM8_1X8", - .code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, { - .name = "SBGGR10_2X8_PADHI_BE", - .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, { - .name = "SBGGR10_2X8_PADHI_LE", - .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, { - .name = "SBGGR10_2X8_PADLO_BE", - .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, { - .name = "SBGGR10_2X8_PADLO_LE", - .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR10_1X10, { - .name = "SBGGR10_1X10", - .code = MEDIA_BUS_FMT_SBGGR10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG10_1X10, { - .name = "SGBRG10_1X10", - .code = MEDIA_BUS_FMT_SGBRG10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG10_1X10, { - .name = "SGRBG10_1X10", - .code = MEDIA_BUS_FMT_SGRBG10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB10_1X10, { - .name = "SRGGB10_1X10", - .code = MEDIA_BUS_FMT_SRGGB10_1X10, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 10, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR12_1X12, { - .name = "SBGGR12_1X12", - .code = MEDIA_BUS_FMT_SBGGR12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG12_1X12, { - .name = "SGBRG12_1X12", - .code = MEDIA_BUS_FMT_SGBRG12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG12_1X12, { - .name = "SGRBG12_1X12", - .code = MEDIA_BUS_FMT_SGRBG12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB12_1X12, { - .name = "SRGGB12_1X12", - .code = MEDIA_BUS_FMT_SRGGB12_1X12, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 12, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR14_1X14, { - .name = "SBGGR14_1X14", - .code = MEDIA_BUS_FMT_SBGGR14_1X14, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 14, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGBRG14_1X14, { - .name = "SGBRG14_1X14", - .code = MEDIA_BUS_FMT_SGBRG14_1X14, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 14, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SGRBG14_1X14, { - .name = "SGRBG14_1X14", - .code = MEDIA_BUS_FMT_SGRBG14_1X14, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 14, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SRGGB14_1X14, { - .name = "SRGGB14_1X14", - .code = MEDIA_BUS_FMT_SRGGB14_1X14, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 14, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, - { MEDIA_BUS_FMT_SBGGR16_1X16, { - .name = "SBGGR16_1X16", - .code = MEDIA_BUS_FMT_SBGGR16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW - } }, - { MEDIA_BUS_FMT_SGBRG16_1X16, { - .name = "SGBRG16_1X16", - .code = MEDIA_BUS_FMT_SGBRG16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW - } }, - { MEDIA_BUS_FMT_SGRBG16_1X16, { - .name = "SGRBG16_1X16", - .code = MEDIA_BUS_FMT_SGRBG16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW - } }, - { MEDIA_BUS_FMT_SRGGB16_1X16, { - .name = "SRGGB16_1X16", - .code = MEDIA_BUS_FMT_SRGGB16_1X16, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 16, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW - } }, + { MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, + { + .name = "RGB444_2X8_PADHI_BE", + .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, + { + .name = "RGB444_2X8_PADHI_LE", + .code = MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, + { + .name = "RGB555_2X8_PADHI_BE", + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, + { + .name = "RGB555_2X8_PADHI_LE", + .code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB565_1X16, + { + .name = "RGB565_1X16", + .code = MEDIA_BUS_FMT_RGB565_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_BGR565_2X8_BE, + { + .name = "BGR565_2X8_BE", + .code = MEDIA_BUS_FMT_BGR565_2X8_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_BGR565_2X8_LE, + { + .name = "BGR565_2X8_LE", + .code = MEDIA_BUS_FMT_BGR565_2X8_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB565_2X8_BE, + { + .name = "RGB565_2X8_BE", + .code = MEDIA_BUS_FMT_RGB565_2X8_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB565_2X8_LE, + { + .name = "RGB565_2X8_LE", + .code = MEDIA_BUS_FMT_RGB565_2X8_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB666_1X18, + { + .name = "RGB666_1X18", + .code = MEDIA_BUS_FMT_RGB666_1X18, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 18, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_BGR888_1X24, + { + .name = "BGR888_1X24", + .code = MEDIA_BUS_FMT_BGR888_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB888_1X24, + { + .name = "RGB888_1X24", + .code = MEDIA_BUS_FMT_RGB888_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB888_2X12_BE, + { + .name = "RGB888_2X12_BE", + .code = MEDIA_BUS_FMT_RGB888_2X12_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_RGB888_2X12_LE, + { + .name = "RGB888_2X12_LE", + .code = MEDIA_BUS_FMT_RGB888_2X12_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_ARGB8888_1X32, + { + .name = "ARGB8888_1X32", + .code = MEDIA_BUS_FMT_ARGB8888_1X32, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_Y8_1X8, + { + .name = "Y8_1X8", + .code = MEDIA_BUS_FMT_Y8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UV8_1X8, + { + .name = "UV8_1X8", + .code = MEDIA_BUS_FMT_UV8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY8_1_5X8, + { + .name = "UYVY8_1_5X8", + .code = MEDIA_BUS_FMT_UYVY8_1_5X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY8_1_5X8, + { + .name = "VYUY8_1_5X8", + .code = MEDIA_BUS_FMT_VYUY8_1_5X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV8_1_5X8, + { + .name = "YUYV8_1_5X8", + .code = MEDIA_BUS_FMT_YUYV8_1_5X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU8_1_5X8, + { + .name = "YVYU8_1_5X8", + .code = MEDIA_BUS_FMT_YVYU8_1_5X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY8_2X8, + { + .name = "UYVY8_2X8", + .code = MEDIA_BUS_FMT_UYVY8_2X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY8_2X8, + { + .name = "VYUY8_2X8", + .code = MEDIA_BUS_FMT_VYUY8_2X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV8_2X8, + { + .name = "YUYV8_2X8", + .code = MEDIA_BUS_FMT_YUYV8_2X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU8_2X8, + { + .name = "YVYU8_2X8", + .code = MEDIA_BUS_FMT_YVYU8_2X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_Y10_1X10, + { + .name = "Y10_1X10", + .code = MEDIA_BUS_FMT_Y10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY10_2X10, + { + .name = "UYVY10_2X10", + .code = MEDIA_BUS_FMT_UYVY10_2X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY10_2X10, + { + .name = "VYUY10_2X10", + .code = MEDIA_BUS_FMT_VYUY10_2X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV10_2X10, + { + .name = "YUYV10_2X10", + .code = MEDIA_BUS_FMT_YUYV10_2X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU10_2X10, + { + .name = "YVYU10_2X10", + .code = MEDIA_BUS_FMT_YVYU10_2X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_Y12_1X12, + { + .name = "Y12_1X12", + .code = MEDIA_BUS_FMT_Y12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_Y16_1X16, + { + .name = "Y16_1X16", + .code = MEDIA_BUS_FMT_Y16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY8_1X16, + { + .name = "UYVY8_1X16", + .code = MEDIA_BUS_FMT_UYVY8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY8_1X16, + { + .name = "VYUY8_1X16", + .code = MEDIA_BUS_FMT_VYUY8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV8_1X16, + { + .name = "YUYV8_1X16", + .code = MEDIA_BUS_FMT_YUYV8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU8_1X16, + { + .name = "YVYU8_1X16", + .code = MEDIA_BUS_FMT_YVYU8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YDYUYDYV8_1X16, + { + .name = "YDYUYDYV8_1X16", + .code = MEDIA_BUS_FMT_YDYUYDYV8_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY10_1X20, + { + .name = "UYVY10_1X20", + .code = MEDIA_BUS_FMT_UYVY10_1X20, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY10_1X20, + { + .name = "VYUY10_1X20", + .code = MEDIA_BUS_FMT_VYUY10_1X20, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV10_1X20, + { + .name = "YUYV10_1X20", + .code = MEDIA_BUS_FMT_YUYV10_1X20, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU10_1X20, + { + .name = "YVYU10_1X20", + .code = MEDIA_BUS_FMT_YVYU10_1X20, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 20, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUV8_1X24, + { + .name = "YUV8_1X24", + .code = MEDIA_BUS_FMT_YUV8_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUV10_1X30, + { + .name = "YUV10_1X30", + .code = MEDIA_BUS_FMT_YUV10_1X30, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 30, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_AYUV8_1X32, + { + .name = "AYUV8_1X32", + .code = MEDIA_BUS_FMT_AYUV8_1X32, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY12_2X12, + { + .name = "UYVY12_2X12", + .code = MEDIA_BUS_FMT_UYVY12_2X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY12_2X12, + { + .name = "VYUY12_2X12", + .code = MEDIA_BUS_FMT_VYUY12_2X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV12_2X12, + { + .name = "YUYV12_2X12", + .code = MEDIA_BUS_FMT_YUYV12_2X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU12_2X12, + { + .name = "YVYU12_2X12", + .code = MEDIA_BUS_FMT_YVYU12_2X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_UYVY12_1X24, + { + .name = "UYVY12_1X24", + .code = MEDIA_BUS_FMT_UYVY12_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_VYUY12_1X24, + { + .name = "VYUY12_1X24", + .code = MEDIA_BUS_FMT_VYUY12_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YUYV12_1X24, + { + .name = "YUYV12_1X24", + .code = MEDIA_BUS_FMT_YUYV12_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_YVYU12_1X24, + { + .name = "YVYU12_1X24", + .code = MEDIA_BUS_FMT_YVYU12_1X24, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 24, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_SBGGR8_1X8, + { + .name = "SBGGR8_1X8", + .code = MEDIA_BUS_FMT_SBGGR8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG8_1X8, + { + .name = "SGBRG8_1X8", + .code = MEDIA_BUS_FMT_SGBRG8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG8_1X8, + { + .name = "SGRBG8_1X8", + .code = MEDIA_BUS_FMT_SGRBG8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB8_1X8, + { + .name = "SRGGB8_1X8", + .code = MEDIA_BUS_FMT_SRGGB8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, + { + .name = "SBGGR10_ALAW8_1X8", + .code = MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, + { + .name = "SGBRG10_ALAW8_1X8", + .code = MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, + { + .name = "SGRBG10_ALAW8_1X8", + .code = MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, + { + .name = "SRGGB10_ALAW8_1X8", + .code = MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, + { + .name = "SBGGR10_DPCM8_1X8", + .code = MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, + { + .name = "SGBRG10_DPCM8_1X8", + .code = MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, + { + .name = "SGRBG10_DPCM8_1X8", + .code = MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, + { + .name = "SRGGB10_DPCM8_1X8", + .code = MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, + { + .name = "SBGGR10_2X8_PADHI_BE", + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, + { + .name = "SBGGR10_2X8_PADHI_LE", + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, + { + .name = "SBGGR10_2X8_PADLO_BE", + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, + { + .name = "SBGGR10_2X8_PADLO_LE", + .code = MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR10_1X10, + { + .name = "SBGGR10_1X10", + .code = MEDIA_BUS_FMT_SBGGR10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG10_1X10, + { + .name = "SGBRG10_1X10", + .code = MEDIA_BUS_FMT_SGBRG10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG10_1X10, + { + .name = "SGRBG10_1X10", + .code = MEDIA_BUS_FMT_SGRBG10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB10_1X10, + { + .name = "SRGGB10_1X10", + .code = MEDIA_BUS_FMT_SRGGB10_1X10, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 10, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR12_1X12, + { + .name = "SBGGR12_1X12", + .code = MEDIA_BUS_FMT_SBGGR12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG12_1X12, + { + .name = "SGBRG12_1X12", + .code = MEDIA_BUS_FMT_SGBRG12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG12_1X12, + { + .name = "SGRBG12_1X12", + .code = MEDIA_BUS_FMT_SGRBG12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB12_1X12, + { + .name = "SRGGB12_1X12", + .code = MEDIA_BUS_FMT_SRGGB12_1X12, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 12, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR14_1X14, + { + .name = "SBGGR14_1X14", + .code = MEDIA_BUS_FMT_SBGGR14_1X14, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 14, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGBRG14_1X14, + { + .name = "SGBRG14_1X14", + .code = MEDIA_BUS_FMT_SGBRG14_1X14, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 14, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SGRBG14_1X14, + { + .name = "SGRBG14_1X14", + .code = MEDIA_BUS_FMT_SGRBG14_1X14, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 14, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SRGGB14_1X14, + { + .name = "SRGGB14_1X14", + .code = MEDIA_BUS_FMT_SRGGB14_1X14, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 14, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, + { MEDIA_BUS_FMT_SBGGR16_1X16, + { .name = "SBGGR16_1X16", + .code = MEDIA_BUS_FMT_SBGGR16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW } }, + { MEDIA_BUS_FMT_SGBRG16_1X16, + { .name = "SGBRG16_1X16", + .code = MEDIA_BUS_FMT_SGBRG16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW } }, + { MEDIA_BUS_FMT_SGRBG16_1X16, + { .name = "SGRBG16_1X16", + .code = MEDIA_BUS_FMT_SGRBG16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW } }, + { MEDIA_BUS_FMT_SRGGB16_1X16, + { .name = "SRGGB16_1X16", + .code = MEDIA_BUS_FMT_SRGGB16_1X16, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 16, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW } }, /* \todo Clarify colour encoding for HSV formats */ - { MEDIA_BUS_FMT_AHSV8888_1X32, { - .name = "AHSV8888_1X32", - .code = MEDIA_BUS_FMT_AHSV8888_1X32, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 32, - .colourEncoding = PixelFormatInfo::ColourEncodingRGB, - } }, - { MEDIA_BUS_FMT_JPEG_1X8, { - .name = "JPEG_1X8", - .code = MEDIA_BUS_FMT_JPEG_1X8, - .type = MediaBusFormatInfo::Type::Image, - .bitsPerPixel = 8, - .colourEncoding = PixelFormatInfo::ColourEncodingYUV, - } }, - { MEDIA_BUS_FMT_METADATA_FIXED, { - .name = "METADATA_FIXED", - .code = MEDIA_BUS_FMT_METADATA_FIXED, - .type = MediaBusFormatInfo::Type::Metadata, - .bitsPerPixel = 0, - .colourEncoding = PixelFormatInfo::ColourEncodingRAW, - } }, + { MEDIA_BUS_FMT_AHSV8888_1X32, + { + .name = "AHSV8888_1X32", + .code = MEDIA_BUS_FMT_AHSV8888_1X32, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + } }, + { MEDIA_BUS_FMT_JPEG_1X8, + { + .name = "JPEG_1X8", + .code = MEDIA_BUS_FMT_JPEG_1X8, + .type = MediaBusFormatInfo::Type::Image, + .bitsPerPixel = 8, + .colourEncoding = PixelFormatInfo::ColourEncodingYUV, + } }, + { MEDIA_BUS_FMT_METADATA_FIXED, + { + .name = "METADATA_FIXED", + .code = MEDIA_BUS_FMT_METADATA_FIXED, + .type = MediaBusFormatInfo::Type::Metadata, + .bitsPerPixel = 0, + .colourEncoding = PixelFormatInfo::ColourEncodingRAW, + } }, }; } /* namespace */ @@ -1037,7 +1116,8 @@ int V4L2Subdevice::open() /* If the subdev supports streams, enable the streams API. */ if (caps_.hasStreams()) { - struct v4l2_subdev_client_capability clientCaps{}; + struct v4l2_subdev_client_capability clientCaps { + }; clientCaps.capabilities = V4L2_SUBDEV_CLIENT_CAP_STREAMS; ret = ioctl(VIDIOC_SUBDEV_S_CLIENT_CAP, &clientCaps); @@ -1376,8 +1456,8 @@ struct v4l2_subdev_routing_legacy { __u32 reserved[6]; }; -#define VIDIOC_SUBDEV_G_ROUTING_LEGACY _IOWR('V', 38, struct v4l2_subdev_routing_legacy) -#define VIDIOC_SUBDEV_S_ROUTING_LEGACY _IOWR('V', 39, struct v4l2_subdev_routing_legacy) +#define VIDIOC_SUBDEV_G_ROUTING_LEGACY _IOWR('V', 38, struct v4l2_subdev_routing_legacy) +#define VIDIOC_SUBDEV_S_ROUTING_LEGACY _IOWR('V', 39, struct v4l2_subdev_routing_legacy) } /* namespace */ @@ -1665,7 +1745,7 @@ std::vector V4L2Subdevice::enumPadCodes(const Stream &stream) std::vector codes; int ret; - for (unsigned int index = 0; ; index++) { + for (unsigned int index = 0;; index++) { struct v4l2_subdev_mbus_code_enum mbusEnum = {}; mbusEnum.pad = stream.pad; mbusEnum.stream = stream.stream; From patchwork Fri Aug 30 15:27:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21115 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 912B5C323E for ; Fri, 30 Aug 2024 15:28:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F4045634EE; Fri, 30 Aug 2024 17:28:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="So+U20gJ"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 593A4634E4 for ; Fri, 30 Aug 2024 17:27:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031672; 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: in-reply-to:in-reply-to:references:references; bh=tKYbVOMzgoXLoswz943UkELrb0Mj9eFvRPf5DEuzq6M=; b=So+U20gJy1alEJ1wCbrYRH/6jFkBZILTRTbCIfcZa/VqIbKW7YNjj2nM/SNVX655mF4Z/B 86TiOynwrCFL4ltzumYNB2lcn9ymzkVbdHs/tFaWS3IYl3y2y1Iq0pRUS23qO1IS9gh4Ik JZG7jt1J85fQFDJq6KZL9Vzbs6byP10= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-461-ciQ7NXZHP56vMEGxeX14JA-1; Fri, 30 Aug 2024 11:27:50 -0400 X-MC-Unique: ciQ7NXZHP56vMEGxeX14JA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1EDBB1955D48 for ; Fri, 30 Aug 2024 15:27:50 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D0B571956048; Fri, 30 Aug 2024 15:27:48 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 13/20] libcamera: v4l2: Fix indirect include Date: Fri, 30 Aug 2024 17:27:10 +0200 Message-ID: <20240830152721.1420313-14-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Use the direct include of V4L2PixelFormat. Signed-off-by: Milan Zamazal Reviewed-by: Laurent Pinchart --- src/v4l2/v4l2_camera_proxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 56c557b5..2267b6ee 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -24,7 +24,7 @@ #include #include -#include "libcamera/internal/formats.h" +#include "libcamera/internal/v4l2_pixelformat.h" #include "v4l2_camera.h" #include "v4l2_camera_file.h" From patchwork Fri Aug 30 15:27:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21118 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 B024EC32DB for ; Fri, 30 Aug 2024 15:28:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ACB7E634DD; Fri, 30 Aug 2024 17:28:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="OzghV1Fv"; dkim-atps=neutral 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 4D1FB634DE for ; Fri, 30 Aug 2024 17:27:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031675; 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: in-reply-to:in-reply-to:references:references; bh=9ZlhuE8PmiAFPObVApeQHDKiur3xFxME9LuNnA5ZZXA=; b=OzghV1FvHU3zn4lF0GEVnYnA2Z5bz6yUMPuDnpIBQlwwuHVwrDGJaxJ93t5p2n+yAQq1vc aH2MHVd/oNalNtmty3XD3lq9wevCOUUdRmdqLrpALzUtW4rkzeesHyutV4p+MKK1cddxP3 gUQ8wLdVjMS+1sSu8XOhaO0X+NAsQr0= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-zdNYTjBTOZepODWZ03Du1g-1; Fri, 30 Aug 2024 11:27:53 -0400 X-MC-Unique: zdNYTjBTOZepODWZ03Du1g-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B7CAE1955D47 for ; Fri, 30 Aug 2024 15:27:51 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 784FB1956048; Fri, 30 Aug 2024 15:27:50 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 14/20] libcamera: ipa: Remove unused includes Date: Fri, 30 Aug 2024 17:27:11 +0200 Message-ID: <20240830152721.1420313-15-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The includes that are not used can be removed. Signed-off-by: Milan Zamazal --- include/libcamera/ipa/ipa_interface.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h index 7c835e98..2fdc085e 100644 --- a/include/libcamera/ipa/ipa_interface.h +++ b/include/libcamera/ipa/ipa_interface.h @@ -7,11 +7,6 @@ #pragma once -#include -#include -#include -#include - #include #include From patchwork Fri Aug 30 15:27:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21117 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 35EDDC32DA for ; Fri, 30 Aug 2024 15:28:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9A20D634E0; Fri, 30 Aug 2024 17:28:10 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="OZltvbu8"; dkim-atps=neutral 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 AF340634E7 for ; Fri, 30 Aug 2024 17:27:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031675; 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: in-reply-to:in-reply-to:references:references; bh=t0XXIy6FoNHTn2xpxmNvFCoW2WkxlaT9Uzbi7AfrBMM=; b=OZltvbu8dCE6A9ag1IJsS9/3qU6Edx86Hoysr8PNXyJWonatrY/UymeT1OOr4IT1Z8wPiV GY56Czms1SmHbvJmcu9sLGiRkqqTx28+DDI3anlVBQCoaWx0D7XnX8x5jZqJ0gMvhSHNJU bpRbo35iJXNNxsEF/fM1Qtwb9IEjZfg= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-330-hoRfMvdUNHGmTCRtcuVGnA-1; Fri, 30 Aug 2024 11:27:54 -0400 X-MC-Unique: hoRfMvdUNHGmTCRtcuVGnA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 761041955D4C for ; Fri, 30 Aug 2024 15:27:53 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5316A1955F40; Fri, 30 Aug 2024 15:27:52 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 15/20] libcamera: libcamera: Remove unused includes Date: Fri, 30 Aug 2024 17:27:12 +0200 Message-ID: <20240830152721.1420313-16-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The includes that are not used can be removed. Signed-off-by: Milan Zamazal --- src/libcamera/base/event_dispatcher_poll.cpp | 1 - src/libcamera/camera.cpp | 2 -- src/libcamera/controls.cpp | 1 - src/libcamera/converter/converter_v4l2_m2m.cpp | 1 - src/libcamera/formats.cpp | 3 --- src/libcamera/ipa_module.cpp | 1 - src/libcamera/ipa_proxy.cpp | 1 - src/libcamera/orientation.cpp | 1 - src/libcamera/pipeline_handler.cpp | 1 - src/libcamera/process.cpp | 1 - src/libcamera/sensor/camera_sensor.cpp | 2 -- src/libcamera/shared_mem_object.cpp | 1 - src/libcamera/stream.cpp | 2 -- 13 files changed, 18 deletions(-) diff --git a/src/libcamera/base/event_dispatcher_poll.cpp b/src/libcamera/base/event_dispatcher_poll.cpp index b737ca7a..86a26f36 100644 --- a/src/libcamera/base/event_dispatcher_poll.cpp +++ b/src/libcamera/base/event_dispatcher_poll.cpp @@ -7,7 +7,6 @@ #include -#include #include #include #include diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 382a68f7..88210ff3 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -9,7 +9,6 @@ #include #include -#include #include #include @@ -21,7 +20,6 @@ #include "libcamera/internal/camera.h" #include "libcamera/internal/camera_controls.h" -#include "libcamera/internal/formats.h" #include "libcamera/internal/pipeline_handler.h" #include "libcamera/internal/request.h" diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 11d35321..67400797 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -7,7 +7,6 @@ #include -#include #include #include #include diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp index 006ba9f7..e4f656da 100644 --- a/src/libcamera/converter/converter_v4l2_m2m.cpp +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp @@ -8,7 +8,6 @@ #include "libcamera/internal/converter/converter_v4l2_m2m.h" -#include #include #include diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index 1d1d9a30..3ee89590 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -7,9 +7,6 @@ #include "libcamera/internal/formats.h" -#include -#include - #include #include diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp index 0756b691..86d88a86 100644 --- a/src/libcamera/ipa_module.cpp +++ b/src/libcamera/ipa_module.cpp @@ -8,7 +8,6 @@ #include "libcamera/internal/ipa_module.h" #include -#include #include #include #include diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp index 69975d8f..85004737 100644 --- a/src/libcamera/ipa_proxy.cpp +++ b/src/libcamera/ipa_proxy.cpp @@ -7,7 +7,6 @@ #include "libcamera/internal/ipa_proxy.h" -#include #include #include #include diff --git a/src/libcamera/orientation.cpp b/src/libcamera/orientation.cpp index fd191197..bf960249 100644 --- a/src/libcamera/orientation.cpp +++ b/src/libcamera/orientation.cpp @@ -8,7 +8,6 @@ #include #include -#include /** * \file orientation.h diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index 1fc22d6a..a63d3503 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -22,7 +22,6 @@ #include "libcamera/internal/camera.h" #include "libcamera/internal/camera_manager.h" #include "libcamera/internal/device_enumerator.h" -#include "libcamera/internal/framebuffer.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/request.h" #include "libcamera/internal/tracepoints.h" diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp index 86d27b2d..c0f4d49f 100644 --- a/src/libcamera/process.cpp +++ b/src/libcamera/process.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp index c6d7f801..1382081a 100644 --- a/src/libcamera/sensor/camera_sensor.cpp +++ b/src/libcamera/sensor/camera_sensor.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include @@ -24,7 +23,6 @@ #include "libcamera/internal/bayer_format.h" #include "libcamera/internal/camera_lens.h" #include "libcamera/internal/camera_sensor_properties.h" -#include "libcamera/internal/formats.h" #include "libcamera/internal/sysfs.h" /** diff --git a/src/libcamera/shared_mem_object.cpp b/src/libcamera/shared_mem_object.cpp index d4c7991a..65b53919 100644 --- a/src/libcamera/shared_mem_object.cpp +++ b/src/libcamera/shared_mem_object.cpp @@ -10,7 +10,6 @@ #include "libcamera/internal/shared_mem_object.h" -#include #include #include #include diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index 053cc4b8..e70688f6 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -9,9 +9,7 @@ #include #include -#include #include -#include #include From patchwork Fri Aug 30 15:27:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21119 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 5A354C324C for ; Fri, 30 Aug 2024 15:28:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 628B4634E5; Fri, 30 Aug 2024 17:28:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Rpoe6U7K"; dkim-atps=neutral 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 A427B634EA for ; Fri, 30 Aug 2024 17:27:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031677; 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: in-reply-to:in-reply-to:references:references; bh=9Oyw/8rBfaNs5zaslka68TMbcDpibwYzEJO5qbfyD9k=; b=Rpoe6U7KKTVsQLa76mxMP4jbRdg94qQAs4+DUbycKfIv59/+xXDdhEhx2QPrQmx/nO1oIs VMz1bDTjSS6zo61hroOguNFSTxLS/29vQ0KgFNSvSW8F/kmJi0FyHmvP4oCqgmDx1Bt0Ql kpT9wfnNGNGYTTu4q2zvJMxEUhxdpBM= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-32-36IlrRrwP4Kww2P4iRcKwQ-1; Fri, 30 Aug 2024 11:27:56 -0400 X-MC-Unique: 36IlrRrwP4Kww2P4iRcKwQ-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 899D81955D4D for ; Fri, 30 Aug 2024 15:27:55 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 12C371956048; Fri, 30 Aug 2024 15:27:53 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 16/20] libcamera: libcamera: Add missing includes Date: Fri, 30 Aug 2024 17:27:13 +0200 Message-ID: <20240830152721.1420313-17-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Let's add direct includes for classes currently included indirectly, through other header files. Signed-off-by: Milan Zamazal Reviewed-by: Laurent Pinchart --- src/libcamera/formats.cpp | 2 ++ src/libcamera/ipa_data_serializer.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index 3ee89590..dbefb094 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -7,6 +7,8 @@ #include "libcamera/internal/formats.h" +#include + #include #include diff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp index 3e9bef08..f6dd7e6f 100644 --- a/src/libcamera/ipa_data_serializer.cpp +++ b/src/libcamera/ipa_data_serializer.cpp @@ -11,6 +11,8 @@ #include +#include "libcamera/internal/byte_stream_buffer.h" + /** * \file ipa_data_serializer.h * \brief IPA Data Serializer From patchwork Fri Aug 30 15:27:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21120 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 68EF7C32DC for ; Fri, 30 Aug 2024 15:28:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 86AF8634F2; Fri, 30 Aug 2024 17:28:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Sy26thIo"; dkim-atps=neutral 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 341C6634DD for ; Fri, 30 Aug 2024 17:28:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031679; 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: in-reply-to:in-reply-to:references:references; bh=23M2hfhy+zNZHg/JuWmM6lqOiuQNPh2eIHg+QDYwtBA=; b=Sy26thIoXjSpQhJidzVA55z6Drf7l8221x0nzzVQuwsfCzbjf/KIUD5V+PITf9cq2Y3IGV vg8wkXzGzj7q1V+ul2e/3xDqOgZ1cTU+Yu//m1EVzbH/3SfeSfV3kOmSYVaTjMj2zK0Viw uoHkevUcvwAzr/2ExRzNbnVlcFGTqn0= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-148-VGTRjR0TPPmuB6Ksb1XZ2g-1; Fri, 30 Aug 2024 11:27:57 -0400 X-MC-Unique: VGTRjR0TPPmuB6Ksb1XZ2g-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2AD691955D4E for ; Fri, 30 Aug 2024 15:27:57 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E12111956048; Fri, 30 Aug 2024 15:27:55 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 17/20] libcamera: libcamera: Formatting improvements Date: Fri, 30 Aug 2024 17:27:14 +0200 Message-ID: <20240830152721.1420313-18-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. Signed-off-by: Milan Zamazal --- src/libcamera/base/event_dispatcher_poll.cpp | 3 +- src/libcamera/camera.cpp | 4 +- src/libcamera/controls.cpp | 31 +++---- src/libcamera/ipa_data_serializer.cpp | 95 ++++++++++---------- src/libcamera/ipa_module.cpp | 15 ++-- src/libcamera/orientation.cpp | 16 ++-- src/libcamera/pipeline_handler.cpp | 5 +- src/libcamera/process.cpp | 7 +- src/libcamera/sensor/camera_sensor.cpp | 6 +- src/libcamera/shared_mem_object.cpp | 4 +- src/libcamera/stream.cpp | 6 +- 11 files changed, 97 insertions(+), 95 deletions(-) diff --git a/src/libcamera/base/event_dispatcher_poll.cpp b/src/libcamera/base/event_dispatcher_poll.cpp index 86a26f36..288246ff 100644 --- a/src/libcamera/base/event_dispatcher_poll.cpp +++ b/src/libcamera/base/event_dispatcher_poll.cpp @@ -5,8 +5,6 @@ * Poll-based event dispatcher */ -#include - #include #include #include @@ -15,6 +13,7 @@ #include #include +#include #include #include #include diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 88210ff3..69e54439 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -5,7 +5,7 @@ * Camera device */ -#include +#include "libcamera/internal/camera.h" #include #include @@ -13,12 +13,12 @@ #include #include +#include #include #include #include #include -#include "libcamera/internal/camera.h" #include "libcamera/internal/camera_controls.h" #include "libcamera/internal/pipeline_handler.h" #include "libcamera/internal/request.h" diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 67400797..603e2672 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -5,15 +5,15 @@ * Control handling */ -#include - #include -#include #include +#include #include #include +#include + #include "libcamera/internal/control_validator.h" /** @@ -51,15 +51,15 @@ LOG_DEFINE_CATEGORY(Controls) namespace { static constexpr size_t ControlValueSize[] = { - [ControlTypeNone] = 0, - [ControlTypeBool] = sizeof(bool), - [ControlTypeByte] = sizeof(uint8_t), - [ControlTypeInteger32] = sizeof(int32_t), - [ControlTypeInteger64] = sizeof(int64_t), - [ControlTypeFloat] = sizeof(float), - [ControlTypeString] = sizeof(char), - [ControlTypeRectangle] = sizeof(Rectangle), - [ControlTypeSize] = sizeof(Size), + [ControlTypeNone] = 0, + [ControlTypeBool] = sizeof(bool), + [ControlTypeByte] = sizeof(uint8_t), + [ControlTypeInteger32] = sizeof(int32_t), + [ControlTypeInteger64] = sizeof(int64_t), + [ControlTypeFloat] = sizeof(float), + [ControlTypeString] = sizeof(char), + [ControlTypeRectangle] = sizeof(Rectangle), + [ControlTypeSize] = sizeof(Size), }; } /* namespace */ @@ -186,8 +186,8 @@ Span ControlValue::data() const { std::size_t size = numElements_ * ControlValueSize[type_]; const uint8_t *data = size > sizeof(value_) - ? reinterpret_cast(storage_) - : reinterpret_cast(&value_); + ? reinterpret_cast(storage_) + : reinterpret_cast(&value_); return { data, size }; } @@ -700,7 +700,8 @@ bool ControlInfoMap::validate() * values. */ ControlType rangeType = id->type() == ControlTypeString - ? ControlTypeInteger32 : id->type(); + ? ControlTypeInteger32 + : id->type(); const ControlInfo &info = ctrl.second; if (info.min().type() != rangeType) { diff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp index f6dd7e6f..67a5726a 100644 --- a/src/libcamera/ipa_data_serializer.cpp +++ b/src/libcamera/ipa_data_serializer.cpp @@ -188,52 +188,52 @@ namespace { #ifndef __DOXYGEN__ -#define DEFINE_POD_SERIALIZER(type) \ - \ -template<> \ -std::tuple, std::vector> \ -IPADataSerializer::serialize(const type &data, \ - [[maybe_unused]] ControlSerializer *cs) \ -{ \ - std::vector dataVec; \ - dataVec.reserve(sizeof(type)); \ - appendPOD(dataVec, data); \ - \ - return { dataVec, {} }; \ -} \ - \ -template<> \ -type IPADataSerializer::deserialize(std::vector::const_iterator dataBegin, \ - std::vector::const_iterator dataEnd, \ - [[maybe_unused]] ControlSerializer *cs) \ -{ \ - return readPOD(dataBegin, 0, dataEnd); \ -} \ - \ -template<> \ -type IPADataSerializer::deserialize(const std::vector &data, \ - ControlSerializer *cs) \ -{ \ - return deserialize(data.cbegin(), data.end(), cs); \ -} \ - \ -template<> \ -type IPADataSerializer::deserialize(const std::vector &data, \ - [[maybe_unused]] const std::vector &fds, \ - ControlSerializer *cs) \ -{ \ - return deserialize(data.cbegin(), data.end(), cs); \ -} \ - \ -template<> \ -type IPADataSerializer::deserialize(std::vector::const_iterator dataBegin, \ - std::vector::const_iterator dataEnd, \ - [[maybe_unused]] std::vector::const_iterator fdsBegin, \ - [[maybe_unused]] std::vector::const_iterator fdsEnd, \ - ControlSerializer *cs) \ -{ \ - return deserialize(dataBegin, dataEnd, cs); \ -} +#define DEFINE_POD_SERIALIZER(type) \ + \ + template<> \ + std::tuple, std::vector> \ + IPADataSerializer::serialize(const type &data, \ + [[maybe_unused]] ControlSerializer *cs) \ + { \ + std::vector dataVec; \ + dataVec.reserve(sizeof(type)); \ + appendPOD(dataVec, data); \ + \ + return { dataVec, {} }; \ + } \ + \ + template<> \ + type IPADataSerializer::deserialize(std::vector::const_iterator dataBegin, \ + std::vector::const_iterator dataEnd, \ + [[maybe_unused]] ControlSerializer *cs) \ + { \ + return readPOD(dataBegin, 0, dataEnd); \ + } \ + \ + template<> \ + type IPADataSerializer::deserialize(const std::vector &data, \ + ControlSerializer *cs) \ + { \ + return deserialize(data.cbegin(), data.end(), cs); \ + } \ + \ + template<> \ + type IPADataSerializer::deserialize(const std::vector &data, \ + [[maybe_unused]] const std::vector &fds, \ + ControlSerializer *cs) \ + { \ + return deserialize(data.cbegin(), data.end(), cs); \ + } \ + \ + template<> \ + type IPADataSerializer::deserialize(std::vector::const_iterator dataBegin, \ + std::vector::const_iterator dataEnd, \ + [[maybe_unused]] std::vector::const_iterator fdsBegin, \ + [[maybe_unused]] std::vector::const_iterator fdsEnd, \ + ControlSerializer *cs) \ + { \ + return deserialize(dataBegin, dataEnd, cs); \ + } DEFINE_POD_SERIALIZER(bool) DEFINE_POD_SERIALIZER(uint8_t) @@ -539,7 +539,6 @@ IPADataSerializer::serialize(const SharedFD &data, if (data.isValid()) fdVec.push_back(data); - return { dataVec, fdVec }; } @@ -606,7 +605,7 @@ IPADataSerializer::deserialize(std::vector::const_i FrameBuffer::Plane ret; ret.fd = IPADataSerializer::deserialize(dataBegin, dataBegin + 4, - fdsBegin, fdsBegin + 1); + fdsBegin, fdsBegin + 1); ret.offset = readPOD(dataBegin, 4, dataEnd); ret.length = readPOD(dataBegin, 8, dataEnd); diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp index 86d88a86..b8b2eb6c 100644 --- a/src/libcamera/ipa_module.cpp +++ b/src/libcamera/ipa_module.cpp @@ -50,8 +50,8 @@ typename std::remove_extent_t *elfPointer(Span elf, if (size > elf.size() || size < objSize) return nullptr; - return reinterpret_cast *> - (reinterpret_cast(elf.data()) + offset); + return reinterpret_cast *>( + reinterpret_cast(elf.data()) + offset); } template @@ -80,21 +80,22 @@ int elfVerifyIdent(Span elf) int a = 1; unsigned char endianness = *reinterpret_cast(&a) == 1 - ? ELFDATA2LSB : ELFDATA2MSB; + ? ELFDATA2LSB + : ELFDATA2MSB; if (e_ident[EI_DATA] != endianness) return -ENOEXEC; return 0; } -const ElfW(Shdr) *elfSection(Span elf, const ElfW(Ehdr) *eHdr, - ElfW(Half) idx) +const ElfW(Shdr) * elfSection(Span elf, const ElfW(Ehdr) * eHdr, + ElfW(Half) idx) { if (idx >= eHdr->e_shnum) return nullptr; - off_t offset = eHdr->e_shoff + idx * - static_cast(eHdr->e_shentsize); + off_t offset = + eHdr->e_shoff + idx * static_cast(eHdr->e_shentsize); return elfPointer(elf, offset); } diff --git a/src/libcamera/orientation.cpp b/src/libcamera/orientation.cpp index bf960249..80dea459 100644 --- a/src/libcamera/orientation.cpp +++ b/src/libcamera/orientation.cpp @@ -5,10 +5,10 @@ * Image orientation */ -#include - #include +#include + /** * \file orientation.h * \brief Image orientation definition @@ -101,10 +101,14 @@ std::ostream &operator<<(std::ostream &out, const Orientation &orientation) { constexpr std::array orientationNames = { "", /* Orientation starts counting from 1. */ - "Rotate0", "Rotate0Mirror", - "Rotate180", "Rotate180Mirror", - "Rotate90Mirror", "Rotate270", - "Rotate270Mirror", "Rotate90", + "Rotate0", + "Rotate0Mirror", + "Rotate180", + "Rotate180Mirror", + "Rotate90Mirror", + "Rotate270", + "Rotate270Mirror", + "Rotate90", }; out << orientationNames[static_cast(orientation)]; diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index a63d3503..981c2e64 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -577,8 +577,9 @@ std::string PipelineHandler::configurationFile(const std::string &subdir, << confPath << "'"; } else { /* Else look in the system locations. */ - confPath = std::string(LIBCAMERA_DATA_DIR) - + "/pipeline/" + subdir + '/' + name; + confPath = + std::string(LIBCAMERA_DATA_DIR) + + "/pipeline/" + subdir + '/' + name; } ret = stat(confPath.c_str(), &statbuf); diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp index c0f4d49f..68fad327 100644 --- a/src/libcamera/process.cpp +++ b/src/libcamera/process.cpp @@ -75,7 +75,7 @@ void ProcessManager::sighandler() return; } - for (auto it = processes_.begin(); it != processes_.end(); ) { + for (auto it = processes_.begin(); it != processes_.end();) { Process *process = *it; int wstatus; @@ -188,7 +188,6 @@ const struct sigaction &ProcessManager::oldsa() const return oldsa_; } - /** * \class Process * \brief Process object @@ -270,8 +269,8 @@ int Process::start(const std::string &path, unsigned int len = args.size(); argv[0] = path.c_str(); for (unsigned int i = 0; i < len; i++) - argv[i+1] = args[i].c_str(); - argv[len+1] = nullptr; + argv[i + 1] = args[i].c_str(); + argv[len + 1] = nullptr; execv(path.c_str(), (char **)argv); diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp index 1382081a..4a990bb9 100644 --- a/src/libcamera/sensor/camera_sensor.cpp +++ b/src/libcamera/sensor/camera_sensor.cpp @@ -6,7 +6,6 @@ */ #include "libcamera/internal/camera_sensor.h" -#include "libcamera/internal/media_device.h" #include #include @@ -14,15 +13,16 @@ #include #include +#include + #include #include #include -#include - #include "libcamera/internal/bayer_format.h" #include "libcamera/internal/camera_lens.h" #include "libcamera/internal/camera_sensor_properties.h" +#include "libcamera/internal/media_device.h" #include "libcamera/internal/sysfs.h" /** diff --git a/src/libcamera/shared_mem_object.cpp b/src/libcamera/shared_mem_object.cpp index 65b53919..d9b61d37 100644 --- a/src/libcamera/shared_mem_object.cpp +++ b/src/libcamera/shared_mem_object.cpp @@ -57,8 +57,8 @@ SharedMem::SharedMem() = default; */ SharedMem::SharedMem(const std::string &name, std::size_t size) { - UniqueFD memfd = MemFd::create(name.c_str(), size, MemFd::Seal::Shrink | - MemFd::Seal::Grow); + UniqueFD memfd = MemFd::create(name.c_str(), size, + MemFd::Seal::Shrink | MemFd::Seal::Grow); if (!memfd.isValid()) return; diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index e70688f6..00b15608 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -5,17 +5,15 @@ * Video stream for a Camera */ -#include - #include #include #include -#include - #include #include +#include +#include /** * \file stream.h From patchwork Fri Aug 30 15:27:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21121 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 2F9B1C32D5 for ; Fri, 30 Aug 2024 15:28:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DFF9C634E0; Fri, 30 Aug 2024 17:28:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="YamCo4ne"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 17276634E2 for ; Fri, 30 Aug 2024 17:28:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031681; 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: in-reply-to:in-reply-to:references:references; bh=HPfavc/N+GppTSRCZi4fNlfHnYvMC1wzv9skJRWFk7I=; b=YamCo4news/tIpcEUr6bSVGnKRO6CD8dIYIGUIwYlHQur5Y4MLPCgsKy7d/PcXWwHHS9NL FS4rnchDBEMtlGJ1REgfS51Zak8jLpd8mah1BfHJNuJ3g2RkftMgbxi6KQgZxsGkbFr7y3 RbqE3GkF27A1KQ6/l3V57qPIfmE/uxY= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-613-1TkKBJ3TOleqeonf9KkIZA-1; Fri, 30 Aug 2024 11:27:59 -0400 X-MC-Unique: 1TkKBJ3TOleqeonf9KkIZA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3B02819560B0 for ; Fri, 30 Aug 2024 15:27:59 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A86DF1955F44; Fri, 30 Aug 2024 15:27:57 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 18/20] libcamera: includes: Add missing includes Date: Fri, 30 Aug 2024 17:27:15 +0200 Message-ID: <20240830152721.1420313-19-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Let's add direct includes for classes currently included indirectly, through other header files. Signed-off-by: Milan Zamazal Reviewed-by: Laurent Pinchart --- include/libcamera/internal/request.h | 1 + include/libcamera/logging.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h index f5d98069..4e7d05b1 100644 --- a/include/libcamera/internal/request.h +++ b/include/libcamera/internal/request.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include diff --git a/include/libcamera/logging.h b/include/libcamera/logging.h index e334d87b..e1c6341c 100644 --- a/include/libcamera/logging.h +++ b/include/libcamera/logging.h @@ -7,6 +7,8 @@ #pragma once +#include + namespace libcamera { enum LoggingTarget { From patchwork Fri Aug 30 15:27:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21123 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 202F0C32DE for ; Fri, 30 Aug 2024 15:28:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 878D4634EA; Fri, 30 Aug 2024 17:28:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="PWY0tsYX"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5ABC6634EC for ; Fri, 30 Aug 2024 17:28:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031683; 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: in-reply-to:in-reply-to:references:references; bh=vSXfMI5XMHAkJFEnEPXS0s5Hnd66WG1oxMV7zMAbFwc=; b=PWY0tsYXCOv2krFvieU306IHeervztLBFy2WXC9zvVWXE7WVT2gSLLSogiV8sIjOOBGqXj GirLWYAucF9nPoqZYF3KLgS4KZK/qndw3us4CUHnMuvJmFc/Vpe0c9UsHmsnMUpuC+HONo +iBEM1akZ2x4uhmkk+cw8TIaRqxaeaA= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-651-KUiRFNQXOcOFId9cwsCsCg-1; Fri, 30 Aug 2024 11:28:01 -0400 X-MC-Unique: KUiRFNQXOcOFId9cwsCsCg-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 05AC71955D4C for ; Fri, 30 Aug 2024 15:28:01 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AD1C61956048; Fri, 30 Aug 2024 15:27:59 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 19/20] libcamera: includes: Remove unused includes Date: Fri, 30 Aug 2024 17:27:16 +0200 Message-ID: <20240830152721.1420313-20-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The includes that are not used can be removed. Signed-off-by: Milan Zamazal --- include/libcamera/base/event_dispatcher.h | 2 -- include/libcamera/base/log.h | 1 - include/libcamera/base/memfd.h | 2 -- include/libcamera/base/signal.h | 1 - include/libcamera/base/span.h | 1 - include/libcamera/base/timer.h | 1 - include/libcamera/base/utils.h | 1 - include/libcamera/framebuffer.h | 1 - include/libcamera/internal/camera_manager.h | 1 - include/libcamera/internal/camera_sensor.h | 1 - include/libcamera/internal/device_enumerator_sysfs.h | 1 - include/libcamera/internal/dma_buf_allocator.h | 2 -- include/libcamera/internal/formats.h | 1 - include/libcamera/internal/ipa_data_serializer.h | 4 ---- include/libcamera/internal/ipa_proxy.h | 2 -- include/libcamera/internal/ipc_pipe_unixsocket.h | 1 - include/libcamera/internal/media_device.h | 1 - include/libcamera/internal/pipeline_handler.h | 3 --- include/libcamera/internal/shared_mem_object.h | 1 - include/libcamera/pixel_format.h | 1 - include/libcamera/request.h | 1 - include/libcamera/stream.h | 1 - include/libcamera/transform.h | 2 -- 23 files changed, 33 deletions(-) diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h index e9a09c6e..408f8da6 100644 --- a/include/libcamera/base/event_dispatcher.h +++ b/include/libcamera/base/event_dispatcher.h @@ -7,8 +7,6 @@ #pragma once -#include - #include namespace libcamera { diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h index df27df03..62093012 100644 --- a/include/libcamera/base/log.h +++ b/include/libcamera/base/log.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include diff --git a/include/libcamera/base/memfd.h b/include/libcamera/base/memfd.h index b0edd2de..705d9929 100644 --- a/include/libcamera/base/memfd.h +++ b/include/libcamera/base/memfd.h @@ -7,8 +7,6 @@ #pragma once -#include - #include #include diff --git a/include/libcamera/base/signal.h b/include/libcamera/base/signal.h index 849fbbda..bbff1495 100644 --- a/include/libcamera/base/signal.h +++ b/include/libcamera/base/signal.h @@ -10,7 +10,6 @@ #include #include #include -#include #include diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h index c3e63f69..92cce4f0 100644 --- a/include/libcamera/base/span.h +++ b/include/libcamera/base/span.h @@ -10,7 +10,6 @@ #include #include #include -#include #include namespace libcamera { diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h index 5ef45959..9646a0fe 100644 --- a/include/libcamera/base/timer.h +++ b/include/libcamera/base/timer.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index 734ff81e..98c683a7 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h index 5ae2270b..ff839243 100644 --- a/include/libcamera/framebuffer.h +++ b/include/libcamera/framebuffer.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include #include diff --git a/include/libcamera/internal/camera_manager.h b/include/libcamera/internal/camera_manager.h index e098cb69..0150ca61 100644 --- a/include/libcamera/internal/camera_manager.h +++ b/include/libcamera/internal/camera_manager.h @@ -9,7 +9,6 @@ #include -#include #include #include #include diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index fc44ab98..a42c15fa 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -23,7 +23,6 @@ #include #include "libcamera/internal/bayer_format.h" -#include "libcamera/internal/formats.h" #include "libcamera/internal/v4l2_subdevice.h" namespace libcamera { diff --git a/include/libcamera/internal/device_enumerator_sysfs.h b/include/libcamera/internal/device_enumerator_sysfs.h index a5bfc711..4ccc9845 100644 --- a/include/libcamera/internal/device_enumerator_sysfs.h +++ b/include/libcamera/internal/device_enumerator_sysfs.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include "libcamera/internal/device_enumerator.h" diff --git a/include/libcamera/internal/dma_buf_allocator.h b/include/libcamera/internal/dma_buf_allocator.h index 36ec1696..d2a0a0d1 100644 --- a/include/libcamera/internal/dma_buf_allocator.h +++ b/include/libcamera/internal/dma_buf_allocator.h @@ -7,8 +7,6 @@ #pragma once -#include - #include #include diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h index 71895cd8..6a3e9c16 100644 --- a/include/libcamera/internal/formats.h +++ b/include/libcamera/internal/formats.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h index 337c948c..13470a89 100644 --- a/include/libcamera/internal/ipa_data_serializer.h +++ b/include/libcamera/internal/ipa_data_serializer.h @@ -7,8 +7,6 @@ #pragma once -#include -#include #include #include #include @@ -22,8 +20,6 @@ #include #include -#include "libcamera/internal/byte_stream_buffer.h" -#include "libcamera/internal/camera_sensor.h" #include "libcamera/internal/control_serializer.h" namespace libcamera { diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h index 0f564d99..983bcc5f 100644 --- a/include/libcamera/internal/ipa_proxy.h +++ b/include/libcamera/internal/ipa_proxy.h @@ -7,9 +7,7 @@ #pragma once -#include #include -#include #include diff --git a/include/libcamera/internal/ipc_pipe_unixsocket.h b/include/libcamera/internal/ipc_pipe_unixsocket.h index 4a0f6d57..8c972613 100644 --- a/include/libcamera/internal/ipc_pipe_unixsocket.h +++ b/include/libcamera/internal/ipc_pipe_unixsocket.h @@ -9,7 +9,6 @@ #include #include -#include #include "libcamera/internal/ipc_pipe.h" #include "libcamera/internal/ipc_unixsocket.h" diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h index bf2e475d..e412d3a0 100644 --- a/include/libcamera/internal/media_device.h +++ b/include/libcamera/internal/media_device.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index cad5812f..c37e6d02 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -20,8 +19,6 @@ #include #include -#include "libcamera/internal/ipa_proxy.h" - namespace libcamera { class Camera; diff --git a/include/libcamera/internal/shared_mem_object.h b/include/libcamera/internal/shared_mem_object.h index 2ab0189f..e9f1dacd 100644 --- a/include/libcamera/internal/shared_mem_object.h +++ b/include/libcamera/internal/shared_mem_object.h @@ -8,7 +8,6 @@ */ #pragma once -#include #include #include #include diff --git a/include/libcamera/pixel_format.h b/include/libcamera/pixel_format.h index ea60fe72..1b4d8c7c 100644 --- a/include/libcamera/pixel_format.h +++ b/include/libcamera/pixel_format.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 2c78d9bb..e214a9d1 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index d510238a..071b7169 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -8,7 +8,6 @@ #pragma once #include -#include #include #include #include diff --git a/include/libcamera/transform.h b/include/libcamera/transform.h index a88f809e..4517412a 100644 --- a/include/libcamera/transform.h +++ b/include/libcamera/transform.h @@ -7,8 +7,6 @@ #pragma once -#include - namespace libcamera { enum class Orientation; From patchwork Fri Aug 30 15:27:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 21122 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 040DEC32DD for ; Fri, 30 Aug 2024 15:28:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 575AC634F3; Fri, 30 Aug 2024 17:28:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="dmvYCGXE"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 98E72634DF for ; Fri, 30 Aug 2024 17:28:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725031684; 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: in-reply-to:in-reply-to:references:references; bh=mzDEvzxLzdzULr9Rz+qruecDBpWub0vf7IZevbck83E=; b=dmvYCGXE0ITc6DsITfug+g2hg/+orKbTAZZ5d/w2yrSx+rnPAr58HWkWIfVsfX7e3DpqPP EUzbKJuvx0MxfqFUE8+6h0fxSN/wcI0L4TkK06zhvo7ELDzhmf2dn6DRZGhcBTAOG+9Ckq 2nDIkh4PtTTIUF2l7KBPe5VRthMqxOo= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-615-V4ETeMlkNiKtN_gORVwDIA-1; Fri, 30 Aug 2024 11:28:03 -0400 X-MC-Unique: V4ETeMlkNiKtN_gORVwDIA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B480519560BF for ; Fri, 30 Aug 2024 15:28:02 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.65]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6E4171955F43; Fri, 30 Aug 2024 15:28:01 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH v2 20/20] libcamera: includes: Formatting improvements Date: Fri, 30 Aug 2024 17:27:17 +0200 Message-ID: <20240830152721.1420313-21-mzamazal@redhat.com> In-Reply-To: <20240830152721.1420313-1-mzamazal@redhat.com> References: <20240830152721.1420313-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The LSP autoformatter doesn't like some of the current formatting, let's make it happy. Signed-off-by: Milan Zamazal --- include/libcamera/base/log.h | 22 +++++----- include/libcamera/base/span.h | 40 +++++++++---------- include/libcamera/base/utils.h | 2 +- include/libcamera/internal/camera_manager.h | 4 +- .../libcamera/internal/ipa_data_serializer.h | 7 ++-- 5 files changed, 38 insertions(+), 37 deletions(-) diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h index 62093012..38b0ab01 100644 --- a/include/libcamera/base/log.h +++ b/include/libcamera/base/log.h @@ -43,17 +43,17 @@ private: LogSeverity severity_; }; -#define LOG_DECLARE_CATEGORY(name) \ -extern const LogCategory &_LOG_CATEGORY(name)(); - -#define LOG_DEFINE_CATEGORY(name) \ -LOG_DECLARE_CATEGORY(name) \ -const LogCategory &_LOG_CATEGORY(name)() \ -{ \ - /* The instance will be deleted by the Logger destructor. */ \ - static LogCategory *category = LogCategory::create(#name); \ - return *category; \ -} +#define LOG_DECLARE_CATEGORY(name) \ + extern const LogCategory &_LOG_CATEGORY(name)(); + +#define LOG_DEFINE_CATEGORY(name) \ + LOG_DECLARE_CATEGORY(name) \ + const LogCategory &_LOG_CATEGORY(name)() \ + { \ + /* The instance will be deleted by the Logger destructor. */ \ + static LogCategory *category = LogCategory::create(#name); \ + return *category; \ + } class LogMessage { diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h index 92cce4f0..86201aa2 100644 --- a/include/libcamera/base/span.h +++ b/include/libcamera/base/span.h @@ -125,7 +125,7 @@ public: constexpr Span(element_type (&arr)[N], std::enable_if_t (*)[], element_type (*)[]>::value && - N == Extent, + N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr) { @@ -135,7 +135,7 @@ public: constexpr Span(std::array &arr, std::enable_if_t (*)[], element_type (*)[]>::value && - N == Extent, + N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr.data()) { @@ -145,7 +145,7 @@ public: constexpr Span(const std::array &arr, std::enable_if_t (*)[], element_type (*)[]>::value && - N == Extent, + N == Extent, std::nullptr_t> = nullptr) noexcept : data_(arr.data()) { @@ -154,10 +154,10 @@ public: template explicit constexpr Span(Container &cont, std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)) { @@ -166,10 +166,10 @@ public: template explicit constexpr Span(const Container &cont, std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)) { @@ -179,7 +179,7 @@ public: template explicit constexpr Span(const Span &s, std::enable_if_t::value && - N == Extent, + N == Extent, std::nullptr_t> = nullptr) noexcept : data_(s.data()) { @@ -316,10 +316,10 @@ public: template constexpr Span(Container &cont, std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)), size_(utils::size(cont)) { @@ -328,10 +328,10 @@ public: template constexpr Span(const Container &cont, std::enable_if_t::value && - !details::is_array::value && - !std::is_array::value && - std::is_convertible (*)[], - element_type (*)[]>::value, + !details::is_array::value && + !std::is_array::value && + std::is_convertible (*)[], + element_type (*)[]>::value, std::nullptr_t> = nullptr) : data_(utils::data(cont)), size_(utils::size(cont)) { diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index 98c683a7..a9b27d0f 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -12,8 +12,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/include/libcamera/internal/camera_manager.h b/include/libcamera/internal/camera_manager.h index 0150ca61..95ddf4cf 100644 --- a/include/libcamera/internal/camera_manager.h +++ b/include/libcamera/internal/camera_manager.h @@ -7,8 +7,6 @@ #pragma once -#include - #include #include #include @@ -18,6 +16,8 @@ #include #include +#include + #include "libcamera/internal/process.h" namespace libcamera { diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h index 13470a89..66d9a19f 100644 --- a/include/libcamera/internal/ipa_data_serializer.h +++ b/include/libcamera/internal/ipa_data_serializer.h @@ -18,6 +18,7 @@ #include #include #include + #include #include "libcamera/internal/control_serializer.h" @@ -161,7 +162,7 @@ public: std::vector::const_iterator fdIter = fdsBegin; for (uint32_t i = 0; i < vecLen; i++) { uint32_t sizeofData = readPOD(dataIter, 0, dataEnd); - uint32_t sizeofFds = readPOD(dataIter, 4, dataEnd); + uint32_t sizeofFds = readPOD(dataIter, 4, dataEnd); dataIter += 8; ret[i] = IPADataSerializer::deserialize(dataIter, @@ -268,7 +269,7 @@ public: std::vector::const_iterator fdIter = fdsBegin; for (uint32_t i = 0; i < mapLen; i++) { uint32_t sizeofData = readPOD(dataIter, 0, dataEnd); - uint32_t sizeofFds = readPOD(dataIter, 4, dataEnd); + uint32_t sizeofFds = readPOD(dataIter, 4, dataEnd); dataIter += 8; K key = IPADataSerializer::deserialize(dataIter, @@ -280,7 +281,7 @@ public: dataIter += sizeofData; fdIter += sizeofFds; sizeofData = readPOD(dataIter, 0, dataEnd); - sizeofFds = readPOD(dataIter, 4, dataEnd); + sizeofFds = readPOD(dataIter, 4, dataEnd); dataIter += 8; const V value = IPADataSerializer::deserialize(dataIter,