From patchwork Thu Jul 15 18:15:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 12968 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 03D86C3225 for ; Thu, 15 Jul 2021 18:15:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ACA036853E; Thu, 15 Jul 2021 20:15:52 +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="rNXqHZrv"; dkim-atps=neutral Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A08C168538 for ; Thu, 15 Jul 2021 20:15:51 +0200 (CEST) Received: by mail-pl1-x62c.google.com with SMTP id h1so3832479plf.6 for ; Thu, 15 Jul 2021 11:15:51 -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=rNXqHZrvVbexc2QM24+axgB4Ks27CJqDo2oYHLdFFix4wGn5naiwMAbarosoR4xcXp TGf3x0IG2WnfQJ2S1QTEvn/vKsU3hBtDwqEXDY3IzaHqa8dofEfp/dkUKkl4urmhXwmU Q5dMqeYwnUct14OmyU2RgTMuZ9ks5E8UC3AVa9NVeLFDdcaITfZh5UB401ydVs22XTkc uNMeU4KJGK0XGawrmULyZqutM0WnY4xIKmlxRnjUMytt4n9vImjqVzeB0wqo1PQmLgwR NmnFdRS/xHUs5g26tXhNbycpFJ2FPyUlkTNBbVjftXIy8Cl93v0CFz/T15IJy/bvb5Sm WdTg== 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=ayuOdkF3NAVY4Prk6OvSE90hNcVO3X/Q4VfNKjJEKyERObEOdBHcPOEJ29dKganMEZ tgIBNMUj2nAKI8t6ZMrihQapenKs2NlwOM/2N65Cp++aVbZlXydDkwDXrmJJnIO7ViOi FPpj1qE5MgRryF/8eC7BJUn59F6VCQRdQeu7epLjkJlMt8yjJiT7bn6d4odmM+/39mdc 89AafwKlWdenTeay5Zt5HBLh1pEooRmIKwmHAEUj7IKS9wO5bkuwvKrRQ6pfEe0NvyIc RjAiaUNpAyDtIbCZZbwWJDWiE0akDTRW/7B0F81YcZ90YzzO6JtuoYID+VihlcRO0bF4 7vxA== X-Gm-Message-State: AOAM5315Zcy/6wD0EzlYCdViV5qUR5fAvP6B+m75u3xFeRGXMv1mhVeN XKuB1xsVE2Y2CKU7FsTYWyhMVoljzcRnUBaymQI= X-Google-Smtp-Source: ABdhPJxI4YO9osAkWBTdl/0iHV7FhGNZDbBSwYsdfDSTg2m2TfKigLwsdponxi5NxYJVJkbTf/t58w== X-Received: by 2002:a17:902:7085:b029:114:eb3f:fe29 with SMTP id z5-20020a1709027085b0290114eb3ffe29mr4408821plk.40.1626372950010; Thu, 15 Jul 2021 11:15:50 -0700 (PDT) Received: from localhost.localdomain ([1.186.167.37]) by smtp.googlemail.com with ESMTPSA id b3sm7358293pfi.179.2021.07.15.11.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 11:15:49 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Thu, 15 Jul 2021 23:45:22 +0530 Message-Id: <20210715181522.273606-2-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210715181522.273606-1-vedantparanjape160201@gmail.com> References: <20210715181522.273606-1-vedantparanjape160201@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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 },