From patchwork Tue Sep 10 04:40:13 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: 21206 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 D63ABC324C for ; Tue, 10 Sep 2024 04:48:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 413C5634FA; Tue, 10 Sep 2024 06:48:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="k6pqI2GV"; dkim-atps=neutral Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7482E618F2 for ; Tue, 10 Sep 2024 06:48:41 +0200 (CEST) Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-718e5edf270so2004860b3a.1 for ; Mon, 09 Sep 2024 21:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1725943719; x=1726548519; 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=Oyf/EcYlUEWOIgQGxM5kcq423hpKGOFVAdkOZkmOGoc=; b=k6pqI2GVDCTKETt0Km75XcRvBZW8C44HZFOB7bs9oI23BCVaSUH9qRcCarv32/mMrg 9SiTN03L46+aVjtN+vZQdn1QPgN9h0Vgz/7RmsqXOQskLTiuhXomeiZgbK+tL5hCUIjZ AHREKMXrM5BpVXvUjsYV2YQF51qjYKgZtIBWk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725943719; x=1726548519; 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=Oyf/EcYlUEWOIgQGxM5kcq423hpKGOFVAdkOZkmOGoc=; b=XpnE6kmWZHd9epVwt/0IfDXPPRw5l2za7Fk9d1MbfZtN+RwLn1/4d9dIA3n2qIFcPz 3MDOp/Kzdv2KTWlDsm+NC+VORATIVVLpqHaUt6XtNTnB8/IlDHo1+rz+hWISyddWMyVS T+8+1zqcLbVWZhnqM7H6OLZZd1Rn+ROQZHTJjC+u9cx37Fx0Ojefg1hB6HrtQLHDIQd9 Y9PwwuMUJTTE9CSiw+PoEINjrHHcAWsSx6HjZo2PhJ5toITvgiBnDsSaRfex1tvzsGZ3 BZhjOWfnJciOeGBtXxbZTmQ1UTttlevAU9YkQXAX0D70voSjmyL9CbdzaIw9rziyh1Wr yShw== X-Gm-Message-State: AOJu0YyIlVDdRBuTCpdSD4dLAuz0c1bsIVxlWWcLekjDwXLzS1kKgTrk /h22G9kggQP4V/Fib7k3afxCUOBfv7UZRQZiAJszevNZ4e83erKH2X+TzB422+8vI2IAuPQaPbg = X-Google-Smtp-Source: AGHT+IF93xr/4Pp9uEW8Lir1Sf4I2WCRxoEg7Gi8veNQVM0x2dh07gqOzJ4mt9F4HqE2eWOYMU0EDw== X-Received: by 2002:a05:6a00:919c:b0:718:532f:5a3 with SMTP id d2e1a72fcca58-718d5e17b17mr15848239b3a.7.1725943718978; Mon, 09 Sep 2024 21:48:38 -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 d2e1a72fcca58-71909092522sm530734b3a.111.2024.09.09.21.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 21:48:38 -0700 (PDT) From: Harvey Yang X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v12 0/7] Add VirtualPipelineHandler Date: Tue, 10 Sep 2024 04:40:13 +0000 Message-ID: <20240910044834.2477701-1-chenghaoyang@google.com> X-Mailer: git-send-email 2.46.0.598.g6f2099f65c-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/1268044 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 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 | 58 +++ 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 | 241 ++++++++++++ src/libcamera/pipeline/virtual/parser.h | 39 ++ .../virtual/test_pattern_generator.cpp | 135 +++++++ .../pipeline/virtual/test_pattern_generator.h | 53 +++ src/libcamera/pipeline/virtual/virtual.cpp | 371 ++++++++++++++++++ src/libcamera/pipeline/virtual/virtual.h | 60 +++ src/libcamera/pipeline_handler.cpp | 11 +- src/libcamera/software_isp/software_isp.cpp | 20 +- src/meson.build | 19 + 20 files changed, 1353 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