{"id":12706,"url":"https://patchwork.libcamera.org/api/patches/12706/?format=json","web_url":"https://patchwork.libcamera.org/patch/12706/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210625110224.2001529-1-vedantparanjape160201@gmail.com>","date":"2021-06-25T11:02:24","name":"[libcamera-devel,v4] libcamera: Fix V4L2 pixel format mapping for XRGB32 and RGBX32","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"97b4a0b5ab9eb8b91a1d94a8e3bac0cc266635a4","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/people/85/?format=json","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12706/mbox/","series":[{"id":2174,"url":"https://patchwork.libcamera.org/api/series/2174/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2174","date":"2021-06-25T11:02:24","name":"[libcamera-devel,v4] libcamera: Fix V4L2 pixel format mapping for XRGB32 and RGBX32","version":4,"mbox":"https://patchwork.libcamera.org/series/2174/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12706/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12706/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 32C1EC321A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 25 Jun 2021 11:02:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E6E3B684CE;\n\tFri, 25 Jun 2021 13:02:35 +0200 (CEST)","from mail-pf1-x432.google.com (mail-pf1-x432.google.com\n\t[IPv6:2607:f8b0:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AB39E684C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jun 2021 13:02:34 +0200 (CEST)","by mail-pf1-x432.google.com with SMTP id k6so7717602pfk.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jun 2021 04:02:34 -0700 (PDT)","from localhost.localdomain ([1.186.165.32])\n\tby smtp.googlemail.com with ESMTPSA id\n\ts42sm5564602pfw.184.2021.06.25.04.02.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 25 Jun 2021 04:02:32 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"slNY/DRS\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=fTPTdlZJr1bEK5wia416l6NxQWn0zJiGszx2MJmIXhY=;\n\tb=slNY/DRSHWAW5d0vu2oBaaOdzpYjflN/bmj0uluzI2yXluTl1y2l4E+6A4rsnyHzRj\n\twBv/arI6/0oCwkbPKT9+FbgEtZEI1jNikEKPlvrmgA2FxtJZfEIOupvOVittGIdP7XWP\n\tDu9/7GjcajwW+6xJ1cy2fJjq7xxzyviMXCHm/KDDOnPjQKmTytslSx+xZyESzcLhWzhR\n\tdLrcld1pbMLmUG+2wm8tP/Lr+E+dt05Vyvymh4o1egG7/ejgeNWd4SvJvVUu+BwmBJCW\n\tau70HMqD8Fip6HcO/l7tYAsRfmjGbyGzeAh2wB+1bSU9zYWqbEeZu2kvsHPMCpQPeuvj\n\t1qTw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=fTPTdlZJr1bEK5wia416l6NxQWn0zJiGszx2MJmIXhY=;\n\tb=FTtpITGhwlMe3nEDJcpFdZX9AjTgqwKwI6q3H4S/mECu8wiWn0lnFW08r7boPocwfd\n\tyDOERGiXQaE15iccOIsTmj54fT/DDYe4GkaDmJwBD9LiH9Fhf2t2+YojLBCiN44cuKJV\n\tBOZUTIhjHNag12jfuCsMI9M3+wZVRRB2Xxd0aKZw5j45v24qBPvtaj610t+oeAXBrzrT\n\tK4x3rm6v4Xqx8nxoGh+CJaNagnCr0oCygD2SJqls1FQSCJeWNUCHZ4ezPRs9PFcP0uLJ\n\tDL7EevYzigYTByXVBzLHAYeARpQvNfaykSnsqQWSaaPEMQ8Gven4TtifjCjRK5TO2DaC\n\tZ5Xw==","X-Gm-Message-State":"AOAM532hIaZmbYqyc57lLlFWOf3STPI9xuC3V4jSD3jC1YhIiAbi8BZl\n\tJgM/wRTh7unRpxUsDTCJypf1xkzhGfLzSD/J","X-Google-Smtp-Source":"ABdhPJyPFOz+KumF0UGM37p1phvBJGjr7I1bcbfV/Kqv0B6jBotXq3i0010edYDA8mH+g/+tIDSiOQ==","X-Received":"by 2002:a05:6a00:2395:b029:304:7a51:6f1d with SMTP id\n\tf21-20020a056a002395b02903047a516f1dmr10146164pfc.53.1624618952998; \n\tFri, 25 Jun 2021 04:02:32 -0700 (PDT)","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 25 Jun 2021 16:32:24 +0530","Message-Id":"<20210625110224.2001529-1-vedantparanjape160201@gmail.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4] libcamera: Fix V4L2 pixel format\n\tmapping for XRGB32 and RGBX32","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"On running libcamera gstreamer element on Raspberry Pi 4B+, there was a\nwarning as follows:\n\n[3:23:59.717513107] [3577] WARN V4L2 v4l2_pixelformat.cpp:180 Unsupported V4L2 pixel format XB24\n\nThis patch fixes the warning, by adding BGRX8888 pixel format\nin libcamera, and updating the existing mapping of V4L2_PIX_FMT_XRGB32\nto its corresponding libcamera pixel format, which is formats::BGRX8888.\nAdditionally, add a new mapping of V4L2_PIX_FMT_RBGX32 to formats::XBGR8888.\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/libcamera/formats.cpp          | 12 +++++++++++-\n src/libcamera/v4l2_pixelformat.cpp |  3 ++-\n 2 files changed, 13 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex 55822f4c..e41bfc05 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -198,13 +198,23 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{\n \t{ formats::XBGR8888, {\n \t\t.name = \"XBGR8888\",\n \t\t.format = formats::XBGR8888,\n-\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),\n+\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_RGBX32),\n \t\t.bitsPerPixel = 32,\n \t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n \t\t.packed = false,\n \t\t.pixelsPerGroup = 1,\n \t\t.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n \t} },\n+\t{ formats::BGRX8888, {\n+\t\t.name = \"BGRX8888\",\n+\t\t.format = formats::BGRX8888,\n+\t\t.v4l2Format = V4L2PixelFormat(V4L2_PIX_FMT_XRGB32),\n+\t\t.bitsPerPixel = 32,\n+\t\t.colourEncoding = PixelFormatInfo::ColourEncodingRGB,\n+\t\t.packed = false,\n+\t\t.pixelsPerGroup = 1,\n+\t\t.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},\n+\t} },\t\n \t{ formats::ABGR8888, {\n \t\t.name = \"ABGR8888\",\n \t\t.format = formats::ABGR8888,\ndiff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp\nindex 166d93cf..78a08303 100644\n--- a/src/libcamera/v4l2_pixelformat.cpp\n+++ b/src/libcamera/v4l2_pixelformat.cpp\n@@ -51,7 +51,8 @@ const std::map<V4L2PixelFormat, PixelFormat> vpf2pf{\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_RGB24), formats::BGR888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_BGR24), formats::RGB888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_XBGR32), formats::XRGB8888 },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::XBGR8888 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_XRGB32), formats::BGRX8888 },\n+\t{ V4L2PixelFormat(V4L2_PIX_FMT_RGBX32), formats::XBGR8888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_RGBA32), formats::ABGR8888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_ABGR32), formats::ARGB8888 },\n \t{ V4L2PixelFormat(V4L2_PIX_FMT_ARGB32), formats::BGRA8888 },\n","prefixes":["libcamera-devel","v4"]}