{"id":15009,"url":"https://patchwork.libcamera.org/api/1.1/patches/15009/?format=json","web_url":"https://patchwork.libcamera.org/patch/15009/","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":"<20211203113205.2470651-1-naush@raspberrypi.com>","date":"2021-12-03T11:32:05","name":"[libcamera-devel,v1] pipeline: raspberrypi: Return the sensor formats from generateConfiguration()","commit_ref":"f31be76ae67f0eae8c417faa53d8e0281368e0bb","pull_url":null,"state":"accepted","archived":false,"hash":"faba07b2c5a7229020fbe6ed70575d54ce18234f","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15009/mbox/","series":[{"id":2809,"url":"https://patchwork.libcamera.org/api/1.1/series/2809/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2809","date":"2021-12-03T11:32:05","name":"[libcamera-devel,v1] pipeline: raspberrypi: Return the sensor formats from generateConfiguration()","version":1,"mbox":"https://patchwork.libcamera.org/series/2809/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15009/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15009/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 153BFBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Dec 2021 11:32:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3033E60832;\n\tFri,  3 Dec 2021 12:32:10 +0100 (CET)","from mail-wm1-x330.google.com (mail-wm1-x330.google.com\n\t[IPv6:2a00:1450:4864:20::330])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1BDF560725\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Dec 2021 12:32:09 +0100 (CET)","by mail-wm1-x330.google.com with SMTP id\n\tj140-20020a1c2392000000b003399ae48f58so4600357wmj.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Dec 2021 03:32:09 -0800 (PST)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:f90b:ce61:df54:5de7])\n\tby smtp.gmail.com with ESMTPSA id\n\tm125sm4813688wmm.39.2021.12.03.03.32.06\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 03 Dec 2021 03:32:07 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"OXKkxh96\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=drbl14TmP776mHISQhRttxrZ0MX/2xfGQmpopOm+l1A=;\n\tb=OXKkxh96LoVYVLyawwJbCsi/+J9fv/aQDMoTIvATHGK/9gPp90FbPUuy09BseuzhKd\n\tiZ1Ci64Y3SHFAGT7Yj/JXXxvRt7EAGs9QZZw+a0+JgTJdbTQLH0ShPERO6UhIihXgpjZ\n\tM0Z0yVVepxr4nNppUGDjB42/wv+eS03VCOp5eM2JkV0mujjE2gLBCvzEpigLXVu7rAz1\n\tpBq5fJ6w5uM086Q0qmVTN4hxww9JAl0c9XxRwN6J3VODf7J9vjKnAt+e5I0drL2HSPMc\n\tbRdJOVjY+AbAqVDTwEiFDufjHt+YHq4ApiXu0z9q5YF6QGYaN0PpJd40/dsrHIpFowGU\n\t1pWw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=drbl14TmP776mHISQhRttxrZ0MX/2xfGQmpopOm+l1A=;\n\tb=Rc6N8vjnZccyGSWeGy49DgOET/4YpQgKgfB7MlW56sVxsAcWLm/S0F725hayy44OIM\n\t+MJBWlFM2kG6rMXiM+Kauj8ercRvZ2cL5UW4HicCyyKc8RlbkcaIObTRbzaB9hSsT0YM\n\t0QyQy6bEso3Aykzc+Adt/4P/PriM1g9qBokQex1Vq1KZXR0zXhGm72h3E2VmsNl8DsH6\n\tZ3sO6L1dsTUm/duloR1SyGsrWO1/BDc2Gm9lvDgoVinoBZpLThu+fvs3TdX4bxvq3OmH\n\tcSJtb40nf3x/HpuF/bBgTTfsbL/46cLDxrWbz1Ulgujypm37ZYrPSRE7oYIXfopPMiUH\n\tM3ZQ==","X-Gm-Message-State":"AOAM532vDomI8gkaoaIpDY+IxF5AOeBfrg19ARDS6DotmaG+n0Vsu1Rw\n\tfZGxnsk2rxE7ddJLfTL5s3lsH4mOyEPmNnHc","X-Google-Smtp-Source":"ABdhPJzQ5awXEC2owmwNMtFmw8yqy0/aNyls+PRgjakL6Voe8COkgLOTInyw1pamS20oir427/Nm6w==","X-Received":"by 2002:a1c:9dc7:: with SMTP id\n\tg190mr14316539wme.130.1638531128172; \n\tFri, 03 Dec 2021 03:32:08 -0800 (PST)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  3 Dec 2021 11:32:05 +0000","Message-Id":"<20211203113205.2470651-1-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1] pipeline: raspberrypi: Return the\n\tsensor formats from generateConfiguration()","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Return the available sensor PixelFormats and sizes from generateConfiguration()\nif the StreamRole is set to StreamRole::Raw. The existing code returns the\nPixelFormats and sizes for all other StreamRole types.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 21 ++++++++++++++-----\n 1 file changed, 16 insertions(+), 5 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 5b76916e9e98..cbfb58562626 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -595,12 +595,23 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n \t\t\treturn nullptr;\n \t\t}\n \n-\t\t/* Translate the V4L2PixelFormat to PixelFormat. */\n \t\tstd::map<PixelFormat, std::vector<SizeRange>> deviceFormats;\n-\t\tfor (const auto &format : fmts) {\n-\t\t\tPixelFormat pf = format.first.toPixelFormat();\n-\t\t\tif (pf.isValid())\n-\t\t\t\tdeviceFormats[pf] = format.second;\n+\t\tif (role == StreamRole::Raw) {\n+\t\t\t/* Translate the MBUS codes to a PixelFormat. */\n+\t\t\tfor (const auto &format : data->sensorFormats_) {\n+\t\t\t\tPixelFormat pf = mbusCodeToPixelFormat(format.first,\n+\t\t\t\t\t\t\t\t       BayerFormat::Packing::CSI2);\n+\t\t\t\tif (pf.isValid())\n+\t\t\t\t\tdeviceFormats.emplace(std::piecewise_construct,\tstd::forward_as_tuple(pf),\n+\t\t\t\t\t\tstd::forward_as_tuple(format.second.begin(), format.second.end()));\n+\t\t\t}\n+\t\t} else {\n+\t\t\t/* Translate the V4L2PixelFormat to PixelFormat. */\n+\t\t\tfor (const auto &format : fmts) {\n+\t\t\t\tPixelFormat pf = format.first.toPixelFormat();\n+\t\t\t\tif (pf.isValid())\n+\t\t\t\t\tdeviceFormats[pf] = format.second;\n+\t\t\t}\n \t\t}\n \n \t\t/* Add the stream format based on the device node used for the use case. */\n","prefixes":["libcamera-devel","v1"]}