{"id":12696,"url":"https://patchwork.libcamera.org/api/1.1/patches/12696/?format=json","web_url":"https://patchwork.libcamera.org/patch/12696/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20210623144656.1206509-1-vedantparanjape160201@gmail.com>","date":"2021-06-23T14:46:56","name":"[libcamera-devel,v3] 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/1.1/people/85/?format=json","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12696/mbox/","series":[{"id":2171,"url":"https://patchwork.libcamera.org/api/1.1/series/2171/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2171","date":"2021-06-23T14:46:56","name":"[libcamera-devel,v3] libcamera: Fix V4L2 pixel format mapping for XRGB32 and RGBX32","version":3,"mbox":"https://patchwork.libcamera.org/series/2171/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12696/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12696/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 035FFC321A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 23 Jun 2021 14:47:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 65A8468933;\n\tWed, 23 Jun 2021 16:47:28 +0200 (CEST)","from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com\n\t[IPv6:2607:f8b0:4864:20::1029])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 232D068932\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jun 2021 16:47:27 +0200 (CEST)","by mail-pj1-x1029.google.com with SMTP id g4so1662385pjk.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jun 2021 07:47:27 -0700 (PDT)","from localhost.localdomain ([1.186.167.135])\n\tby smtp.googlemail.com with ESMTPSA id\n\tr10sm166301pga.48.2021.06.23.07.47.22\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 23 Jun 2021 07:47:24 -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=\"G6nge9dF\"; 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=Mt2qaSCHeIpUiyWChJ2fW0D1yHHgg2vrLViAjVtoHcw=;\n\tb=G6nge9dFtVLAaEOYIjFnByZ05yE9CUJhDgn6r1E51un3y4FW6cVqH/MTspti4u9pdp\n\tDo2wkqZzG778ARf9lV8zDi9OIX05J2XXFMUQCqyMoPNO864YczDbfLvsC433RItBt2/T\n\tCjIbraufm9XR7mBXso+hhDhGk3+JCs17g/rHxq1vSZx1YPuHW0gX3PGtay8VYUGDJoWI\n\tmf7AUK43HkdzU1PzNjcVMmnB3AS4GdcDcRiTGkrHUGjK3syl3vsRr1o/JxVUcfcsqt2x\n\tRLN5OdUyX6jrqfuR7QE/Uu83WJ1NngKOHeuBDd6jhgf01uFzF2+2r78DW5iTMtqJQV1S\n\tEbdA==","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=Mt2qaSCHeIpUiyWChJ2fW0D1yHHgg2vrLViAjVtoHcw=;\n\tb=M96fzhE33VAJOr7HnCiMWAR7R3f1b5Tpuex2nUdVyHzmoapWm9FRCLTTxqeVQoFKVg\n\tEvj1AmJnzGnNuOHcbwNTP0QbmPxBmhV5cf4B7pAA2Ox33nF74EhV9VjrUNIqUcHrPuIa\n\tGg648tisXuY/APO4GmsbslYvv9fcnNMsOGrJOkmPbILIaGm4ZHONTyfxhfIfl+D8xNR2\n\tvCYWKlPOm/Vbsir/EyDTVPe8sECrXd205BOkryV1m5+R4zLo9w2WvFywr4ld3SiANZxE\n\t9LzwLkv180jY01+RzuOqkam7Z3bn5wMa63c/HGZdzX4qH9xojmh08wQuejE3x42LXHKN\n\t+isQ==","X-Gm-Message-State":"AOAM530OFEm6wFlfKyNqXY7fUBkqvA428yOPPoAxbeagHDxHo9fad+DJ\n\taciMBppKL/tBu3kAs7gIzn6FVuDLlphPz2cYVb4=","X-Google-Smtp-Source":"ABdhPJzniUWxAb4xc26f9iLqyjuUtaKNCsfEUKXsnwVqJ8lQeUGBPlPKEKeb26Zv0emEmDUn8zyd4g==","X-Received":"by 2002:a17:902:f212:b029:123:78c0:84a6 with SMTP id\n\tm18-20020a170902f212b029012378c084a6mr33571plc.31.1624459645183; \n\tWed, 23 Jun 2021 07:47:25 -0700 (PDT)","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 23 Jun 2021 20:16:56 +0530","Message-Id":"<20210623144656.1206509-1-vedantparanjape160201@gmail.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3] 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 following warning, by adding BGRX8888 pixel format\nin libcamera, and updating the existing mapping of V4L2_PIX_FMT_XRGB32\nto it's corresponding libcamera pixel format. Additionally, adds a new\nmapping of V4L2_PIX_FMT_RBGX32 to formats::XBGR8888\n\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.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","v3"]}