From patchwork Mon Jan 31 22:33:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15306 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 32CFABF415 for ; Mon, 31 Jan 2022 22:33:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DB24F609E2; Mon, 31 Jan 2022 23:33:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fEO6xrvb"; dkim-atps=neutral Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DE54F609AF for ; Mon, 31 Jan 2022 23:33:42 +0100 (CET) Received: by mail-wr1-x432.google.com with SMTP id s18so28228913wrv.7 for ; Mon, 31 Jan 2022 14:33:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kR6FDelfycjqbXUHFAs0pKqRKAejjwQRsAXvRMXiUww=; b=fEO6xrvbdTIvnUbUOllWymRbVOlf6+EuK4cR+Jhct/ufygPXuQ/eMfqOQ0oRFRNLuA SJCaSTSc67lzjZ8BAKSCD2CvaZv6fes4+dtQkEiD6Yslv65Clb274PDs9HwcAFvJN4gi Aza6PAKegWdWn3d2y5jSscRxxkDCnb2qu/jr+WuZx0rOfgTo3oP9O/tfsqk/yaMLmuPj EXCmHP2UbGjkqZr1s48LK8MFFe9te+vFyKH4GMscrR+r7nRbUhaLjiFheJfHv64rlnqF nsKxufFze+9SI4TjhjXiE8bGp8YjEu1FpgGrz/72ekbyNZ9qW0A8bfej39v3wvQoXZiL etew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kR6FDelfycjqbXUHFAs0pKqRKAejjwQRsAXvRMXiUww=; b=8CemlZgKqRERhhLG6BmqYXlG0/EKby+FgepKC07Qp2VpWRMKGuaII7kyjg4IDakJdh ypUM2lIPAk3i2EoxOjFGS8ZT0mw8s/k+2e7QIEmXYOVj1N5GvG6n6xgHRw8GvuJV3QAf fwS/yRYnwoKyVLejb82Rc2TqnMIdp4SH58pLAYnSITRe8PaMGAUg9K9tG7v/IIgDDyJS Gx8+RxoWDyKDAVvFMom1DcyS80MUXH51uuoHigmX8yuiRzcSuM5+jMsHwRtpc/guzgN8 MrV0LGWuRdnnM4EhCSQFooiOkSXm+Bdd1+AD7Sm6w6NyG6Gr7n+vKlyP3cE+edqEG/13 p7zw== X-Gm-Message-State: AOAM532jXYJD2trqhh98z0RXot23HBU2ZdtKSmhmyNUEO27e3G4hjF/i YKh2WWJHofvpldc3y3uy4SUN434Lq+c= X-Google-Smtp-Source: ABdhPJw1p0fAA/X0+wFMXPyKDkbVkysUM8xeqZLFM8eyiWfDdNVr/fq50SeiIxbZ4XGXpAQmFguW0w== X-Received: by 2002:a5d:6e12:: with SMTP id h18mr19269583wrz.674.1643668422705; Mon, 31 Jan 2022 14:33:42 -0800 (PST) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id q2sm6986740wrw.14.2022.01.31.14.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 14:33:42 -0800 (PST) From: Daniel Scally To: libcamera-devel@lists.libcamera.org Date: Mon, 31 Jan 2022 22:33:22 +0000 Message-Id: <20220131223330.61563-2-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220131223330.61563-1-djrscally@gmail.com> References: <20220131223330.61563-1-djrscally@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 1/9] libcamera: Add members to MediaEntity to support ancillary entities 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" With kernel support for ancillary links, we can describe the relationship between two devices represented individually as instances of MediaEntity. As the only property of that relationship is its existence, describe those relationships in libcamera simply as a vector of MediaEntity pointers to the ancillary devices. Reviewed-by: Laurent Pinchart Signed-off-by: Daniel Scally --- Changes in v4: - Reordered addAncillaryEntity() in the .cpp to match the .h Changes in v3: - Fixed some style issues - Made addAncillaryEntity() private include/libcamera/internal/media_object.h | 4 ++++ src/libcamera/media_object.cpp | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h index 90c63598..b1572968 100644 --- a/include/libcamera/internal/media_object.h +++ b/include/libcamera/internal/media_object.h @@ -104,6 +104,7 @@ public: unsigned int deviceMinor() const { return minor_; } const std::vector &pads() const { return pads_; } + const std::vector ancillaryEntities() const { return ancillaryEntities_; } const MediaPad *getPadByIndex(unsigned int index) const; const MediaPad *getPadById(unsigned int id) const; @@ -120,6 +121,8 @@ private: void addPad(MediaPad *pad); + void addAncillaryEntity(MediaEntity *ancillaryEntity); + std::string name_; unsigned int function_; unsigned int flags_; @@ -129,6 +132,7 @@ private: unsigned int minor_; std::vector pads_; + std::vector ancillaryEntities_; }; } /* namespace libcamera */ diff --git a/src/libcamera/media_object.cpp b/src/libcamera/media_object.cpp index f425d044..c78f4758 100644 --- a/src/libcamera/media_object.cpp +++ b/src/libcamera/media_object.cpp @@ -423,4 +423,19 @@ void MediaEntity::addPad(MediaPad *pad) pads_.push_back(pad); } +/** + * \brief Add a MediaEntity to the list of ancillary entities + * \param[in] ancillaryEntity The instance of MediaEntity to add + */ +void MediaEntity::addAncillaryEntity(MediaEntity *ancillaryEntity) +{ + ancillaryEntities_.push_back(ancillaryEntity); +} + +/** + * \fn MediaEntity::ancillaryEntities() + * \brief Retrieve all ancillary entities of the entity + * \return The list of the entity's ancillary entities + */ + } /* namespace libcamera */