From patchwork Thu Jul 15 20:46:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 12970 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 B5F99C3225 for ; Thu, 15 Jul 2021 20:46:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 710DD6852A; Thu, 15 Jul 2021 22:46:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ucSHL4ke"; dkim-atps=neutral Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7366B6059F for ; Thu, 15 Jul 2021 22:46:46 +0200 (CEST) Received: by mail-pj1-x1036.google.com with SMTP id bt15so4962409pjb.2 for ; Thu, 15 Jul 2021 13:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=79q8nTRra8BB2hCmCIawmyGF4lHQ73LVIqBfkVcd7fE=; b=ucSHL4keJqBIOrzZ12iE8QC/fm7bvSA9BUEunRsmEF3+pvoHc8oKPqOjUxdsoH2s94 2W+ZPcaKXh1WYpBe70p7NiT6TyRlSPpGYcEtc+x/cBkWsB7vt2h6crtx6uYIBm0lhlxJ uyY+ID1iLU99q4+Q5hkf/LwjSZb2eppFjX67LcFBrJ3JacH/blk/wkpKjdNAft39Tcbt PqJNPVjyuDCiiQn7silpNhJNuekqMilPmhyIy+M6bw0iDCcYzEwxaGlkXko0pXWMPRTS 4RQ4Q5oR+Tu3IVhLqlVWbruaS3bNcIKaPG9BDWEdXzI2+BtSbcq91K4Sv4pr2YVVQsGt 5N+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=79q8nTRra8BB2hCmCIawmyGF4lHQ73LVIqBfkVcd7fE=; b=jY0SSET8IXA/FK/kEDs3WCAg0NeCrcTGPn/xs517A474VI0PkepbKEX5xVqy3lHraA UQeFBT8bCUtLHMz/6M0zIUUUOvuIuxIvaYc1iugR5Yhpt/O5oytkDGQGcqTMdOo9mrXs pxlgBjglxl2x1OtN2huLLiehba8pfMgR7sRSXEtMyj4vclq/5jly+4mtiKwInazbWxh+ d9Ip0YyHS+pUKN7321Yd+5HSV/CIlpSfqI4Kz/AsHl5SLFRAn5Udrru46m1PorkwsWyp 175seOGrpI4aWb3ATIW8LdHfuGqbJ1Lria6dZZYI0BgYR6I49oTeQBJTBli3TEQz1z0i q55A== X-Gm-Message-State: AOAM533HvTYjvnPehvVCyAozcUL0izEZyyGS7c/DAFK7+bIcE4VBUkgV B0cy561ttOcAbi5E2D64bsRlIoqWNuk587biN7Y= X-Google-Smtp-Source: ABdhPJzCwCb0sE6Hu5Seryy4mxVmLs0Df21ozmMf+1iW7ypfnhfsekl082OKbla+PfLMrTXMb4oAmw== X-Received: by 2002:a17:90a:8e82:: with SMTP id f2mr12153559pjo.177.1626382004846; Thu, 15 Jul 2021 13:46:44 -0700 (PDT) Received: from localhost.localdomain ([1.186.167.37]) by smtp.googlemail.com with ESMTPSA id c12sm7545796pfl.27.2021.07.15.13.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 13:46:44 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Fri, 16 Jul 2021 02:16:17 +0530 Message-Id: <20210715204617.20140-2-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210715204617.20140-1-vedantparanjape160201@gmail.com> References: <20210715204617.20140-1-vedantparanjape160201@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/2] libcamera: Add pixel format BGRX8888 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: , Cc: Vedant Paranjape Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This patch adds pixel format BGRX8888 to libcamera. Additionally adds mapping of V4L2 pixel format (V4L2_PIX_FMT_XRGB32) to BGRX8888. Signed-off-by: Vedant Paranjape Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/libcamera/formats.cpp | 10 ++++++++++ src/libcamera/v4l2_pixelformat.cpp | 1 + 2 files changed, 11 insertions(+) diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp index 578ac4af..8f1197de 100644 --- a/src/libcamera/formats.cpp +++ b/src/libcamera/formats.cpp @@ -205,6 +205,16 @@ const std::map pixelFormatInfo{ .pixelsPerGroup = 1, .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }}, } }, + { formats::BGRX8888, { + .name = "BGRX8888", + .format = formats::BGRX8888, + .v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), + .bitsPerPixel = 32, + .colourEncoding = PixelFormatInfo::ColourEncodingRGB, + .packed = false, + .pixelsPerGroup = 1, + .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }}, + } }, { formats::ABGR8888, { .name = "ABGR8888", .format = formats::ABGR8888, diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp index 59a01e02..93fc4446 100644 --- a/src/libcamera/v4l2_pixelformat.cpp +++ b/src/libcamera/v4l2_pixelformat.cpp @@ -52,6 +52,7 @@ const std::map vpf2pf{ { V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 }, { V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 }, { V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 }, + { V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::BGRX8888 }, { V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), formats::XBGR8888 }, { V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 }, { V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 },