From patchwork Wed Aug 27 09:07:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 24246 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 7C2D6C332A for ; Wed, 27 Aug 2025 09:08:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7AC4F69311; Wed, 27 Aug 2025 11:08:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ROR2Bi/A"; dkim-atps=neutral Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F75A692FD for ; Wed, 27 Aug 2025 11:07:50 +0200 (CEST) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-45b627ea685so20862995e9.1 for ; Wed, 27 Aug 2025 02:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1756285669; x=1756890469; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yXana9Nl9PmBQf3mtP+lNFgt1GdsOJPf083APJVKErk=; b=ROR2Bi/AKs6+MFSVOx+w8agilhcfsfdJHyJ61ywB9K6f3DYftgwUbe3wHHm1JinMKL iC/5rKzm6jM0VtnPC/u6o/FoqkLTbTeaKLb02C+4CVLXD5Eau03McfxotfzXRgo1gy3n GmW3/SO4wzF30hwGOPY46IHTcl0eu5D9evDW2YYZPV8bHRoA/PQynQaDoM6+okK+wBKC MvmZtAjPP4Ceaeis6m2mA11Ci6oVgH07y0l4nHdyM9Z7S1cJKAiPJRjF3iLq23mUaTqQ 4+9/s8TLJa3S9JjF6KRyYUxwuPxrfQ/K9UMNO0IDJh1Q7BUIezYG5Qc1vibqy9IPgjMe fE3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756285669; x=1756890469; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yXana9Nl9PmBQf3mtP+lNFgt1GdsOJPf083APJVKErk=; b=JIUwOw2/wRvfz0NhsLDDZadEMGbDrOLHxu7l8gFLe97YGhlAKFqlYQqtjWdYyu0DB0 ISgAjjJqEaYazZe8ti/wSiXIoEjhDzmMGH3z8PoFXW6NvRv7nZO1LKRyCKLaDvzrQePQ L/hZPMsYompGB3B3hLbPNqST8P9caxLn3+fVFXgtBd2F4fVHAdMDwcd4335dYCnEK19v lNz4xhwtEO5xGk6GL6jFGmIWJe3VuUcGpzGHGBGTwdvghoOJI/DhpEnbovadogiolQzh WUZiBh2d+oDbwdlcBPNGitAoKar7cimm2pRlj0eGDDqeyDQC42Rztt4p+zpYNfZNS+2s 2jrA== X-Gm-Message-State: AOJu0Yy5Lz9GBKsQKHPSETEdmud5JLONdGfGzc51+w4Oz9b+fUX+GNeU Ayl60oNvbas5do3Gtl9yneOzPEWtkiSvEsPODqEz4W7RHhnnFzTp/aXP4AhQfbwLZimW0d2/fZW +OCv5 X-Gm-Gg: ASbGncueShnRArTIoRbeISuSlUeq2nsdn+8f1B/j/ZzDpFJC5t/ab+WPTIj+uyP7ZTe u4qTIGLGtBhWesFY2JI8TWbFl3eJE8tQGsDaUMiGJ2UWGhgZrAZSVxWanzI7j6GavruCz3Dlf5u xTt50RnZ4cIYjp1zZPdR1/zqu+EF1vF+AdepoQi2KDJnaT2zQiMCJ9BMgVRFBooTMjn+kJOFXPo Hc/mPyqKlziw+FemFJuSEntyDy3IEYAMNF0tRce5P6Sl+Dt6N5q25UNZlgxHwxSjGQ4O5YvRM4t i4nxpcIL8Sn0D0YMf0c1Nw3wT04qhKYZS7ZPDznuEm+FVCGxRHCLCE/lOcJsNYNiLijjSg604u/ fKAgXCd1KVPwjecVxt9SsojSv3WHxL/mOsxgDt5ZRy5CCDn23yn1fHHM46gRsh8XyDcO+KmhY6W Z80dnmnyEIk3Hq5Htl1C2ZS0BJukv40ENFewSkPDOpz2OqevDsSQ== X-Google-Smtp-Source: AGHT+IFdJ2JmuF2Kd0FPRuYgKB+Mcc4NY+7KxPR6UA8b0mlGe762mcPjkcZs6poHBozGRTWBPVio3Q== X-Received: by 2002:a05:6000:18a2:b0:3c8:dc75:e9ea with SMTP id ffacd0b85a97d-3c8dc75eddbmr7517341f8f.28.1756285669232; Wed, 27 Aug 2025 02:07:49 -0700 (PDT) Received: from raspberrypi.pitowers.org ([2a00:1098:3142:1f:ffc9:aff6:7f7f:893b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f30fe02sm21498675e9.18.2025.08.27.02.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Aug 2025 02:07:48 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Cc: David Plowman Subject: [RFC PATCH 08/12] pipeline: rpi: Allow generation of raw input configurations 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 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Support the RawInput stream role, which makes a raw stream that is marked as an input (for example, for Bayer re-processing). Signed-off-by: David Plowman --- .../pipeline/rpi/common/pipeline_base.cpp | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 1d4d6088..e7b01f9f 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -393,12 +393,23 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, Span colorSpace; + StreamDirection direction; if (roles.empty()) return config; - Size sensorSize = data->sensor_->resolution(); + /* + * When running memory to memory, without an actual sensor, we can't ask for its size. + * We'll make a CameraSensorMemory, to match the raw input stream configuration in due + * course, but for now use a placeholder size in this case. + */ + Size sensorSize = Size(640, 480); + if (data->sensor_) + sensorSize = data->sensor_->resolution(); + for (const StreamRole role : roles) { + direction = StreamDirection::Output; + switch (role) { case StreamRole::Raw: size = sensorSize; @@ -410,6 +421,15 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, SpanispFormats(); pixelFormat = formats::YUV420; @@ -495,6 +515,7 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, SpanaddConfiguration(cfg); }