From patchwork Mon Dec 31 09:27:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 113 Return-Path: Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 14C6860B30 for ; Mon, 31 Dec 2018 10:27:56 +0100 (CET) X-Originating-IP: 87.16.51.54 Received: from uno.homenet.telecomitalia.it (host54-51-dynamic.16-87-r.retail.telecomitalia.it [87.16.51.54]) (Authenticated sender: jacopo@jmondi.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 5D070C0003; Mon, 31 Dec 2018 09:27:55 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 31 Dec 2018 10:27:49 +0100 Message-Id: <20181231092752.5018-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/3] MediaDevice class and MediaObject classes 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: Mon, 31 Dec 2018 09:27:56 -0000 Hello this is 4th version of MediaDevice and associated MediaObject classes. v1 available for reference here: https://lists.libcamera.org/pipermail/libcamera-devel/2018-December/000120.html v2 available for reference here: https://lists.libcamera.org/pipermail/libcamera-devel/2018-December/000181.html v3 available for reference here: https://lists.libcamera.org/pipermail/libcamera-devel/2018-December/000239.html I have addressed here comments on Niklas and Laurent on v3. Most notable changes are: - Simplified destructors, and have all object destroyed by the MediaDevice iterating over the global pool of objects. MediaPad and MediaEntity destructors only clear the list containers and do not delete objects they are associated with (thanks Laurent) - Simplified the populate() function clean up (thanks Niklas) - Polish and use \return everywhere in comments (thanks Niklas) Tested locally using the printout test on VIMC and integrated webcam media devices. Valgrind does not report memory leaks. I consider this version ready to be pushed, even if only 1/3 has received a reviewed-by tag by Laurent. Thanks j Jacopo Mondi (3): libcamera: Add MediaObject class hierarchy libcamera: Add MediaDevice class test: Add media device test src/libcamera/include/media_device.h | 61 ++++ src/libcamera/include/media_object.h | 106 +++++++ src/libcamera/media_device.cpp | 362 ++++++++++++++++++++++++ src/libcamera/media_object.cpp | 279 ++++++++++++++++++ src/libcamera/meson.build | 4 + test/media_device/media_device_test.cpp | 175 ++++++++++++ test/media_device/meson.build | 5 + test/meson.build | 4 + 8 files changed, 996 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 create mode 100644 test/media_device/media_device_test.cpp create mode 100644 test/media_device/meson.build --- 2.20.1