From patchwork Thu Jan 5 04:37:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-Hao Yang X-Patchwork-Id: 18090 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 C8E0EC322E for ; Thu, 5 Jan 2023 04:38:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6B54D625EC; Thu, 5 Jan 2023 05:38:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1672893483; bh=GuNBnM8YIli9LjDmGBD2BKFpxdW99EHNF6km73MzBEI=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=u1/es4ChIgZtCt9EpCE3YapZIRfEMY8Yne92OQBPvV9P+HjMC+dAFo6njLQuEWhl6 P5O1vYaLdRhFVCQaKhmqsae9Y43TH7csvUPkaSmS/1yYnt38TpwZWongig3vPuLS5J 8aJ8a+EI6JPwPFzrFJ8FSez+QxoD30/SvfI3GOIxMd1L3lvQ45cBtSrYjhOeZDLQT5 Y89K4h8viLNiuz+/M97badTCIVyifxj3unMsTM/swrSZra30fDBs64ZefI7YP6bcDr HilVM6u+an8tox90fRtCMIprx5u8F/tBySy7oAl0EEN3yErFLY6dwU+23GPUcMeqDh eIOAx1p82Onzg== Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C001625E6 for ; Thu, 5 Jan 2023 05:37:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="FvOQpoWh"; dkim-atps=neutral Received: by mail-pj1-x1031.google.com with SMTP id o8-20020a17090a9f8800b00223de0364beso840675pjp.4 for ; Wed, 04 Jan 2023 20:37:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Mg6Iz7qLMP0weZtSTHRkUsspe/eNv2wxFErm5THQt1M=; b=FvOQpoWhCU7f3uF8oZKbJvOCvKj8kmWkNYAU+pseX/U7h5BdFPgEryZIRkBP13TLQ6 kXnikD+buvsqqQTHdmuw331ZkredczNA7VPO7x8CyYP7kInY27+bU86eDaxrMJv1RuAr IfBFe7vSxoTUQOOTA3gW/35LLv+bfcpuMT7AI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mg6Iz7qLMP0weZtSTHRkUsspe/eNv2wxFErm5THQt1M=; b=jpS69gus/hVdP6LUAPLjUeUZhw3CCVlg2WdzbXAu3i3gfjO5Gpv8hMPdt/C/6XFZpx JlFLNJqgSQbiDy64IHWJwqHuh0hxrbBlkSzXjy9GtBPrBrZsXbBFXgeAlM926ulCYZOn KyHTiXLKcrl9TJWwjLh96OCbZe6Jrm+kW9oFNdgZlbWO41XDrx3K7zhX6wbVa8BcQFNt Bkl+D5eYhSWJp89U3T3kdyMZCsos2BjrOogc+BXC4+9KBo/wzA70QuT+VqKgDsnUhWv7 HJXoujz8kDY9KrPyL+1HPt0rvdpDjm4e2Mn5DKAPL2lt2Cl7rbLhtiBoFE+Mf2YIsO/x P1TQ== X-Gm-Message-State: AFqh2kqRAPQCGV4u2XxYDKqR6u/0XPNN1hbFHhnBcoKxRUKQVadv60sV mJucqrnDQKVly/cCG0a2jvufetzpOo7xoliF X-Google-Smtp-Source: AMrXdXs3lDNnYgemXmBtGBAx681x2UDcEf5dYsJa8qLN76tVCU1ZEaVfCevhedisAvpp/QP3TUpt3g== X-Received: by 2002:a17:902:ccc1:b0:189:5ff5:eb92 with SMTP id z1-20020a170902ccc100b001895ff5eb92mr66563977ple.39.1672893477838; Wed, 04 Jan 2023 20:37:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 20:37:57 -0800 (PST) X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Date: Thu, 5 Jan 2023 04:37:21 +0000 Message-Id: <20230105043726.679968-5-chenghaoyang@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230105043726.679968-1-chenghaoyang@google.com> References: <20230105043726.679968-1-chenghaoyang@google.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/9] libcamera: Add MediaDeviceVirtual 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: Cheng-Hao Yang Reply-To: Harvey Yang Cc: Harvey Yang , Harvey Yang Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a dummy class MediaDeviceVirtual, which will be used in the virtual pipeline handler and unit tests. Signed-off-by: Harvey Yang --- .../libcamera/internal/media_device_virtual.h | 21 ++++++++++++++++++ include/libcamera/internal/meson.build | 1 + src/libcamera/media_device_virtual.cpp | 22 +++++++++++++++++++ src/libcamera/meson.build | 1 + 4 files changed, 45 insertions(+) create mode 100644 include/libcamera/internal/media_device_virtual.h create mode 100644 src/libcamera/media_device_virtual.cpp diff --git a/include/libcamera/internal/media_device_virtual.h b/include/libcamera/internal/media_device_virtual.h new file mode 100644 index 00000000..f1b48b20 --- /dev/null +++ b/include/libcamera/internal/media_device_virtual.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2022, Google Inc. + * + * media_device.h - Media device handler + */ + +#pragma once + +#include "libcamera/internal/media_device_base.h" + +namespace libcamera { + +class MediaDeviceVirtual : public MediaDeviceBase +{ +public: + MediaDeviceVirtual(const std::string &deviceNode); + ~MediaDeviceVirtual(); +}; + +} /* namespace libcamera */ diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 826a241c..9deebd01 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -32,6 +32,7 @@ libcamera_internal_headers = files([ 'mapped_framebuffer.h', 'media_device.h', 'media_device_base.h', + 'media_device_virtual.h', 'media_object.h', 'pipeline_handler.h', 'process.h', diff --git a/src/libcamera/media_device_virtual.cpp b/src/libcamera/media_device_virtual.cpp new file mode 100644 index 00000000..ce06a0da --- /dev/null +++ b/src/libcamera/media_device_virtual.cpp @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2022, Google Inc. + * + * media_device.h - Media device handler + */ + +#include "libcamera/internal/media_device_virtual.h" + +namespace libcamera { + +LOG_DEFINE_CATEGORY(MediaDeviceVirtual) + +MediaDeviceVirtual::MediaDeviceVirtual(const std::string &deviceNode) + : MediaDeviceBase(deviceNode) +{ + driver_ = "virtual"; +} + +MediaDeviceVirtual::~MediaDeviceVirtual() = default; + +} /* namespace libcamera */ diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index ce4c1a29..e0927aee 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -33,6 +33,7 @@ libcamera_sources = files([ 'mapped_framebuffer.cpp', 'media_device.cpp', 'media_device_base.cpp', + 'media_device_virtual.cpp', 'media_object.cpp', 'pipeline_handler.cpp', 'pixel_format.cpp',