From patchwork Thu Dec 20 16:44:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 62 Return-Path: Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1873160B1F for ; Thu, 20 Dec 2018 17:45:01 +0100 (CET) Received: from w540.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 9BE8C240011; Thu, 20 Dec 2018 16:45:00 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Thu, 20 Dec 2018 17:44:43 +0100 Message-Id: <1545324285-16730-1-git-send-email-jacopo@jmondi.org> X-Mailer: git-send-email 2.7.4 Subject: [libcamera-devel] [PATCH 0/2] Add MediaDevice and associated MediaObjects X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 16:45:01 -0000 Hello, this two patches add a class hierarcy to represent the media device objects registered in a media graph. The first patch adds the hierarcy used to represent media entities, pads and links, while the second one adds a class that handles the media graph making use of the here introduced MediaObjects. The MediaDevice class allows enumerations of all media objects in the media graph and supports handling of pad-2-pad links. This classes will be used by pipeline managers to setup the media graph for the selected use case, and they've been tested with a sketched pipeline manager targetting Intel's IPU3 platforms. As of now, the media device depends on receiving a static map that associates each entity with its video subdevice path. This might be modified once a media enumerator is available, and will provide said map by inspecting what's available in the system. For this reason, I have a unit test I'm not sharing yet as it needs to hardcode the entity-path map for the platform I'm currently developing for. As a minor side note: comments. This code is over-commented, I know. I don't think that's a bad thing in general, but as this aims to be the reference implementation, I felt like it was worth commenting everything I could. We decided to comment as much as we can in the .cpp file, to keep headers simple and clean. I still tend to agree with this, but I'm open to discuss it if necessary. Thanks j Jacopo Mondi (2): libcamera: Add MediaObject class hierarchy libcamera: Add MediaDevice class src/libcamera/include/media_device.h | 72 +++++ src/libcamera/include/media_object.h | 119 +++++++ src/libcamera/media_device.cpp | 603 +++++++++++++++++++++++++++++++++++ src/libcamera/media_object.cpp | 302 ++++++++++++++++++ src/libcamera/meson.build | 2 + 5 files changed, 1098 insertions(+) create mode 100644 src/libcamera/include/media_device.h create mode 100644 src/libcamera/include/media_object.h create mode 100644 src/libcamera/media_device.cpp create mode 100644 src/libcamera/media_object.cpp --- 2.7.4