{"id":24246,"url":"https://patchwork.libcamera.org/api/patches/24246/?format=json","web_url":"https://patchwork.libcamera.org/patch/24246/","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":"<20250827090739.86955-9-david.plowman@raspberrypi.com>","date":"2025-08-27T09:07:35","name":"[RFC,08/12] pipeline: rpi: Allow generation of raw input configurations","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"f523c08c978467ffbddafb167cccea04c470ea14","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/24246/mbox/","series":[{"id":5407,"url":"https://patchwork.libcamera.org/api/series/5407/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5407","date":"2025-08-27T09:07:27","name":"Bayer Re-Processing","version":1,"mbox":"https://patchwork.libcamera.org/series/5407/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/24246/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/24246/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 7C2D6C332A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Aug 2025 09:08:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7AC4F69311;\n\tWed, 27 Aug 2025 11:08:07 +0200 (CEST)","from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F75A692FD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Aug 2025 11:07:50 +0200 (CEST)","by mail-wm1-x329.google.com with SMTP id\n\t5b1f17b1804b1-45b627ea685so20862995e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Aug 2025 02:07:50 -0700 (PDT)","from raspberrypi.pitowers.org\n\t([2a00:1098:3142:1f:ffc9:aff6:7f7f:893b])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-45b6f30fe02sm21498675e9.18.2025.08.27.02.07.48\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 27 Aug 2025 02:07:48 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"ROR2Bi/A\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1756285669; x=1756890469;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=yXana9Nl9PmBQf3mtP+lNFgt1GdsOJPf083APJVKErk=;\n\tb=ROR2Bi/AKs6+MFSVOx+w8agilhcfsfdJHyJ61ywB9K6f3DYftgwUbe3wHHm1JinMKL\n\tiC/5rKzm6jM0VtnPC/u6o/FoqkLTbTeaKLb02C+4CVLXD5Eau03McfxotfzXRgo1gy3n\n\tGmW3/SO4wzF30hwGOPY46IHTcl0eu5D9evDW2YYZPV8bHRoA/PQynQaDoM6+okK+wBKC\n\tMvmZtAjPP4Ceaeis6m2mA11Ci6oVgH07y0l4nHdyM9Z7S1cJKAiPJRjF3iLq23mUaTqQ\n\t4+9/s8TLJa3S9JjF6KRyYUxwuPxrfQ/K9UMNO0IDJh1Q7BUIezYG5Qc1vibqy9IPgjMe\n\tfE3Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1756285669; x=1756890469;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=yXana9Nl9PmBQf3mtP+lNFgt1GdsOJPf083APJVKErk=;\n\tb=JIUwOw2/wRvfz0NhsLDDZadEMGbDrOLHxu7l8gFLe97YGhlAKFqlYQqtjWdYyu0DB0\n\tISgAjjJqEaYazZe8ti/wSiXIoEjhDzmMGH3z8PoFXW6NvRv7nZO1LKRyCKLaDvzrQePQ\n\tL/hZPMsYompGB3B3hLbPNqST8P9caxLn3+fVFXgtBd2F4fVHAdMDwcd4335dYCnEK19v\n\tlNz4xhwtEO5xGk6GL6jFGmIWJe3VuUcGpzGHGBGTwdvghoOJI/DhpEnbovadogiolQzh\n\tWUZiBh2d+oDbwdlcBPNGitAoKar7cimm2pRlj0eGDDqeyDQC42Rztt4p+zpYNfZNS+2s\n\t2jrA==","X-Gm-Message-State":"AOJu0Yy5Lz9GBKsQKHPSETEdmud5JLONdGfGzc51+w4Oz9b+fUX+GNeU\n\tAyl60oNvbas5do3Gtl9yneOzPEWtkiSvEsPODqEz4W7RHhnnFzTp/aXP4AhQfbwLZimW0d2/fZW\n\t+OCv5","X-Gm-Gg":"ASbGncueShnRArTIoRbeISuSlUeq2nsdn+8f1B/j/ZzDpFJC5t/ab+WPTIj+uyP7ZTe\n\tu4qTIGLGtBhWesFY2JI8TWbFl3eJE8tQGsDaUMiGJ2UWGhgZrAZSVxWanzI7j6GavruCz3Dlf5u\n\txTt50RnZ4cIYjp1zZPdR1/zqu+EF1vF+AdepoQi2KDJnaT2zQiMCJ9BMgVRFBooTMjn+kJOFXPo\n\tHc/mPyqKlziw+FemFJuSEntyDy3IEYAMNF0tRce5P6Sl+Dt6N5q25UNZlgxHwxSjGQ4O5YvRM4t\n\ti4nxpcIL8Sn0D0YMf0c1Nw3wT04qhKYZS7ZPDznuEm+FVCGxRHCLCE/lOcJsNYNiLijjSg604u/\n\tfKAgXCd1KVPwjecVxt9SsojSv3WHxL/mOsxgDt5ZRy5CCDn23yn1fHHM46gRsh8XyDcO+KmhY6W\n\tZ80dnmnyEIk3Hq5Htl1C2ZS0BJukv40ENFewSkPDOpz2OqevDsSQ==","X-Google-Smtp-Source":"AGHT+IFdJ2JmuF2Kd0FPRuYgKB+Mcc4NY+7KxPR6UA8b0mlGe762mcPjkcZs6poHBozGRTWBPVio3Q==","X-Received":"by 2002:a05:6000:18a2:b0:3c8:dc75:e9ea with SMTP id\n\tffacd0b85a97d-3c8dc75eddbmr7517341f8f.28.1756285669232; \n\tWed, 27 Aug 2025 02:07:49 -0700 (PDT)","From":"David Plowman <david.plowman@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"David Plowman <david.plowman@raspberrypi.com>","Subject":"[RFC PATCH 08/12] pipeline: rpi: Allow generation of raw input\n\tconfigurations","Date":"Wed, 27 Aug 2025 10:07:35 +0100","Message-Id":"<20250827090739.86955-9-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.39.5","In-Reply-To":"<20250827090739.86955-1-david.plowman@raspberrypi.com>","References":"<20250827090739.86955-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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":"Support the RawInput stream role, which makes a raw stream that is\nmarked as an input (for example, for Bayer re-processing).\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n .../pipeline/rpi/common/pipeline_base.cpp     | 23 ++++++++++++++++++-\n 1 file changed, 22 insertions(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex 1d4d6088..e7b01f9f 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -393,12 +393,23 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole\n \tV4L2VideoDevice::Formats fmts;\n \tSize size;\n \tstd::optional<ColorSpace> colorSpace;\n+\tStreamDirection direction;\n \n \tif (roles.empty())\n \t\treturn config;\n \n-\tSize sensorSize = data->sensor_->resolution();\n+\t/*\n+\t * When running memory to memory, without an actual sensor, we can't ask for its size.\n+\t * We'll make a CameraSensorMemory, to match the raw input stream configuration in due\n+\t * course, but for now use a placeholder size in this case.\n+\t */\n+\tSize sensorSize = Size(640, 480);\n+\tif (data->sensor_)\n+\t\tsensorSize = data->sensor_->resolution();\n+\n \tfor (const StreamRole role : roles) {\n+\t\tdirection = StreamDirection::Output;\n+\n \t\tswitch (role) {\n \t\tcase StreamRole::Raw:\n \t\t\tsize = sensorSize;\n@@ -410,6 +421,15 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole\n \t\t\tbufferCount = 2;\n \t\t\tbreak;\n \n+\t\tcase StreamRole::RawInput:\n+\t\t\tsize = sensorSize;\n+\t\t\t/* Placeholder value to prevent warnings, the application should override. */\n+\t\t\tpixelFormat = formats::SBGGR12;\n+\t\t\tcolorSpace = ColorSpace::Raw;\n+\t\t\tbufferCount = 2;\n+\t\t\tdirection = StreamDirection::Input;\n+\t\t\tbreak;\n+\n \t\tcase StreamRole::StillCapture:\n \t\t\tfmts = data->ispFormats();\n \t\t\tpixelFormat = formats::YUV420;\n@@ -495,6 +515,7 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole\n \t\tcfg.pixelFormat = pixelFormat;\n \t\tcfg.colorSpace = colorSpace;\n \t\tcfg.bufferCount = bufferCount;\n+\t\tcfg.direction = direction;\n \t\tconfig->addConfiguration(cfg);\n \t}\n \n","prefixes":["RFC","08/12"]}