From patchwork Mon Sep 30 06:29:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 21414 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 8BF11C0F1B for ; Mon, 30 Sep 2024 06:33:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9255E63515; Mon, 30 Sep 2024 08:33:51 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="VigbRXi/"; dkim-atps=neutral Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B958C62C92 for ; Mon, 30 Sep 2024 08:33:49 +0200 (CEST) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-71c63a43146so1529772b3a.3 for ; Sun, 29 Sep 2024 23:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727678027; x=1728282827; 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=BRFciN5MTGCPfB2m9Ji2X4HzUrjkq5yv8a3rb4YGPmE=; b=VigbRXi/uDvCW8XAzEW2sxtvzBmGQ5dk3FVUIvXlTUfj9mwV0sYUplBfQZdyIUXC3g 1kaS3npWwHHags1gY2aP7PjYBcG+d3y/AcFQAjMnR7PK/4x8O1frL1Kt9S4mniAZ3U14 Pmm4t6OWRGXxFNI5OjD9EeisBNqxG3zl38wKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727678027; x=1728282827; 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=BRFciN5MTGCPfB2m9Ji2X4HzUrjkq5yv8a3rb4YGPmE=; b=IF2JhW/sBoUSfMZfB6XPSVHj8uDfKCe00zm+Z4o7Gt7DZci7ecuywJIN3I+ogMsxIw qsfiMTU8+s/kVCk7ZXJoCSjgLiPPZbaFbxNQv/8z4xhNAY/vPuSBoiRnqG4gezdgPkVe HQrrVjcS08OJfzMtKE8ddN6m6CiM7v51r8HAKUXUrqIxlte/+WG5CpnyqGdu0mnkCDag GNt/6IFrd4iphtoAQtthGt06VSvKKZUkTsFEBZOJQLFX9eWVivmKi+Q8aXRb+S588MZ9 KqCKkFNaLKAnhaHN2eXgkwBP85r7dUVHhFpFK/CFoAuXCWDiTp5Wik8IYiUVrDrcc3DK K1Dg== X-Gm-Message-State: AOJu0YzemWiGs9iYAvyEr9wP6IUE76ePXzsBK9B0HJnc916/Gwb+pqB9 BINELSns2U0F8ORUGw7jPFzEmqCoHm5Brar3EiBFuQTbl5Qq+eSCBCBZ/FE/iTjOoGFTIvGKoGM = X-Google-Smtp-Source: AGHT+IHN9G4pQO8b3Sl+KGm9MU+ar7MSjBO89HoSvqfGNYWHcQJRlfdpQ4YR5XbSsZ6o6gtpsDwXkQ== X-Received: by 2002:a05:6a21:3416:b0:1d5:119d:6299 with SMTP id adf61e73a8af0-1d5119d636emr7107319637.28.1727678027544; Sun, 29 Sep 2024 23:33:47 -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 d2e1a72fcca58-71b265166e2sm5487671b3a.131.2024.09.29.23.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 23:33:47 -0700 (PDT) From: Harvey Yang X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v14 0/7] Add VirtualPipelineHandler Date: Mon, 30 Sep 2024 06:29:41 +0000 Message-ID: <20240930063342.3014837-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" 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/1280687 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 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 (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 | 169 ++++++++ .../pipeline/virtual/image_frame_generator.h | 50 +++ src/libcamera/pipeline/virtual/meson.build | 13 + src/libcamera/pipeline/virtual/parser.cpp | 260 ++++++++++++ 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, 1378 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