| Message ID | 20260511202327.40191-1-maxbretschneider@protonmail.com |
|---|---|
| Headers | show
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 [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 26FEBBDCBD for <parsemail@patchwork.libcamera.org>; Mon, 11 May 2026 20:23:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D56B26302D; Mon, 11 May 2026 22:23:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="KGzf+0n/"; dkim-atps=neutral Received: from mail-10631.protonmail.ch (mail-10631.protonmail.ch [79.135.106.31]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C298B62E9D for <libcamera-devel@lists.libcamera.org>; Mon, 11 May 2026 22:23:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1778531021; x=1778790221; bh=r0eOW98/up6XBCuoxFGmY24wsHRHi6LpPyUOfwO4f1E=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=KGzf+0n/Vd4zsQ4QwbTypnZ65YMAyRbUZQurP7v+1KCyc2AbDxNDaGSL8omU+3A+d r1rNlMEdnxd5UUtGnxz2RZ9N859cp6tWWT1rwp8pfcX3O1YGv8w2Ly93glinjGccID f8dee1Offa4fHLnck/CKaBK4auSG8A19uki4sEejINVM+ld78Uuki9oastQvVPFLjH r58rl5SYTROtvd2J/kvsty8hlEtVOY/Ff7BSnv9mWJSYvMk+C6ON6IM+vR7xHrb+zo sVecxbI9RnOy94wtno1rPCFW8WF5uedHCs8qN7HjeVT2gqVcfgtobWCWm4ICy6BU1T 8UEmkWZTap72w== Date: Mon, 11 May 2026 20:23:37 +0000 To: libcamera-devel@lists.libcamera.org From: Max Bretschneider <maxbretschneider@protonmail.com> Cc: Max Bretschneider <maxbretschneider@protonmail.com> Subject: [RFC PATCH v3 0/2] libcamera: pipeline: virtual: Add raw Bayer frame support Message-ID: <20260511202327.40191-1-maxbretschneider@protonmail.com> In-Reply-To: <20260504091623.3354474-1-maxbretschneider@protonmail.com> References: <20260501105137.439519-1-maxbretschneider@protonmail.com> <20260504091623.3354474-1-maxbretschneider@protonmail.com> Feedback-ID: 122687743:user:proton X-Pm-Message-ID: f6b9f06f68a32cd53c2c3f8270fd7a131a59f585 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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>, <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>, <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> |
| Series |
|
| Related |
show
|
Changes since v2: - Use std::get_if instead of holds_alternative + std::get - Extracted the file collection into collectFiles() helper - Use BayerFormat::toPixelFormat() - Drop SoftISP-specific controls and the mention of it The virtual pipeline handler currently only produces NV12 output, either from test patterns or JPEG files. This means that SoftISP, which processes raw Bayer data, cannot be tested without physical camera hardware. A first step to achieving this would be to support raw streams in the virtual pipeline handler. This series introduces a RawFrameGenerator that reads binary raw Bayer files from disk and serves them through the virtual pipeline. The introduced changes are opt-in through the YAML configuration. If virtual cameras are configured with raw_frames, the new code path is chosen, paths for the existing test_patterns and frames are unaffected. The SoftISP part of this patch's motivation is complemented by David Plowman's series, which introduced the CameraSensorMemory class (https://patchwork.libcamera.org/patch/25468/), since SoftISP needs an actual CameraSensor for correct construction. The idea is that in the future it can be used together to serve Raw frames through the virtual pipeline and process them with SoftISP, for example for CI tests or more easily reproducible benchmarks. Testing: I have used `dd` to create zero filled raw frames to test things such as format negotiation, buffer sizing, general frame flow, config parsing (both right/wrong, e.g. rejecting invalid input) and bit depth handling. I've written a small bash script to essentially automate this for all n : { 8, 10, 12, 14, 16 } and the four Bayer formats in accordance to `src/libcamera/formats.yaml`. I then used numpy to test the generateFrame() functionality by generating a known frame with content, capturing it through the pipeline to disk with the cam application and then reading the output back again to verify that all the pixels match the expected values. I noticed that the pipeline handler components currently have no dedicated test coverage, if I missed them or if there is some preferred approach for adding additional testing I'd be open to any suggestions. For now I can also share my scripts if that's wanted. Ran `git clang-format` as well as the `checkstyle.py`. I've run the Meson tests both with and without the changes and get the same: Ok: 51 Expected Fail: 1 Fail: 1 Unexpected Pass: 0 Skipped: 29 Timeout: 0 Open questions: - The sensor properties set in match() (ColorFilterArrangement, PixelArraySize, UnitCellSize) are currently hardcoded, and I've left them with a \todo. Should I move these directly to the yaml as well or proceed differently? - Currently every frame is read into framesDatas_ immediately at startup. Depending on the number and the size of the raw files, this could take up quite a lot of memory. For the use cases I thought of (e.g. CI) this would be fine, since the number of files would probably be comparatively small there. Still I wanted to bring it up. - We weren't sure if the SPDX license header is fine like this. For the moment I've just placed my intern company mail, is this fine as is? Documentation: I've added documentation according to the coding-style.rst, if my comments are not sufficient I'd be happy to add more of course. AI Disclosure: I've used DeepWiki to familiarize myself with the libcamera repository and to point me at reference implementations and patterns to use as orientation. Thank you all for your time! Max Bretschneider (2): libcamera: pipeline: virtual: Add RawFrameGenerator libcamera: pipeline: virtual: Add raw_frames config and Bayer format support .../pipeline/virtual/config_parser.cpp | 156 ++++++++++++++---- src/libcamera/pipeline/virtual/meson.build | 1 + .../pipeline/virtual/raw_frame_generator.cpp | 131 +++++++++++++++ .../pipeline/virtual/raw_frame_generator.h | 47 ++++++ src/libcamera/pipeline/virtual/virtual.cpp | 99 +++++++++-- src/libcamera/pipeline/virtual/virtual.h | 3 +- 6 files changed, 389 insertions(+), 48 deletions(-) create mode 100644 src/libcamera/pipeline/virtual/raw_frame_generator.cpp create mode 100644 src/libcamera/pipeline/virtual/raw_frame_generator.h