From patchwork Fri Jul 26 09:54:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 20701 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 43A6EBDC71 for ; Fri, 26 Jul 2024 09:56:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1ADD263370; Fri, 26 Jul 2024 11:56:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="adnqk1du"; dkim-atps=neutral Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7104F61994 for ; Fri, 26 Jul 2024 11:56:32 +0200 (CEST) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1fda7fa60a9so4597645ad.3 for ; Fri, 26 Jul 2024 02:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1721987790; x=1722592590; 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=wokjK785qNZxzNoDOtZKz0cjbe+UjyEBlgqLIYnUj54=; b=adnqk1du5qa990zZq9lmn8LSD7lHXFPPoz2jEjsIdTVSqJvNaGs1Kie1UIowXzq+F6 w7aML455PqpT+yjpxdeR6H5m0lo95AFzVLtVWPKCF1zkAKHQq2kLOV3wtS/GJNmpp6y7 DT7jQWH6ilcsbC76uw4WUm4YjeizC4p5QcgL8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721987790; x=1722592590; 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=wokjK785qNZxzNoDOtZKz0cjbe+UjyEBlgqLIYnUj54=; b=czf8i7GdrBkScGInJlJXMsp1SfbAEyz1t1Qt8C27N4EMLHXIAKmoY1E7Dl1a8mqu6d i1sTDljNxn9ENzDU94enFwFC+BOp7pQ02ssj1mO7rSZNDKBFvhokLfQF1IvcScONyGuL 9YFB+N43AyPu1DMp0gNnuPYzN1Md2zdJPh4YoO1mGdUqrEq9g9KbHLObK6HHXSVidlaQ FVfhuedpQvNvnzdCVpnTO3+QELKFNGAW3EGpTXIXG3pi4+79L8u80ia5QrJlRofvj7uV QeuT/dsAZK7lIYFQs2Co6Iz9TlgFIND1xUSN6L/nE9kGtsntVCY3PV4tLC66j5BTPSmS 2anA== X-Gm-Message-State: AOJu0Ywjfi6D54Z9VInr2PsxWEXiOVOvLR6+zjsyfDz1PlDW4TJbu57c iTmQS6G1As6vIX+ZP0SM7rJeDyq+1gPwrUXvMgWDma7k2wgA7exde7CnLGmalWLoU/mzwXa/Btf F6g== X-Google-Smtp-Source: AGHT+IHueehMlNiT8p6pSTYijJOZ0LZAxm8g8bB5jPPPgWxnAttyV4Iluf3yOeKgNYI99yemWDEnyA== X-Received: by 2002:a17:902:ced2:b0:1f9:fb48:7cf9 with SMTP id d9443c01a7336-1fed92d4bb0mr51291615ad.63.1721987790490; Fri, 26 Jul 2024 02:56:30 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (148.175.199.104.bc.googleusercontent.com. [104.199.175.148]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fed7c7f63asm28396665ad.46.2024.07.26.02.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jul 2024 02:56:30 -0700 (PDT) From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH v6 0/7] Add VirtualPipelineHandler Date: Fri, 26 Jul 2024 09:54:21 +0000 Message-ID: <20240726095626.3632402-1-chenghaoyang@chromium.org> X-Mailer: git-send-email 2.46.0.rc1.232.g9752f9e123-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 folks, Sorry for the super late update. It's been a while since the last series of patches, as we were busy with mtkisp7's bringup & migration. Thanks to Hans de Goede's work on DmaBufAllocator, the prerequisites of VirtualPipelineHandler are almost landed. Only a helper function added in the first patch. Konami, our intern in 2023, helped to add test patterns and real image loading into VirtualPipelineHandler. I tried to address the previous comments, while it's very likely that I left some behind. Please leave the comments again if I do. Many thanks! BR, Harvey Harvey Yang (3): Add a helper function exportFrameBuffers in DmaBufAllocator to make it easier to use. The Fatal check of having at least one MediaDevice was to prevent pipeline handler implementations searching and owning media devices with custom conventions, instead of using the base function |acquireMediaDevice|. It also has the assumption that there's at least one media device to make a camera work. libcamera: pipeline: Add VirtualPipelineHandler Konami Shu (4): libcamera: pipeline: Add test pattern for VirtualPipelineHandler libcamera: pipeline: Read config and register cameras based on the config libcamera: pipeline: Shift test pattern by 1 pixel left every frame libcamera: pipeline: Load images .../libcamera/internal/dma_buf_allocator.h | 10 + meson.build | 1 + meson_options.txt | 3 +- src/libcamera/dma_buf_allocator.cpp | 57 +++- src/libcamera/pipeline/virtual/README.md | 76 +++++ .../pipeline/virtual/common_functions.cpp | 27 ++ .../pipeline/virtual/common_functions.h | 18 ++ .../pipeline/virtual/data/virtual.yaml | 51 ++++ .../pipeline/virtual/frame_generator.h | 33 +++ .../virtual/image_frame_generator.cpp | 154 ++++++++++ .../pipeline/virtual/image_frame_generator.h | 65 ++++ src/libcamera/pipeline/virtual/meson.build | 32 ++ src/libcamera/pipeline/virtual/parser.cpp | 243 +++++++++++++++ src/libcamera/pipeline/virtual/parser.h | 48 +++ .../virtual/test_pattern_generator.cpp | 148 ++++++++++ .../pipeline/virtual/test_pattern_generator.h | 58 ++++ src/libcamera/pipeline/virtual/virtual.cpp | 279 ++++++++++++++++++ src/libcamera/pipeline/virtual/virtual.h | 96 ++++++ src/libcamera/pipeline_handler.cpp | 11 +- 19 files changed, 1404 insertions(+), 6 deletions(-) create mode 100644 src/libcamera/pipeline/virtual/README.md create mode 100644 src/libcamera/pipeline/virtual/common_functions.cpp create mode 100644 src/libcamera/pipeline/virtual/common_functions.h 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