From patchwork Sat Jan 4 05:09:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2496 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 229FC60461 for ; Sat, 4 Jan 2020 06:10:03 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 919B330F for ; Sat, 4 Jan 2020 06:10:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1578114602; bh=etUKd73dg3BHHxCct6e/LxtE8Zc3aky3WuHk276PLbs=; h=From:To:Subject:Date:From; b=j15yVwOxDf2QWGxqO+DmCxUkWJAyRceSUg70SEhz1Nd3RNnYE8f7RQwGEuK9WDiMq 8jsTq2PjWpijVQexrrvg0Pp2hW14bgImCpNPomJ7LgB/ZNVRPwXRDFhErOfvcfXF/e lv+uhxxv2agk4W7o4WFy0z2x/9IFs0YxpstWhFMw= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Jan 2020 07:09:33 +0200 Message-Id: <20200104050947.7673-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 00/14] object: Propagate return value of invoked method 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: , X-List-Received-Date: Sat, 04 Jan 2020 05:10:03 -0000 Hello, This patch series implements support for propagating the return value of invoked method all the way to the caller of Object::invokeMethod(). The change is motivated by the recently merged V4L2 compatibility layer that works around this missing feature using function arguments to pass a pointer to the return value. The individual patches should be pretty self-explicit. It's worth noting that patch 03/14 fixes a memory leak that I noticed while developing this. Patch 14/14 shows how the new feature simplifies the V4L2 compatibility layer. Laurent Pinchart (14): test: object-invoke: Test direct invocation libcamera: object: Use activate() in invokeMethod() libcamera: bound_method: Fix memory leak with direct connections libcamera: bound_method: Mark overriden methods with override libcamera: bound_method: Drop unused BoundMethodBase::connectionType() libcamera: bound_method: Move sequence and generator to BoundMethodBase libcamera: bound_method: Store method arguments in a class libcamera: bound_method: Support bindings to non-void methods libcamera: bound_method: Manage BoundMethodPack through std::shared_ptr libcamera: bound_method: Propagate method return value libcamera: bound_method: Rename Bound*Method to BoundMethod* test: object-invoke: Test invoking a non-void method test: signal: Test connecting to non-void slots libcamera: v4l2: Use Object::invokeMethod() return value Documentation/Doxyfile.in | 8 +- include/libcamera/bound_method.h | 178 ++++++++++++++++++++++++------- include/libcamera/object.h | 13 +-- include/libcamera/signal.h | 39 +++---- src/libcamera/bound_method.cpp | 28 ++++- src/libcamera/include/message.h | 5 +- src/libcamera/message.cpp | 5 +- src/libcamera/object.cpp | 6 +- src/libcamera/signal.cpp | 8 +- src/v4l2/v4l2_camera.cpp | 109 +++++++++---------- src/v4l2/v4l2_camera.h | 18 ++-- src/v4l2/v4l2_camera_proxy.cpp | 51 +++++---- test/object-invoke.cpp | 35 ++++++ test/signal.cpp | 17 +++ 14 files changed, 344 insertions(+), 176 deletions(-)