From patchwork Thu Sep 26 16:29:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 21384 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 E8026C3257 for ; Thu, 26 Sep 2024 16:31:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A50AE63510; Thu, 26 Sep 2024 18:31:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cSz91TH2"; dkim-atps=neutral Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3D938634F9 for ; Thu, 26 Sep 2024 18:31:47 +0200 (CEST) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-20b0b2528d8so12749585ad.2 for ; Thu, 26 Sep 2024 09:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727368305; x=1727973105; 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=b9E8L7k0+piJZbnzLkbPrZ5rHkTsO9DE/9/0puAqjhI=; b=cSz91TH231rZVLrfS5K4IbNfNCIzmghpABXTCc9Bhxcv1vseTu/Jd2ltKawHZU656s IXlz6u/hU2VbrMCbBXmqmZ87krz3988FvoW5AleQ3zIkNTX61RTVtfx/VpdTjezPP2Uq JWeAEA81TtECFTk5ehxae6WzSu2Kt9hml8Eqc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727368305; x=1727973105; 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=b9E8L7k0+piJZbnzLkbPrZ5rHkTsO9DE/9/0puAqjhI=; b=vPf2XMFEb9315TjvL9acjI11oa1xhL1ibYRGwMGnCSRr2YrmwFkp71aannzalMAk6m q7gGjwia3sM1HRJ5M7kHfAf38mC6g+drub0G3YoTfjQyNS3IiGJXd2B2bD9YFUfn+S3V xtM1iNovlz0yRActOjjpiH9m6cCLJ6TSvRvopzWGl813u15BeFDO88bZbJM2C8otqua7 mUQ8h5hcXOSUT7UN3tql/P6cSNKYzHZ6q/xU7A2r+R4AqHxDKpb/NaIesqdNSlN6zdSw ljvLvfWw7ZYiZ/QpPIvrymvKaOwgSahSNUsAXonr8ugjsmbPguG/bLeTQxmcFx8+jooo HfAA== X-Gm-Message-State: AOJu0YyrcyKCPCrwrpE7A65MfNAXHoLpbKw9UufBu5xwkWrpSI7TYKIs mv7LzVDzeglPyfJD+ZThYtGG8LfGhevyyfU1rR4f5qEHgp0LNve8GlApInIRAH65tQ7nHfRqMt4 = X-Google-Smtp-Source: AGHT+IG2KOIN9beGb+BvkUX7lYKR6z2ZwLBtgriU/W6XpzH599EjmPUWC9cXD654bsVQocikVLS1AA== X-Received: by 2002:a17:902:d2ce:b0:206:a239:de67 with SMTP id d9443c01a7336-20b367e7025mr4885545ad.18.1727368305160; Thu, 26 Sep 2024 09:31:45 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (208.158.221.35.bc.googleusercontent.com. [35.221.158.208]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e20dffsm469035ad.170.2024.09.26.09.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2024 09:31:44 -0700 (PDT) From: Harvey Yang X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v13 0/7] Add VirtualPipelineHandler Date: Thu, 26 Sep 2024 16:29:49 +0000 Message-ID: <20240926163141.1593026-1-chenghaoyang@google.com> X-Mailer: git-send-email 2.46.1.824.gd892dcdcdd-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" Harvey Yang New message Tue, Sep 10, 12:48 PM to libcamera-devel, me 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/1278799 I've also checked that it works on qcam. 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 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 (6): libcamera: add DmaBufAllocator::exportBuffers() libcamera: Remove PipelineHandler Fatal check of non-empty MediaDevices libcamera: virtual: Add 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 Konami Shu (1): libcamera: pipeline: Add test pattern for VirtualPipelineHandler .../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 | 48 +++ .../pipeline/virtual/data/virtual.yaml | 36 ++ .../pipeline/virtual/frame_generator.h | 29 ++ .../virtual/image_frame_generator.cpp | 175 ++++++++ .../pipeline/virtual/image_frame_generator.h | 51 +++ src/libcamera/pipeline/virtual/meson.build | 13 + src/libcamera/pipeline/virtual/parser.cpp | 243 +++++++++++ src/libcamera/pipeline/virtual/parser.h | 39 ++ .../virtual/test_pattern_generator.cpp | 137 +++++++ .../pipeline/virtual/test_pattern_generator.h | 53 +++ src/libcamera/pipeline/virtual/virtual.cpp | 382 ++++++++++++++++++ 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, 1368 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/virtual.cpp create mode 100644 src/libcamera/pipeline/virtual/virtual.h