From patchwork Sun Oct 13 00:13:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2176 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DC60B60BE5 for ; Sun, 13 Oct 2019 02:13:48 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5D3B033A for ; Sun, 13 Oct 2019 02:13:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1570925628; bh=Tcj6z+RVv+9+dEmXZ3ou4I/AZjyct0hzVX4yHEocRuQ=; h=From:To:Subject:Date:From; b=pYPwr6lqrbL5jKjHACGY6pNvZm2HCMGcRO2CoulpIvkkRYxGKVlHqH8Oy0bdPJzQz j5p17TeCR+4gdWxFLQV0cYRaxSOKWFpaUVt2aCON3UdEWJzHL5zYHqVi+W7dBR/PX6 V043IXUP8v3qFTKvvn7E/kHKI8O7ubjO2ehr49yk= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sun, 13 Oct 2019 03:13:36 +0300 Message-Id: <20191013001340.14266-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH/RFC v2 0/4] Convert IPA API to plain C 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: Sun, 13 Oct 2019 00:13:49 -0000 Hello, This series converts the C++ IPA API to plain C. It gathers patches that have already been posted separately, and reworks, improves and extends them. The rationale is explained in patch 2/4: to allow for closed-source IPAs that don't link to libcamera, we need to offer a plain C API to IPAs. The series starts in patch 1/4 with a small extension to the Buffer class that is needed by later patches. Patch 2/4 then introduces the C API, and patch 3/4 switches to it. The C++ IPAInterface class is kept as it is easier to use from pipeline handlers (and can come handy for the implementation of IPAs too), we thus introduce wrappers to convert between the C and C++ APIs. Patch 4/4 finally offers a shortcut to avoid conversions between the C and C++ APIs when the IPA module implements an IPAInterface internally. This is still work in progress, the IPAInterface configure(), processEvents() and queueFrameAction are not fully implemented yet. The infrastructure is present, but the parameters to the calls are not translated. This will likely require serialisation of ControlList and V4L2ControlInfoMap to complete the implementation. Jacopo Mondi (1): ipa: Switch to the plain C API Laurent Pinchart (3): libcamera: buffer: Add const accessor to Buffer planes ipa: Define a plain C API ipa: Allow short-circuiting the ipa_context_ops Documentation/Doxyfile.in | 1 + Documentation/meson.build | 2 + include/ipa/ipa_interface.h | 45 ++++ include/libcamera/buffer.h | 1 + src/ipa/ipa_vimc.cpp | 6 +- src/ipa/libipa/ipa_interface_wrapper.cpp | 159 +++++++++++ src/ipa/libipa/ipa_interface_wrapper.h | 46 ++++ src/ipa/libipa/meson.build | 11 + src/ipa/meson.build | 3 + src/libcamera/buffer.cpp | 6 + src/libcamera/include/ipa_context_wrapper.h | 41 +++ src/libcamera/include/ipa_module.h | 5 +- src/libcamera/include/meson.build | 1 + src/libcamera/ipa_context_wrapper.cpp | 158 +++++++++++ src/libcamera/ipa_interface.cpp | 246 +++++++++++++++--- src/libcamera/ipa_manager.cpp | 67 ++++- src/libcamera/ipa_module.cpp | 23 +- src/libcamera/meson.build | 1 + .../proxy/worker/ipa_proxy_linux_worker.cpp | 8 +- 19 files changed, 780 insertions(+), 50 deletions(-) create mode 100644 src/ipa/libipa/ipa_interface_wrapper.cpp create mode 100644 src/ipa/libipa/ipa_interface_wrapper.h create mode 100644 src/ipa/libipa/meson.build create mode 100644 src/libcamera/include/ipa_context_wrapper.h create mode 100644 src/libcamera/ipa_context_wrapper.cpp