From patchwork Fri Jul 2 12:08:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 12783 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 32E1EC3220 for ; Fri, 2 Jul 2021 12:09:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E2C8F684F6; Fri, 2 Jul 2021 14:09:18 +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="lSjHKTTs"; dkim-atps=neutral Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 09923684E8 for ; Fri, 2 Jul 2021 14:09:18 +0200 (CEST) Received: by mail-pj1-x102c.google.com with SMTP id ie21so4491668pjb.0 for ; Fri, 02 Jul 2021 05:09:17 -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=pV6FdVV/aLxdt/Tstgogr09WYrZw9Slfqnofk5vD+J0=; b=lSjHKTTsCHONSu2mgybiCU6vBz3xSdsx5X1oPr9vGh80MsZpX2BYEBJh87XdPTT60+ OI5wXsboaSDJHIEcXqrMM/q/OQKNXrxDYNvO6q5KH+csXKJub84yq4DZkq4Z9Q12dXKR Om/gVF/xfS5U7gr53QQqRN3So8K8cKwHAZO0w92+Zjs920y3fzNnZng/ZgGXWtTjFLEf wLgdjvMQg1IC9fCDVvnhMas/L55AgILuoysiYUGVakJm+6f+ymzXyDihbBwPIDzRcL99 l932/T7f0MJbZhLJmJzDR9slPh8+9kRJHVEnbYEiOBMmx3Q82wjrpu7T9xGcJXyIFt45 5j+Q== 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=pV6FdVV/aLxdt/Tstgogr09WYrZw9Slfqnofk5vD+J0=; b=L+ZoU4bW5vwysTders0AWK7+qx+juEal2evlV5kXOPbJtFxMGfBGOQXb0C3tJUJn0X iyroGEyvexrfbeyR9VAyYyXyoFQgp7xafB4/4r/HKUJaNozawD1mddYbvY9x37owsDSm lxDn5L8ZjSnOzhbZicblOATx3fZIN0VgOBknYlRUqsbzFj7eLdsvDDw3JEq1FD3coD4R bbn1d8D/D2qZFXbgrBef31B2hvzPj+nVDwnrECSYxOLV9LxZYdhK3FdWIaX5W0B9PtQq gd3KaJZ4wxf6upzKYkosWni3pjbV5s18hLt3jhXphvlHY2nCfOQf8EGGSQF4HBd5y+b5 QYcg== X-Gm-Message-State: AOAM5334720OpU2y/NknHfONnK5zG/Ax2i1rPVkvuSWbqU/9KpEbDEh8 FXwwxN3H5De2oW7hMSvZUo8RxoG+9HMmYCO0/Us= X-Google-Smtp-Source: ABdhPJy9F+oIfuejyyl3qs0guRWecsOyvUdAmAGy2+IAW+jU2/m811y9waLXUYlcP2XXx4JeVLxocQ== X-Received: by 2002:a17:90a:ff0e:: with SMTP id ce14mr14923232pjb.204.1625227756131; Fri, 02 Jul 2021 05:09:16 -0700 (PDT) Received: from localhost.localdomain ([1.186.167.49]) by smtp.googlemail.com with ESMTPSA id i6sm3835325pgg.50.2021.07.02.05.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 05:09:15 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Fri, 2 Jul 2021 17:38:50 +0530 Message-Id: <20210702120850.457492-2-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210702120850.457492-1-vedantparanjape160201@gmail.com> References: <20210702120850.457492-1-vedantparanjape160201@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 2/2] libcamera: Adds 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 },