From patchwork Tue Oct 22 07:43:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cheng-Hao Yang X-Patchwork-Id: 21724 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 0AAF2C3272 for ; Tue, 22 Oct 2024 07:45:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BE2E965392; Tue, 22 Oct 2024 09:45:52 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="l2mkavdo"; dkim-atps=neutral Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 20E9C6053E for ; Tue, 22 Oct 2024 09:45:51 +0200 (CEST) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-20cb47387ceso47317135ad.1 for ; Tue, 22 Oct 2024 00:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1729583149; x=1730187949; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zltTR/htsvMrI/cvqM8tSDGxixWEGTHpn7i1gCqcJgo=; b=l2mkavdoud/6awhV33+4aihmkqjIcsRdbI/o1ZILSXa0hW0idPj7pY+y3BX4/0mYQV QA9w25iIOTY9OfyF3iNpRmxG+L8uRLrnBkhmii+0/5DBIrbnsJ92rBcWUz3/BXqc15UQ Ni8dVGxmpuh3iLbKTxiv3wGOAiucXDsWpwUNs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729583149; x=1730187949; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zltTR/htsvMrI/cvqM8tSDGxixWEGTHpn7i1gCqcJgo=; b=IS5SzUOz5YuhhBgmzhUvweH9TI2+acZoFox0gzec0Lkt7qzGH11Ygj8+VmokYvNO37 C2w6GNRlZHAa1lk0gl0VkElB5IjBrX1228eBbklmzuNPzht+w8bGYSr29cSPslvk7HBX aqkCJIWuYGql8YJg5od/+E3+I53SJjeOfgEygrmfxEKrWJkCkr6qiATeeCPAFNMBwpgN Q8P97+Tju3dRTcGqyOryvArOvZqwvX/Ko9AKjdUkMmsDORTKQXwToSbuYHdleGOxdRRl PLNrG3w2ti/VV8aJmQIFvbR+J+MX3ADq74AcaOWxQrkMwpjYhMVmTe0xEn+mmYizsZa0 Ur0g== X-Gm-Message-State: AOJu0YzcOnnAueUTMOh5aS5cfNhiYGOn2LaefRI0UuD5UJIYLOdiHWF0 UkmKtO10YVso015WmiQvBXu7JfA7jSu+NIkpOPVi0LNOj7Sa/GYLcgu+AEq+7Av3fwJigPMe/5w = X-Google-Smtp-Source: AGHT+IF9yuTN2ZjKXXIoUA/OE/X2q4zucPMBbtK0pw2xhfqwCrQsqy34hkAnBsYDsdDRWKArInTiGQ== X-Received: by 2002:a05:6300:44:b0:1d9:2a8:ce10 with SMTP id adf61e73a8af0-1d92c589082mr20272308637.34.1729583149155; Tue, 22 Oct 2024 00:45:49 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (27.247.221.35.bc.googleusercontent.com. [35.221.247.27]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec13d75aesm4091024b3a.124.2024.10.22.00.45.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2024 00:45:48 -0700 (PDT) From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v16 0/7] Add VirtualPipelineHandler Date: Tue, 22 Oct 2024 07:43:36 +0000 Message-ID: <20241022074544.3790451-1-chenghaoyang@chromium.org> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog 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" Hi all, This series adds virtual pipeline handler, which doesn't depend on any hardware, like camera sensor or ISP. Currently the configuration supports test patterns and images. It passed the gitlab pipeline: https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1294884 Updates in v16: - Updates location in config with `properties::LocationNameValueMap`. Updates in v15: - Fixed multi_stream_test with `PipelineHandler::match()`. Updates in v14: - Refactored ImageFrames to keep a list of filepaths directly. Updates in v13: - Returned an errno in `FrameGenerete::generateFrame()` Updates in v12: - Added ImageFrameGenerator first, then add Parser. - Removed ScaleMode argument, as only Fill is supported now. - Fixed bug of Stream's configuration usage in configure(). Updates in v11: - Allowed a single value in the config file's frame_rates field. Updates in v10: Apply fixes according to Jacopo's and Barnabás' comments. - Split test_pattern and path fields in the yaml format. - Let FrameGenerators control frameCount_. - Fixed match() returning values. Updates in v9: Allocate contiguous memory for planes in the same FrameBuffer. BR, Harvey Harvey Yang (7): libcamera: add DmaBufAllocator::exportBuffers() libcamera: Remove PipelineHandler Fatal check of non-empty MediaDevices libcamera: virtual: Add VirtualPipelineHandler libcamera: pipeline: Add test pattern for VirtualPipelineHandler libcamera: virtual: Add ImageFrameGenerator libcamera: virtual: Read config and register cameras based on the config libcamera: software_isp: Refactor SoftwareIsp to use DmaBufAllocator::exportBuffers .../libcamera/internal/dma_buf_allocator.h | 13 + meson.build | 1 + meson_options.txt | 3 +- src/android/meson.build | 19 - src/libcamera/dma_buf_allocator.cpp | 57 +++ src/libcamera/pipeline/virtual/README.md | 65 +++ .../pipeline/virtual/config_parser.cpp | 260 ++++++++++++ .../pipeline/virtual/config_parser.h | 39 ++ .../pipeline/virtual/data/virtual.yaml | 36 ++ .../pipeline/virtual/frame_generator.h | 29 ++ .../virtual/image_frame_generator.cpp | 172 ++++++++ .../pipeline/virtual/image_frame_generator.h | 49 +++ src/libcamera/pipeline/virtual/meson.build | 13 + .../virtual/test_pattern_generator.cpp | 136 ++++++ .../pipeline/virtual/test_pattern_generator.h | 52 +++ src/libcamera/pipeline/virtual/virtual.cpp | 398 ++++++++++++++++++ src/libcamera/pipeline/virtual/virtual.h | 61 +++ src/libcamera/pipeline_handler.cpp | 11 +- src/libcamera/software_isp/software_isp.cpp | 20 +- src/meson.build | 19 + 20 files changed, 1411 insertions(+), 42 deletions(-) create mode 100644 src/libcamera/pipeline/virtual/README.md create mode 100644 src/libcamera/pipeline/virtual/config_parser.cpp create mode 100644 src/libcamera/pipeline/virtual/config_parser.h create mode 100644 src/libcamera/pipeline/virtual/data/virtual.yaml create mode 100644 src/libcamera/pipeline/virtual/frame_generator.h create mode 100644 src/libcamera/pipeline/virtual/image_frame_generator.cpp create mode 100644 src/libcamera/pipeline/virtual/image_frame_generator.h create mode 100644 src/libcamera/pipeline/virtual/meson.build create mode 100644 src/libcamera/pipeline/virtual/test_pattern_generator.cpp create mode 100644 src/libcamera/pipeline/virtual/test_pattern_generator.h create mode 100644 src/libcamera/pipeline/virtual/virtual.cpp create mode 100644 src/libcamera/pipeline/virtual/virtual.h