From patchwork Thu Mar 3 23:49:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15408 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 B1617BE08A for ; Thu, 3 Mar 2022 23:50:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B8DAE61171; Fri, 4 Mar 2022 00:50:14 +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="QhhSFEjN"; dkim-atps=neutral Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8CE2F601FF for ; Fri, 4 Mar 2022 00:50:12 +0100 (CET) Received: by mail-wr1-x42e.google.com with SMTP id x15so10119435wru.13 for ; Thu, 03 Mar 2022 15:50:12 -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=47iMjV3sq46sbjD6g6+N774t/fs+Sb4CTlcnefiJ+sI=; b=QhhSFEjN5gmRUsFpAyEzVOV3JS8w7Or3fAnbGrgC7uEo33wVxa8wFkR9/mEpmTyNoI QNLGwiVeWw8cC8GEaAsaLNB+ZR2/9ZbNLB04qb1LUZcQEO5zfm101ztdcx9bJA4OcI4G qkrZhfazN4F2QEp6oy9MqRiCMKG+LflxPmyDgbkAnVKqgE/6CgFmY66MtMdZTIMGEpaw AzrfdAm5F9ob39Byiv4T5toMvS/lifTqTfrT8ouGQVHrkjen0u+O5z3lP7psiOWEdpk5 30gCZI2VtkF9kIxMN6Ht1VEX41HMF0g23J9JmLAKScOAMni5S7OfCue5xL+no37GdV1x I7Ew== 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=47iMjV3sq46sbjD6g6+N774t/fs+Sb4CTlcnefiJ+sI=; b=AVdNLhM5alFmkhoGswqfw6zW80Lj66qds018RP25A87RZqfQjk8U4odXx6ggSv1/Ez mWK6cspRgsxWJk6uuF6ICyaxAjywIi9Ki5sbYoC+jIh0MFtYbxw9x5aX509PSFFIbVOe vvZmxLUE+LmlKVqlDPMcZZYVPNRjcpL2fZH8KNHIhhgFh0P2j0AOwIHDO7n5Cc03Gozp HJdpSzMe6Wo2Y+5XqmNAl7kOJU/Q3QJHry+gQmCKDUH424DY/pkiTtXda0+CJouwWNZ5 9HddCEAxEkAjCzzpenQnQq1h7OqmL0XC4AWrow0AnOUVfgOHVb6T2OemgT/mS+fa1rM2 JhhA== X-Gm-Message-State: AOAM5339oqSS0i8sNYctCeaWp2wDWK1NBc3iYU/43f3BjwB2Z/7HQW3B vcwWll1HqpG8gCqPbIS2BcpIyI56ZY4s4w== X-Google-Smtp-Source: ABdhPJylcY8FNLxAE3eDHI/0WZceqQ3YsyulVvU7wO2ke0VUKmlpOXzyKa9baypyJKWvKuGeIZ9gRA== X-Received: by 2002:a05:6000:1a52:b0:1f0:2d62:2bbb with SMTP id t18-20020a0560001a5200b001f02d622bbbmr7595440wry.614.1646351412234; Thu, 03 Mar 2022 15:50:12 -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 y4-20020adff144000000b001f022290737sm3079779wro.6.2022.03.03.15.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 15:50:11 -0800 (PST) From: Daniel Scally To: libcamera-devel@lists.libcamera.org Date: Thu, 3 Mar 2022 23:49:48 +0000 Message-Id: <20220303234956.1463551-2-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220303234956.1463551-1-djrscally@gmail.com> References: <20220303234956.1463551-1-djrscally@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 Reviewed-by: Jean-Michel Hautbois --- Changes in v5: - None 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 */