From patchwork Fri Dec 3 22:42:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15031 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 D0ED4C3250 for ; Fri, 3 Dec 2021 22:42:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6EC1060862; Fri, 3 Dec 2021 23:42:39 +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="M4COUbxM"; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7F254607DE for ; Fri, 3 Dec 2021 23:42:37 +0100 (CET) Received: by mail-wr1-x42c.google.com with SMTP id o13so8618338wrs.12 for ; Fri, 03 Dec 2021 14:42:37 -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=V8oNqs2fQXGNzt40Dlu2QmXDBCzO4AairuuGrc097UE=; b=M4COUbxMyihwfX93+D8EfKXLwgcPac18fxKqE6/Ccvpoq8+azyOKPwuGhT4leU4qFr ydOofa/APIXJ9v22F/Ma0uPuF5W0AXj/0jTm0vwFQIZVPUE7fsP+cuScNLkFm48i8rhj v7+wQTYpqLVg7u60PoOenNNRN9vqGfG9CRq6MMm+s5+UEFtbQp+lRN/BmWf9su4KXerR ggCNXC3ARdKx1dW6YFi21oTSy8HfSRks1rb3ytyDSqIjZCb2nYNF0RTzkFXwkGDSYpiE pPxrT0yRlxaocFzoZEFTHMyHXOSVANqFGuQ73JZFY0zR52i2jlTCkWakBGjybfSt+x+D T9MQ== 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=V8oNqs2fQXGNzt40Dlu2QmXDBCzO4AairuuGrc097UE=; b=zdEICjv1EmepwHEs/qajHfX/fWIz376IGLafARwV/pIx0SzePMwJIPbJUJ+RF9lh+h p1SeiV/TOi6dRgYMTfoMEf5yIgkMlyp0A+E5NfmwSLaUHtqQUIpMdNaipyJzgbLxYmTG kVgCehENssGJm4UrVkm8ynVfopttsj12K+nXQ0yBn2pL3tZgKbYaDUUg2RjzW+dZAzZ9 RDiVrIUXuyHpoOAzJHxw5sgsVqHOc7ojUNAZzDLT3E/m2wHJxHqTKLq54u2Yk45ys4N4 yovyOMvOzglk5w/jSpZxJ3lAcQ5m96/pE5kmwXOCmZ/15bCIwhZvMtK6+EJ1m+hGLRax FQ4g== X-Gm-Message-State: AOAM532f4Mg6dNhsIk6KB8+P1+0i+3en1lGJ1UI/oHbZRzIQ9bspSb00 O69hujJ5hyEKDeuDZnyf1DvfAc+bcTk= X-Google-Smtp-Source: ABdhPJzO5K/0k1gCsQe6cu3ZWtCBR5TQXlQ7gyGKYIDWG29t8nz0PcM2tTN4+IAGwlDs85SitTDeYQ== X-Received: by 2002:adf:eece:: with SMTP id a14mr24112323wrp.333.1638571357302; Fri, 03 Dec 2021 14:42:37 -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 o25sm3939919wms.17.2021.12.03.14.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 14:42:36 -0800 (PST) From: Daniel Scally To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Dec 2021 22:42:24 +0000 Message-Id: <20211203224230.38700-2-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211203224230.38700-1-djrscally@gmail.com> References: <20211203224230.38700-1-djrscally@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/7] 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. Signed-off-by: Daniel Scally --- Changes in v2: - Switched from additional members against MediaLink pointing to the primary and ancillary entity to a vector against MediaEntity holding pointers to the ancillary entities linked to that MediaEntity (Laurent) include/libcamera/internal/media_object.h | 4 ++++ src/libcamera/media_object.cpp | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h index 90c63598..48616a43 100644 --- a/include/libcamera/internal/media_object.h +++ b/include/libcamera/internal/media_object.h @@ -104,6 +104,9 @@ public: unsigned int deviceMinor() const { return minor_; } const std::vector &pads() const { return pads_; } + const std::vector ancillaryEntities() const {return ancillaryEntities_; } + + void addAncillaryEntity(MediaEntity *ancillaryEntity); const MediaPad *getPadByIndex(unsigned int index) const; const MediaPad *getPadById(unsigned int id) const; @@ -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..42b26b07 100644 --- a/src/libcamera/media_object.cpp +++ b/src/libcamera/media_object.cpp @@ -326,6 +326,22 @@ void MediaPad::addLink(MediaLink *link) * \return The list of the entity's pads */ +/** + * \fn MediaEntity::ancillaryEntities() + * \brief Retrieve all ancillary entities of the entity + * \return The list of the entity's ancillary entities + */ + +/** + * \brief Add a MediaEntity to the list of ancillary entities + * \param[in] ancillaryEntity the instance of MediaEntity to add + * \return void + */ +void MediaEntity::addAncillaryEntity(MediaEntity *ancillaryEntity) +{ + ancillaryEntities_.push_back(ancillaryEntity); +} + /** * \brief Get a pad in this entity by its index * \param[in] index The 0-based pad index