From patchwork Thu Aug 29 19:47:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 21048 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 D1BA2C323E for ; Thu, 29 Aug 2024 19:57:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 09C0763466; Thu, 29 Aug 2024 21:57:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Bm98l0or"; dkim-atps=neutral Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8085963456 for ; Thu, 29 Aug 2024 21:57:07 +0200 (CEST) Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-428141be2ddso9054315e9.2 for ; Thu, 29 Aug 2024 12:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1724961426; x=1725566226; 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=d/9iY2syyk3Sw0GzvPLhj2YTTqHRW4GwnT/xZoQBg5E=; b=Bm98l0orLWYWtWgK6NkDVkeI8LXFX7Ex6l2hZ5ZZXzrifGw1C13PjeT9Wh5Ea6Rcez kKfLU8VJQVPTm/f0NDa31wHJGGTxYz1gf8yMN16q/wRjZq9iA2IL7Xv7TQ2W+Dech7MT hAKPzT220pHG6YDT8wgewRRGYstbhweV4PPlk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724961426; x=1725566226; 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=d/9iY2syyk3Sw0GzvPLhj2YTTqHRW4GwnT/xZoQBg5E=; b=eIsSlddfccn9GOGle6BgOBUy26U46MZIrv+BouXgbcv2XgjwLMPan248GOokQbQkng WgmVH+428rUJBdSesEwYMoDxCp63pWYsBMi92erqgGdaxETS5MNHTt8fcfbT8dl8RvsY 3c2b/JxUm42oCJDHIBnVvumU2P2g3y3f4QeMMxahROQMdkDRcslNNTl5nGGBbXTTjNUe yULSqOoafpzfHILsm/KOqMaBaUBXxc2GZjPF/cOEuMQwVGD/KDK/KjzLMdJ4zDMRZLZP /1O5606knufy34dAJ5+GUt8NQCFSz602i+gjlp4q03Zjlz9P5LD7t1Hi3ZGMfmPgUrVN 4HLw== X-Gm-Message-State: AOJu0YylSWKYqQeR8vKnjSQ2YnSXlIWP7ojvWHjTSAq6lwC6j6yRv+5A fgL02SA2CFn+bBoa0xw+6XXBHFwwL7pMbhJnK6VjfbjqjvMk725UD2MMk5VDxWoAxSZ/wBMuQ58 z3Q== X-Google-Smtp-Source: AGHT+IHb6Pob0RnzAsX8FWpDqjAq//jUk95+MjE8SUzHZSw5Ul/QjwJdU/K/3I6CZ3fbKv7PWJECBQ== X-Received: by 2002:a05:600c:310b:b0:426:627d:5542 with SMTP id 5b1f17b1804b1-42bb01e6c05mr33107385e9.28.1724961426361; Thu, 29 Aug 2024 12:57:06 -0700 (PDT) Received: from chenghaoyang-germany.c.googlers.com.com (161.126.77.34.bc.googleusercontent.com. [34.77.126.161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ba7b4271fsm54602805e9.29.2024.08.29.12.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 12:57:05 -0700 (PDT) From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v10 0/7] Add VirtualPipelineHandler Date: Thu, 29 Aug 2024 19:47:39 +0000 Message-ID: <20240829195703.1456614-1-chenghaoyang@chromium.org> X-Mailer: git-send-email 2.46.0.469.g59c65b2a67-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/1260567 I failed to pass multi_stream_test when trying to enable multiple streams though. Please give me some hints what it tests and what I missed: ``` [295:43:43.910237144] [1441841] INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/usr/local/google/home/chenghaoyang/Workspace/libca mera/build/src/ipa' to the IPA search path [295:43:43.914030564] [1441841] INFO Camera camera_manager.cpp:325 libcamera v0.3.1+79-8ca4f033-dirty (2024-08-29T19:18:51UTC) [295:43:43.915493754] [1441844] ERROR DmaBufAllocator dma_buf_allocator.cpp:120 Could not open any dma-buf provider [295:43:43.919118835] [1441841] INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/usr/local/google/home/chenghaoyang/Workspace/libca mera/build/src/ipa' to the IPA search path [295:43:43.922245825] [1441841] INFO Camera camera_manager.cpp:325 libcamera v0.3.1+79-8ca4f033-dirty (2024-08-29T19:18:51UTC) [295:43:43.922820175] [1441846] ERROR DmaBufAllocator dma_buf_allocator.cpp:120 Could not open any dma-buf provider Unable to set the pipeline to the playing state. ``` Gitlab pipeline failure: https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1260412 Update 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. Update in v9: Allocate contiguous memory for planes in the same FrameBuffer. BR, Harvey Harvey Yang (4): libcamera: add DmaBufAllocator::exportBuffers() libcamera: Remove PipelineHandler Fatal check of non-empty MediaDevices libcamera: virtual: Add VirtualPipelineHandler libcamera: software_isp: Refactor SoftwareIsp to use DmaBufAllocator::exportBuffers Konami Shu (3): libcamera: pipeline: Add test pattern for VirtualPipelineHandler libcamera: virtual: Read config and register cameras based on the config libcamera: virtual: Add ImageFrameGenerator .../libcamera/internal/dma_buf_allocator.h | 12 + meson.build | 1 + meson_options.txt | 3 +- src/android/meson.build | 19 -- src/libcamera/dma_buf_allocator.cpp | 55 +++ src/libcamera/pipeline/virtual/README.md | 50 +++ .../pipeline/virtual/data/virtual.yaml | 37 ++ .../pipeline/virtual/frame_generator.h | 28 ++ .../virtual/image_frame_generator.cpp | 179 ++++++++++ .../pipeline/virtual/image_frame_generator.h | 54 +++ src/libcamera/pipeline/virtual/meson.build | 13 + src/libcamera/pipeline/virtual/parser.cpp | 251 ++++++++++++++ src/libcamera/pipeline/virtual/parser.h | 44 +++ .../virtual/test_pattern_generator.cpp | 140 ++++++++ .../pipeline/virtual/test_pattern_generator.h | 57 ++++ src/libcamera/pipeline/virtual/utils.h | 17 + src/libcamera/pipeline/virtual/virtual.cpp | 317 ++++++++++++++++++ src/libcamera/pipeline/virtual/virtual.h | 107 ++++++ src/libcamera/pipeline_handler.cpp | 11 +- src/libcamera/software_isp/software_isp.cpp | 20 +- src/meson.build | 19 ++ 21 files changed, 1392 insertions(+), 42 deletions(-) create mode 100644 src/libcamera/pipeline/virtual/README.md 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/parser.cpp create mode 100644 src/libcamera/pipeline/virtual/parser.h 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/utils.h create mode 100644 src/libcamera/pipeline/virtual/virtual.cpp create mode 100644 src/libcamera/pipeline/virtual/virtual.h