From patchwork Sat Sep 7 14:28:25 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: 21192 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 04515C324C for ; Sat, 7 Sep 2024 14:31:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DAF7B634EE; Sat, 7 Sep 2024 16:31:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="MRoeZC3J"; 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 82705633CC for ; Sat, 7 Sep 2024 16:31:18 +0200 (CEST) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2021c08b95cso31058815ad.0 for ; Sat, 07 Sep 2024 07:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1725719476; x=1726324276; 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=i3YBnRM/v+P6Z6SJXMrgKt7eUs8bn02LJfFaP/2hlAU=; b=MRoeZC3JNvguSJEuD/kQIoilsmLxURHShiGqxpHya1DviqnTd7p2p8BGs4fCCm/BrH efP/fCKNXLxA5jvyvZLK5qe54Id30AqIFE/llw7ykEfDTcZBIVEZwzmCLWJilhP9XEJP TxXPfxqW2BTSPHq3Hi8XVtNV3nlNqWdAKuDTg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725719476; x=1726324276; 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=i3YBnRM/v+P6Z6SJXMrgKt7eUs8bn02LJfFaP/2hlAU=; b=TccMHEpkSxWy/vonaqsv5kob72TIcKBigggOdge4wD1scgkZVG/Hnaoy9UIvzVshm0 E1bUGo0ie4If+/h/JtKK3oTD2TneNXdg8tiqoPs7IbI2mlWnBvzyN02UoICyJ2cPgxpl N8pkzZcv0+t/kIk9ja52XhP6D/k6/ad+oD3wTAkE83xzwgOQmJMJlu8n6TZaUPVdFHtC 1OWc6K6kiaOH/zYonX87ppH3ZEUuQu2hO63zWRAki3W6ExTO3J2CZlGKnc765W0p2g+h vaHkYEX5+e+iRSORNVDDPq3fWu9F5AAK/8rfvxY09/CFSC6rToTGHa2jenbRDhCeyG7w puOA== X-Gm-Message-State: AOJu0YxQemrGLGhv7H2N4GzkZ1nlIY+7b2urr0t/1QDJSZMQAl1+hfWB 7UHJ0r9CCFW7eGRG30EkQRA7HAYj73Zy0FEw/kf65GOutwsP0tsuNWV3sxeEfJRJqI+i0RAvscI = X-Google-Smtp-Source: AGHT+IFFt50+vdr0G2fprVRhMz2as00BmB8m6svSJx8ig3laqD3v7Q9f0ivIWWI4CyY/Y56D6NYcrQ== X-Received: by 2002:a17:902:d501:b0:205:76c1:3742 with SMTP id d9443c01a7336-206ee92559dmr85126165ad.3.1725719476268; Sat, 07 Sep 2024 07:31:16 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (0.223.81.34.bc.googleusercontent.com. [34.81.223.0]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710e33974sm9208935ad.104.2024.09.07.07.31.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2024 07:31:15 -0700 (PDT) From: Harvey Yang X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v11 0/7] Add VirtualPipelineHandler Date: Sat, 7 Sep 2024 14:28:25 +0000 Message-ID: <20240907143110.2210711-1-chenghaoyang@google.com> 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/1266568 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 v11: - Allowed a single value in the config file's frame_rates field. 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 | 13 + 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 | 36 ++ .../pipeline/virtual/frame_generator.h | 28 ++ .../virtual/image_frame_generator.cpp | 178 ++++++++++ .../pipeline/virtual/image_frame_generator.h | 54 +++ src/libcamera/pipeline/virtual/meson.build | 13 + src/libcamera/pipeline/virtual/parser.cpp | 257 ++++++++++++++ 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 | 323 ++++++++++++++++++ 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, 1403 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