From patchwork Thu Jan 5 04:37:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 18086 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 15972C322E for ; Thu, 5 Jan 2023 04:37:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2924F625E2; Thu, 5 Jan 2023 05:37:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1672893477; bh=eOsGIBGA5yWBV/rQo6j3HNMQ6vngqeh5zkWczmiKopo=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=CvdIX08lzhWWY62Fnvr2jGjIX0DFgyoFDdnPfGNH15o4dCG3f2ThXa/gdBjs7iRz9 5W/G0gec/5LefZ4aESVNa1LYbqfvJTWlisyc5JeXb0+7LzyNFCHV5nsHLTXftEioXV wb6VkRqsahAFOk0GhaC0EaQKKSWCGR1Kh87d2fvNuBegRodoWN9dCbaFO++ZJYGENl 75txV+4YLU+Mmnm/igioBgJNGmiOQT2FLQEIb2MzwKMMXky5ZQUh7Fm24WUKCHVbFx Arn4iEPAxvD3r/p3MVHQd8yzbWHMyg/bUpQNpNgOqSWOyZw7ZYzdcWvUm3+QuJNImW mQwxFhZKhVTpQ== Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AE0FC61F06 for ; Thu, 5 Jan 2023 05:37:54 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="SFxCKC9R"; dkim-atps=neutral Received: by mail-pj1-x1036.google.com with SMTP id c2-20020a17090a020200b00226c762ed23so861505pjc.5 for ; Wed, 04 Jan 2023 20:37:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=d+HFpDIj3GJ2jHBx7kTFn5tUrtkiLq1/ccdiiSt6p/M=; b=SFxCKC9RmeLZwPyM+Yhq57l/PtTyDM0fxyk4eXSpNH0CH94ywv0wrMzvrb739i2y+P 111c2YxXvP8i1uSrnJqHucb8T3naDJYZ37YRnyP8AISgaqqeMJhXFGqYsf02TjD/X4Xz vGrk1Oh/TbPdjG4Y8PZ1cF7v5+D+RCzN9f7ZU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=d+HFpDIj3GJ2jHBx7kTFn5tUrtkiLq1/ccdiiSt6p/M=; b=Kho32Jqc568hx0tkA176VWJzf7jq7F7TtMN0aLQWGeglWa4/FzXkjcB04FPtAuPOPw kFNCStqj2awVo8/z93UZl91ltVpBF+U7SEz9A8ktlZFtgvLiVBUzMHXSgzDqefqpsXPO VP/lhNHboXG7EDAb01Q+XzS8ie2Ja39TBCSusLBgx+xDWr2HiaelMcJnxsu48WHyh9Io U1DMh08Di454NehZM+pX6PTAovqXG6L08gOir1Afnr6uw2BxpjpkePZJ5Eg/TmltcwPY iEusnunKrXMDuuHsSHXnoOhI515nYBwuaFzDF8N52EMMAJEC1IfamrTDLFEwxn6DqR+Z N0og== X-Gm-Message-State: AFqh2kpDFUtEi45SH4wVMjyVybUaGEHmgZNLHdwiB06wJLQVttgv48vW eJ06MKzqfGY7p4fZB1uU9L0Lrrx4+ujm47OQ X-Google-Smtp-Source: AMrXdXvj56b331r2YKzfp7TjkJ5xVnHTK/qkmwncCEXn0s0xAGQl6moqz0Y10sqrUCQZWki9wBWNqg== X-Received: by 2002:a05:6a20:438d:b0:b2:18da:1515 with SMTP id i13-20020a056a20438d00b000b218da1515mr65169763pzl.20.1672893472827; Wed, 04 Jan 2023 20:37:52 -0800 (PST) Received: from chenghaoyang-low.c.googlers.com.com (46.165.189.35.bc.googleusercontent.com. [35.189.165.46]) by smtp.gmail.com with ESMTPSA id x23-20020a170902b41700b00188c5f0f9e9sm25015200plr.199.2023.01.04.20.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 20:37:52 -0800 (PST) X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Date: Thu, 5 Jan 2023 04:37:17 +0000 Message-Id: <20230105043726.679968-1-chenghaoyang@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 0/9] Virtual pipeline handler 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: , X-Patchwork-Original-From: Harvey Yang via libcamera-devel From: Harvey Yang Reply-To: Harvey Yang Cc: Harvey Yang Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi all, This is the third version of POC patches of the virtual/fake pipeline handler. Thanks to Kieran's comments, I split the patches and added a base class MediaDeviceBase. Still need to work on the buffer allocation, virtual config file, and virtual video for testing. Please take a look and let me know if the design makes sense. BR, Harvey Harvey Yang (9): libcamera: pipeline: Introduce skeleton Virtual Pipeline libcamera: Add MediaDeviceBase libcamera: Use MediaDeviceBase in base classes libcamera: Add MediaDeviceVirtual libcamera: pipeline: virtual: Add MediaDeviceVirtual libcamera: pipeline: virtual: Create a Camera libcamera: pipeline: virtual: Generate and validate StreamConfigurations libcamera: pipeline: virtual: Queue requests libcamera: pipeline: virtual: Set camera properties & controls .../libcamera/internal/device_enumerator.h | 12 +- .../internal/device_enumerator_sysfs.h | 4 +- .../internal/device_enumerator_udev.h | 8 +- include/libcamera/internal/media_device.h | 35 +- .../libcamera/internal/media_device_base.h | 68 ++++ .../libcamera/internal/media_device_virtual.h | 21 ++ include/libcamera/internal/meson.build | 2 + include/libcamera/internal/pipeline_handler.h | 12 +- meson_options.txt | 2 +- src/libcamera/device_enumerator.cpp | 30 +- src/libcamera/device_enumerator_sysfs.cpp | 4 +- src/libcamera/device_enumerator_udev.cpp | 4 +- src/libcamera/media_device.cpp | 97 +----- src/libcamera/media_device_base.cpp | 140 ++++++++ src/libcamera/media_device_virtual.cpp | 22 ++ src/libcamera/meson.build | 2 + src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 2 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 +- .../pipeline/raspberrypi/raspberrypi.cpp | 4 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +- src/libcamera/pipeline/simple/simple.cpp | 4 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 +- src/libcamera/pipeline/vimc/vimc.cpp | 2 +- src/libcamera/pipeline/virtual/meson.build | 5 + src/libcamera/pipeline/virtual/virtual.cpp | 301 ++++++++++++++++++ src/libcamera/pipeline_handler.cpp | 18 +- 26 files changed, 629 insertions(+), 178 deletions(-) create mode 100644 include/libcamera/internal/media_device_base.h create mode 100644 include/libcamera/internal/media_device_virtual.h create mode 100644 src/libcamera/media_device_base.cpp create mode 100644 src/libcamera/media_device_virtual.cpp create mode 100644 src/libcamera/pipeline/virtual/meson.build create mode 100644 src/libcamera/pipeline/virtual/virtual.cpp