[{"id":13680,"web_url":"https://patchwork.libcamera.org/comment/13680/","msgid":"<20201112105603.GB1480295@oden.dyn.berto.se>","date":"2020-11-12T10:56:03","subject":"Re: [libcamera-devel] [PATCH v4 14/37] libcamera:\n\tipa_context_wrapper: Remove ipa_context_wrapper","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Paul,\n\nThanks for your work.\n\nOn 2020-11-06 19:36:44 +0900, Paul Elder wrote:\n> Since ipa_context has been replaced with custom IPAInterfaces, it is not\n> longer needed. Remove it.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> \n> ---\n> No change in v4\n> \n> No change in v3\n> \n> New in v2\n> ---\n>  .../libcamera/internal/ipa_context_wrapper.h  |  52 ---\n>  include/libcamera/internal/meson.build        |   1 -\n>  include/libcamera/ipa/ipa_interface.h         | 106 -------\n>  src/libcamera/ipa_context_wrapper.cpp         | 297 ------------------\n>  4 files changed, 456 deletions(-)\n>  delete mode 100644 include/libcamera/internal/ipa_context_wrapper.h\n>  delete mode 100644 src/libcamera/ipa_context_wrapper.cpp\n> \n> diff --git a/include/libcamera/internal/ipa_context_wrapper.h b/include/libcamera/internal/ipa_context_wrapper.h\n> deleted file mode 100644\n> index 8f767e84..00000000\n> --- a/include/libcamera/internal/ipa_context_wrapper.h\n> +++ /dev/null\n> @@ -1,52 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2019, Google Inc.\n> - *\n> - * ipa_context_wrapper.h - Image Processing Algorithm context wrapper\n> - */\n> -#ifndef __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__\n> -#define __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__\n> -\n> -#include <libcamera/ipa/ipa_interface.h>\n> -\n> -#include \"libcamera/internal/control_serializer.h\"\n> -\n> -namespace libcamera {\n> -\n> -class IPAContextWrapper final : public IPAInterface\n> -{\n> -public:\n> -\tIPAContextWrapper(struct ipa_context *context);\n> -\t~IPAContextWrapper();\n> -\n> -\tint init(const IPASettings &settings) override;\n> -\tint start() override;\n> -\tvoid stop() override;\n> -\tvoid configure(const CameraSensorInfo &sensorInfo,\n> -\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n> -\t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n> -\t\t       const IPAOperationData &ipaConfig,\n> -\t\t       IPAOperationData *result) override;\n> -\n> -\tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n> -\tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n> -\n> -\tvirtual void processEvent(const IPAOperationData &data) override;\n> -\n> -private:\n> -\tstatic void queue_frame_action(void *ctx, unsigned int frame,\n> -\t\t\t\t       struct ipa_operation_data &data);\n> -\tstatic const struct ipa_callback_ops callbacks_;\n> -\n> -\tvoid doQueueFrameAction(unsigned int frame,\n> -\t\t\t\tconst IPAOperationData &data);\n> -\n> -\tstruct ipa_context *ctx_;\n> -\tIPAInterface *intf_;\n> -\n> -\tControlSerializer serializer_;\n> -};\n> -\n> -} /* namespace libcamera */\n> -\n> -#endif /* __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__ */\n> diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build\n> index 6500fe2a..592635a9 100644\n> --- a/include/libcamera/internal/meson.build\n> +++ b/include/libcamera/internal/meson.build\n> @@ -21,7 +21,6 @@ libcamera_internal_headers = files([\n>      'event_dispatcher_poll.h',\n>      'file.h',\n>      'formats.h',\n> -    'ipa_context_wrapper.h',\n>      'ipa_manager.h',\n>      'ipa_module.h',\n>      'ipa_proxy.h',\n> diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h\n> index 322b7079..48766b22 100644\n> --- a/include/libcamera/ipa/ipa_interface.h\n> +++ b/include/libcamera/ipa/ipa_interface.h\n> @@ -10,111 +10,6 @@\n>  #include <stddef.h>\n>  #include <stdint.h>\n>  \n> -#ifdef __cplusplus\n> -extern \"C\" {\n> -#endif\n> -\n> -struct ipa_context {\n> -\tconst struct ipa_context_ops *ops;\n> -};\n> -\n> -struct ipa_settings {\n> -\tconst char *configuration_file;\n> -};\n> -\n> -struct ipa_sensor_info {\n> -\tconst char *model;\n> -\tuint8_t bits_per_pixel;\n> -\tstruct {\n> -\t\tuint32_t width;\n> -\t\tuint32_t height;\n> -\t} active_area;\n> -\tstruct {\n> -\t\tint32_t left;\n> -\t\tint32_t top;\n> -\t\tuint32_t width;\n> -\t\tuint32_t height;\n> -\t} analog_crop;\n> -\tstruct {\n> -\t\tuint32_t width;\n> -\t\tuint32_t height;\n> -\t} output_size;\n> -\tuint64_t pixel_rate;\n> -\tuint32_t line_length;\n> -};\n> -\n> -struct ipa_stream {\n> -\tunsigned int id;\n> -\tunsigned int pixel_format;\n> -\tunsigned int width;\n> -\tunsigned int height;\n> -};\n> -\n> -struct ipa_control_info_map {\n> -\tunsigned int id;\n> -\tconst uint8_t *data;\n> -\tsize_t size;\n> -};\n> -\n> -struct ipa_buffer_plane {\n> -\tint dmabuf;\n> -\tsize_t length;\n> -};\n> -\n> -struct ipa_buffer {\n> -\tunsigned int id;\n> -\tunsigned int num_planes;\n> -\tstruct ipa_buffer_plane planes[3];\n> -};\n> -\n> -struct ipa_control_list {\n> -\tconst uint8_t *data;\n> -\tunsigned int size;\n> -};\n> -\n> -struct ipa_operation_data {\n> -\tunsigned int operation;\n> -\tconst uint32_t *data;\n> -\tunsigned int num_data;\n> -\tconst struct ipa_control_list *lists;\n> -\tunsigned int num_lists;\n> -};\n> -\n> -struct ipa_callback_ops {\n> -\tvoid (*queue_frame_action)(void *cb_ctx, unsigned int frame,\n> -\t\t\t\t   struct ipa_operation_data &data);\n> -};\n> -\n> -struct ipa_context_ops {\n> -\tvoid (*destroy)(struct ipa_context *ctx);\n> -\tvoid *(*get_interface)(struct ipa_context *ctx);\n> -\tvoid (*init)(struct ipa_context *ctx,\n> -\t\t     const struct ipa_settings *settings);\n> -\tint (*start)(struct ipa_context *ctx);\n> -\tvoid (*stop)(struct ipa_context *ctx);\n> -\tvoid (*register_callbacks)(struct ipa_context *ctx,\n> -\t\t\t\t   const struct ipa_callback_ops *callbacks,\n> -\t\t\t\t   void *cb_ctx);\n> -\tvoid (*configure)(struct ipa_context *ctx,\n> -\t\t\t  const struct ipa_sensor_info *sensor_info,\n> -\t\t\t  const struct ipa_stream *streams,\n> -\t\t\t  unsigned int num_streams,\n> -\t\t\t  const struct ipa_control_info_map *maps,\n> -\t\t\t  unsigned int num_maps);\n> -\tvoid (*map_buffers)(struct ipa_context *ctx,\n> -\t\t\t    const struct ipa_buffer *buffers,\n> -\t\t\t    size_t num_buffers);\n> -\tvoid (*unmap_buffers)(struct ipa_context *ctx, const unsigned int *ids,\n> -\t\t\t      size_t num_buffers);\n> -\tvoid (*process_event)(struct ipa_context *ctx,\n> -\t\t\t      const struct ipa_operation_data *data);\n> -};\n> -\n> -struct ipa_context *ipaCreate();\n> -\n> -#ifdef __cplusplus\n> -}\n> -\n>  #include <map>\n>  #include <vector>\n>  \n> @@ -170,6 +65,5 @@ public:\n>  };\n>  \n>  } /* namespace libcamera */\n> -#endif\n>  \n>  #endif /* __LIBCAMERA_IPA_INTERFACE_H__ */\n> diff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp\n> deleted file mode 100644\n> index 231300ce..00000000\n> --- a/src/libcamera/ipa_context_wrapper.cpp\n> +++ /dev/null\n> @@ -1,297 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2019, Google Inc.\n> - *\n> - * ipa_context_wrapper.cpp - Image Processing Algorithm context wrapper\n> - */\n> -\n> -#include \"libcamera/internal/ipa_context_wrapper.h\"\n> -\n> -#include <vector>\n> -\n> -#include <libcamera/controls.h>\n> -\n> -#include \"libcamera/internal/byte_stream_buffer.h\"\n> -#include \"libcamera/internal/camera_sensor.h\"\n> -#include \"libcamera/internal/utils.h\"\n> -\n> -/**\n> - * \\file ipa_context_wrapper.h\n> - * \\brief Image Processing Algorithm context wrapper\n> - */\n> -\n> -namespace libcamera {\n> -\n> -/**\n> - * \\class IPAContextWrapper\n> - * \\brief Wrap an ipa_context and expose it as an IPAInterface\n> - *\n> - * The IPAContextWrapper class wraps an ipa_context, provided by an IPA module, and\n> - * exposes an IPAInterface. This mechanism is used for IPAs that are not\n> - * isolated in a separate process to allow direct calls from pipeline handler\n> - * using the IPAInterface API instead of the lower-level ipa_context API.\n> - *\n> - * The IPAInterface methods are converted to the ipa_context API by translating\n> - * all C++ arguments into plain C structures or byte arrays that contain no\n> - * pointer, as required by the ipa_context API.\n> - */\n> -\n> -/**\n> - * \\brief Construct an IPAContextWrapper instance that wraps the \\a context\n> - * \\param[in] context The IPA module context\n> - *\n> - * Ownership of the \\a context is passed to the IPAContextWrapper. The context remains\n> - * valid for the whole lifetime of the wrapper and is destroyed automatically\n> - * with it.\n> - */\n> -IPAContextWrapper::IPAContextWrapper(struct ipa_context *context)\n> -\t: ctx_(context), intf_(nullptr)\n> -{\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tbool forceCApi = !!utils::secure_getenv(\"LIBCAMERA_IPA_FORCE_C_API\");\n> -\n> -\tif (!forceCApi && ctx_ && ctx_->ops->get_interface) {\n> -\t\tintf_ = reinterpret_cast<IPAInterface *>(ctx_->ops->get_interface(ctx_));\n> -\t\tintf_->queueFrameAction.connect(this, &IPAContextWrapper::doQueueFrameAction);\n> -\t\treturn;\n> -\t}\n> -\n> -\tctx_->ops->register_callbacks(ctx_, &IPAContextWrapper::callbacks_,\n> -\t\t\t\t      this);\n> -}\n> -\n> -IPAContextWrapper::~IPAContextWrapper()\n> -{\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tctx_->ops->destroy(ctx_);\n> -}\n> -\n> -int IPAContextWrapper::init(const IPASettings &settings)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->init(settings);\n> -\n> -\tif (!ctx_)\n> -\t\treturn 0;\n> -\n> -\tstruct ipa_settings c_settings;\n> -\tc_settings.configuration_file = settings.configurationFile.c_str();\n> -\n> -\tctx_->ops->init(ctx_, &c_settings);\n> -\n> -\treturn 0;\n> -}\n> -\n> -int IPAContextWrapper::start()\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->start();\n> -\n> -\tif (!ctx_)\n> -\t\treturn 0;\n> -\n> -\treturn ctx_->ops->start(ctx_);\n> -}\n> -\n> -void IPAContextWrapper::stop()\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->stop();\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tctx_->ops->stop(ctx_);\n> -}\n> -\n> -void IPAContextWrapper::configure(const CameraSensorInfo &sensorInfo,\n> -\t\t\t\t  const std::map<unsigned int, IPAStream> &streamConfig,\n> -\t\t\t\t  const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n> -\t\t\t\t  const IPAOperationData &ipaConfig,\n> -\t\t\t\t  IPAOperationData *result)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->configure(sensorInfo, streamConfig,\n> -\t\t\t\t\tentityControls, ipaConfig, result);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tserializer_.reset();\n> -\n> -\t/* Translate the camera sensor info. */\n> -\tstruct ipa_sensor_info sensor_info = {};\n> -\tsensor_info.model = sensorInfo.model.c_str();\n> -\tsensor_info.bits_per_pixel = sensorInfo.bitsPerPixel;\n> -\tsensor_info.active_area.width = sensorInfo.activeAreaSize.width;\n> -\tsensor_info.active_area.height = sensorInfo.activeAreaSize.height;\n> -\tsensor_info.analog_crop.left = sensorInfo.analogCrop.x;\n> -\tsensor_info.analog_crop.top = sensorInfo.analogCrop.y;\n> -\tsensor_info.analog_crop.width = sensorInfo.analogCrop.width;\n> -\tsensor_info.analog_crop.height = sensorInfo.analogCrop.height;\n> -\tsensor_info.output_size.width = sensorInfo.outputSize.width;\n> -\tsensor_info.output_size.height = sensorInfo.outputSize.height;\n> -\tsensor_info.pixel_rate = sensorInfo.pixelRate;\n> -\tsensor_info.line_length = sensorInfo.lineLength;\n> -\n> -\t/* Translate the IPA stream configurations map. */\n> -\tstruct ipa_stream c_streams[streamConfig.size()];\n> -\n> -\tunsigned int i = 0;\n> -\tfor (const auto &stream : streamConfig) {\n> -\t\tstruct ipa_stream *c_stream = &c_streams[i];\n> -\t\tunsigned int id = stream.first;\n> -\t\tconst IPAStream &ipaStream = stream.second;\n> -\n> -\t\tc_stream->id = id;\n> -\t\tc_stream->pixel_format = ipaStream.pixelFormat;\n> -\t\tc_stream->width = ipaStream.size.width;\n> -\t\tc_stream->height = ipaStream.size.height;\n> -\n> -\t\t++i;\n> -\t}\n> -\n> -\t/* Translate the IPA entity controls map. */\n> -\tstruct ipa_control_info_map c_info_maps[entityControls.size()];\n> -\tstd::vector<std::vector<uint8_t>> data(entityControls.size());\n> -\n> -\ti = 0;\n> -\tfor (const auto &info : entityControls) {\n> -\t\tstruct ipa_control_info_map &c_info_map = c_info_maps[i];\n> -\t\tunsigned int id = info.first;\n> -\t\tconst ControlInfoMap &infoMap = info.second;\n> -\n> -\t\tsize_t infoMapSize = serializer_.binarySize(infoMap);\n> -\t\tdata[i].resize(infoMapSize);\n> -\t\tByteStreamBuffer byteStream(data[i].data(), data[i].size());\n> -\t\tserializer_.serialize(infoMap, byteStream);\n> -\n> -\t\tc_info_map.id = id;\n> -\t\tc_info_map.data = byteStream.base();\n> -\t\tc_info_map.size = byteStream.size();\n> -\n> -\t\t++i;\n> -\t}\n> -\n> -\t/* \\todo Translate the ipaConfig and reponse */\n> -\tctx_->ops->configure(ctx_, &sensor_info, c_streams, streamConfig.size(),\n> -\t\t\t     c_info_maps, entityControls.size());\n> -}\n> -\n> -void IPAContextWrapper::mapBuffers(const std::vector<IPABuffer> &buffers)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->mapBuffers(buffers);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tstruct ipa_buffer c_buffers[buffers.size()];\n> -\n> -\tfor (unsigned int i = 0; i < buffers.size(); ++i) {\n> -\t\tstruct ipa_buffer &c_buffer = c_buffers[i];\n> -\t\tconst IPABuffer &buffer = buffers[i];\n> -\t\tconst std::vector<FrameBuffer::Plane> &planes = buffer.planes;\n> -\n> -\t\tc_buffer.id = buffer.id;\n> -\t\tc_buffer.num_planes = planes.size();\n> -\n> -\t\tfor (unsigned int j = 0; j < planes.size(); ++j) {\n> -\t\t\tconst FrameBuffer::Plane &plane = planes[j];\n> -\t\t\tc_buffer.planes[j].dmabuf = plane.fd.fd();\n> -\t\t\tc_buffer.planes[j].length = plane.length;\n> -\t\t}\n> -\t}\n> -\n> -\tctx_->ops->map_buffers(ctx_, c_buffers, buffers.size());\n> -}\n> -\n> -void IPAContextWrapper::unmapBuffers(const std::vector<unsigned int> &ids)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->unmapBuffers(ids);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tctx_->ops->unmap_buffers(ctx_, ids.data(), ids.size());\n> -}\n> -\n> -void IPAContextWrapper::processEvent(const IPAOperationData &data)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->processEvent(data);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tstruct ipa_operation_data c_data;\n> -\tc_data.operation = data.operation;\n> -\tc_data.data = data.data.data();\n> -\tc_data.num_data = data.data.size();\n> -\n> -\tstruct ipa_control_list control_lists[data.controls.size()];\n> -\tc_data.lists = control_lists;\n> -\tc_data.num_lists = data.controls.size();\n> -\n> -\tstd::size_t listsSize = 0;\n> -\tfor (const auto &list : data.controls)\n> -\t\tlistsSize += serializer_.binarySize(list);\n> -\n> -\tstd::vector<uint8_t> binaryData(listsSize);\n> -\tByteStreamBuffer byteStreamBuffer(binaryData.data(), listsSize);\n> -\n> -\tunsigned int i = 0;\n> -\tfor (const auto &list : data.controls) {\n> -\t\tstruct ipa_control_list &c_list = control_lists[i];\n> -\t\tc_list.size = serializer_.binarySize(list);\n> -\t\tByteStreamBuffer b = byteStreamBuffer.carveOut(c_list.size);\n> -\n> -\t\tserializer_.serialize(list, b);\n> -\n> -\t\tc_list.data = b.base();\n> -\t}\n> -\n> -\tctx_->ops->process_event(ctx_, &c_data);\n> -}\n> -\n> -void IPAContextWrapper::doQueueFrameAction(unsigned int frame,\n> -\t\t\t\t\t   const IPAOperationData &data)\n> -{\n> -\tIPAInterface::queueFrameAction.emit(frame, data);\n> -}\n> -\n> -void IPAContextWrapper::queue_frame_action(void *ctx, unsigned int frame,\n> -\t\t\t\t\t   struct ipa_operation_data &data)\n> -{\n> -\tIPAContextWrapper *_this = static_cast<IPAContextWrapper *>(ctx);\n> -\tIPAOperationData opData;\n> -\n> -\topData.operation = data.operation;\n> -\tfor (unsigned int i = 0; i < data.num_data; ++i)\n> -\t\topData.data.push_back(data.data[i]);\n> -\n> -\tfor (unsigned int i = 0; i < data.num_lists; ++i) {\n> -\t\tconst struct ipa_control_list &c_list = data.lists[i];\n> -\t\tByteStreamBuffer b(c_list.data, c_list.size);\n> -\t\topData.controls.push_back(_this->serializer_.deserialize<ControlList>(b));\n> -\t}\n> -\n> -\t_this->doQueueFrameAction(frame, opData);\n> -}\n> -\n> -#ifndef __DOXYGEN__\n> -/*\n> - * This construct confuses Doxygen and makes it believe that all members of the\n> - * operations is a member of IPAContextWrapper. It must thus be hidden.\n> - */\n> -const struct ipa_callback_ops IPAContextWrapper::callbacks_ = {\n> -\t.queue_frame_action = &IPAContextWrapper::queue_frame_action,\n> -};\n> -#endif\n> -\n> -} /* namespace libcamera */\n> -- \n> 2.27.0\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id B4106BDB89\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 12 Nov 2020 10:56:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 39D3E63162;\n\tThu, 12 Nov 2020 11:56:08 +0100 (CET)","from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com\n\t[IPv6:2a00:1450:4864:20::12e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DC29763137\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Nov 2020 11:56:05 +0100 (CET)","by mail-lf1-x12e.google.com with SMTP id 74so7701406lfo.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 12 Nov 2020 02:56:05 -0800 (PST)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tq20sm534613lfr.110.2020.11.12.02.56.04\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 12 Nov 2020 02:56:04 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"J91ERhBN\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=aF5AuTBDeDAd50yJ2+JidUPKD8pY600jMGRRU5kNfOo=;\n\tb=J91ERhBNDxe27Lrx4QabVQ6yvH+Z3EoxEaBuKKInv6hgn/FjbxWyzkiTaLIVyUBb0d\n\tG2efIVFfIv1GgX4FPcH3CGN5SunaiNw8VtZ32Ynj54ojIMEzLxFPAHRxMVHrC32/OgfU\n\tTghzM4KWB1doZWyz+keM+XQpSlY/T0neS/MeG61w9nd2xPrM8xrbfI0r1F2eE+EcdOzc\n\tBwiXJV9VTvai/kfbjL6wWsyB/YpnJ4iTs/B+KxnRVXXPgKvQbtsV5Dx3W22NIbFtRbaQ\n\tlGdpd4fSlKf3G7ZoIb1J4MG0tyhWZ9VrErqCTbxGqW2/PSaN0/LkqfbTYr+6r/q9HY8c\n\tbndg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=aF5AuTBDeDAd50yJ2+JidUPKD8pY600jMGRRU5kNfOo=;\n\tb=rA5NAGstnugbkM02qhwwKCXwqmVQyFfnj7CN6AUI22ncDhBrFe00vOsG+ZOrU1WhLU\n\tDbkLNkIYfE+hMNkutu5wRXMz6fM6sfYgcD1Xwz9Lnmnskl6x3V+/nnbwnE1FyUkgTAXq\n\tmdrG9R0ZpxL7YKLP0X6FqITL5wfwKQscN3POsvPzrBQuh10NLntACO+hfs9OY9XYXeZZ\n\tsHKksqxmePhds3ksDL0YqBnKW0IJC4gjIxA2/lIFdUOaFkR2BdRqnsGKUigtRASObtQT\n\tXOO1R6skkLfMABjjGSzCTJqhD+oGh/Jo25IIcgBw0Zeg8sMJ/2UoDxPfM83JNBUkQbZy\n\t34tw==","X-Gm-Message-State":"AOAM533XtvU92dkqZK8a6pv/7uJlCtx1cqmZWiqb0HqQG7ygQat8nZQK\n\t0E0OU7a8c5MfIOWIU9NAXZZl3Q==","X-Google-Smtp-Source":"ABdhPJzh+VsJWy0tSKTgzAPMn3ELbZSMqlkCtRnalltUY38GXyXbv9cgGFrwoU1y9LdBP2E04sOxKw==","X-Received":"by 2002:ac2:4211:: with SMTP id\n\ty17mr12042622lfh.133.1605178565176; \n\tThu, 12 Nov 2020 02:56:05 -0800 (PST)","Date":"Thu, 12 Nov 2020 11:56:03 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<20201112105603.GB1480295@oden.dyn.berto.se>","References":"<20201106103707.49660-1-paul.elder@ideasonboard.com>\n\t<20201106103707.49660-15-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201106103707.49660-15-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 14/37] libcamera:\n\tipa_context_wrapper: Remove ipa_context_wrapper","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":13754,"web_url":"https://patchwork.libcamera.org/comment/13754/","msgid":"<20201117160912.5mddflexth4w4k5k@uno.localdomain>","date":"2020-11-17T16:09:12","subject":"Re: [libcamera-devel] [PATCH v4 14/37] libcamera:\n\tipa_context_wrapper: Remove ipa_context_wrapper","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Paul,\n\nOn Fri, Nov 06, 2020 at 07:36:44PM +0900, Paul Elder wrote:\n> Since ipa_context has been replaced with custom IPAInterfaces, it is not\n> longer needed. Remove it.\n>\n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> ---\n> No change in v4\n>\n> No change in v3\n>\n> New in v2\n> ---\n>  .../libcamera/internal/ipa_context_wrapper.h  |  52 ---\n>  include/libcamera/internal/meson.build        |   1 -\n>  include/libcamera/ipa/ipa_interface.h         | 106 -------\n>  src/libcamera/ipa_context_wrapper.cpp         | 297 ------------------\n>  4 files changed, 456 deletions(-)\n>  delete mode 100644 include/libcamera/internal/ipa_context_wrapper.h\n>  delete mode 100644 src/libcamera/ipa_context_wrapper.cpp\n>\n> diff --git a/include/libcamera/internal/ipa_context_wrapper.h b/include/libcamera/internal/ipa_context_wrapper.h\n> deleted file mode 100644\n> index 8f767e84..00000000\n> --- a/include/libcamera/internal/ipa_context_wrapper.h\n> +++ /dev/null\n> @@ -1,52 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2019, Google Inc.\n> - *\n> - * ipa_context_wrapper.h - Image Processing Algorithm context wrapper\n> - */\n> -#ifndef __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__\n> -#define __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__\n> -\n> -#include <libcamera/ipa/ipa_interface.h>\n> -\n> -#include \"libcamera/internal/control_serializer.h\"\n> -\n> -namespace libcamera {\n> -\n> -class IPAContextWrapper final : public IPAInterface\n> -{\n> -public:\n> -\tIPAContextWrapper(struct ipa_context *context);\n> -\t~IPAContextWrapper();\n> -\n> -\tint init(const IPASettings &settings) override;\n> -\tint start() override;\n> -\tvoid stop() override;\n> -\tvoid configure(const CameraSensorInfo &sensorInfo,\n> -\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n> -\t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n> -\t\t       const IPAOperationData &ipaConfig,\n> -\t\t       IPAOperationData *result) override;\n> -\n> -\tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n> -\tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n> -\n> -\tvirtual void processEvent(const IPAOperationData &data) override;\n> -\n> -private:\n> -\tstatic void queue_frame_action(void *ctx, unsigned int frame,\n> -\t\t\t\t       struct ipa_operation_data &data);\n> -\tstatic const struct ipa_callback_ops callbacks_;\n> -\n> -\tvoid doQueueFrameAction(unsigned int frame,\n> -\t\t\t\tconst IPAOperationData &data);\n> -\n> -\tstruct ipa_context *ctx_;\n> -\tIPAInterface *intf_;\n> -\n> -\tControlSerializer serializer_;\n> -};\n> -\n> -} /* namespace libcamera */\n> -\n> -#endif /* __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__ */\n> diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build\n> index 6500fe2a..592635a9 100644\n> --- a/include/libcamera/internal/meson.build\n> +++ b/include/libcamera/internal/meson.build\n> @@ -21,7 +21,6 @@ libcamera_internal_headers = files([\n>      'event_dispatcher_poll.h',\n>      'file.h',\n>      'formats.h',\n> -    'ipa_context_wrapper.h',\n>      'ipa_manager.h',\n>      'ipa_module.h',\n>      'ipa_proxy.h',\n> diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h\n> index 322b7079..48766b22 100644\n> --- a/include/libcamera/ipa/ipa_interface.h\n> +++ b/include/libcamera/ipa/ipa_interface.h\n> @@ -10,111 +10,6 @@\n>  #include <stddef.h>\n>  #include <stdint.h>\n>\n> -#ifdef __cplusplus\n> -extern \"C\" {\n> -#endif\n> -\n> -struct ipa_context {\n> -\tconst struct ipa_context_ops *ops;\n> -};\n> -\n> -struct ipa_settings {\n> -\tconst char *configuration_file;\n> -};\n> -\n> -struct ipa_sensor_info {\n> -\tconst char *model;\n> -\tuint8_t bits_per_pixel;\n> -\tstruct {\n> -\t\tuint32_t width;\n> -\t\tuint32_t height;\n> -\t} active_area;\n> -\tstruct {\n> -\t\tint32_t left;\n> -\t\tint32_t top;\n> -\t\tuint32_t width;\n> -\t\tuint32_t height;\n> -\t} analog_crop;\n> -\tstruct {\n> -\t\tuint32_t width;\n> -\t\tuint32_t height;\n> -\t} output_size;\n> -\tuint64_t pixel_rate;\n> -\tuint32_t line_length;\n> -};\n> -\n> -struct ipa_stream {\n> -\tunsigned int id;\n> -\tunsigned int pixel_format;\n> -\tunsigned int width;\n> -\tunsigned int height;\n> -};\n> -\n> -struct ipa_control_info_map {\n> -\tunsigned int id;\n> -\tconst uint8_t *data;\n> -\tsize_t size;\n> -};\n> -\n> -struct ipa_buffer_plane {\n> -\tint dmabuf;\n> -\tsize_t length;\n> -};\n> -\n> -struct ipa_buffer {\n> -\tunsigned int id;\n> -\tunsigned int num_planes;\n> -\tstruct ipa_buffer_plane planes[3];\n> -};\n> -\n> -struct ipa_control_list {\n> -\tconst uint8_t *data;\n> -\tunsigned int size;\n> -};\n> -\n> -struct ipa_operation_data {\n> -\tunsigned int operation;\n> -\tconst uint32_t *data;\n> -\tunsigned int num_data;\n> -\tconst struct ipa_control_list *lists;\n> -\tunsigned int num_lists;\n> -};\n> -\n> -struct ipa_callback_ops {\n> -\tvoid (*queue_frame_action)(void *cb_ctx, unsigned int frame,\n> -\t\t\t\t   struct ipa_operation_data &data);\n> -};\n> -\n> -struct ipa_context_ops {\n> -\tvoid (*destroy)(struct ipa_context *ctx);\n> -\tvoid *(*get_interface)(struct ipa_context *ctx);\n> -\tvoid (*init)(struct ipa_context *ctx,\n> -\t\t     const struct ipa_settings *settings);\n> -\tint (*start)(struct ipa_context *ctx);\n> -\tvoid (*stop)(struct ipa_context *ctx);\n> -\tvoid (*register_callbacks)(struct ipa_context *ctx,\n> -\t\t\t\t   const struct ipa_callback_ops *callbacks,\n> -\t\t\t\t   void *cb_ctx);\n> -\tvoid (*configure)(struct ipa_context *ctx,\n> -\t\t\t  const struct ipa_sensor_info *sensor_info,\n> -\t\t\t  const struct ipa_stream *streams,\n> -\t\t\t  unsigned int num_streams,\n> -\t\t\t  const struct ipa_control_info_map *maps,\n> -\t\t\t  unsigned int num_maps);\n> -\tvoid (*map_buffers)(struct ipa_context *ctx,\n> -\t\t\t    const struct ipa_buffer *buffers,\n> -\t\t\t    size_t num_buffers);\n> -\tvoid (*unmap_buffers)(struct ipa_context *ctx, const unsigned int *ids,\n> -\t\t\t      size_t num_buffers);\n> -\tvoid (*process_event)(struct ipa_context *ctx,\n> -\t\t\t      const struct ipa_operation_data *data);\n> -};\n> -\n> -struct ipa_context *ipaCreate();\n> -\n> -#ifdef __cplusplus\n> -}\n> -\n>  #include <map>\n>  #include <vector>\n>\n> @@ -170,6 +65,5 @@ public:\n>  };\n>\n>  } /* namespace libcamera */\n> -#endif\n>\n>  #endif /* __LIBCAMERA_IPA_INTERFACE_H__ */\n> diff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp\n> deleted file mode 100644\n> index 231300ce..00000000\n> --- a/src/libcamera/ipa_context_wrapper.cpp\n> +++ /dev/null\n> @@ -1,297 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2019, Google Inc.\n> - *\n> - * ipa_context_wrapper.cpp - Image Processing Algorithm context wrapper\n> - */\n> -\n> -#include \"libcamera/internal/ipa_context_wrapper.h\"\n> -\n> -#include <vector>\n> -\n> -#include <libcamera/controls.h>\n> -\n> -#include \"libcamera/internal/byte_stream_buffer.h\"\n> -#include \"libcamera/internal/camera_sensor.h\"\n> -#include \"libcamera/internal/utils.h\"\n> -\n> -/**\n> - * \\file ipa_context_wrapper.h\n> - * \\brief Image Processing Algorithm context wrapper\n> - */\n> -\n> -namespace libcamera {\n> -\n> -/**\n> - * \\class IPAContextWrapper\n> - * \\brief Wrap an ipa_context and expose it as an IPAInterface\n> - *\n> - * The IPAContextWrapper class wraps an ipa_context, provided by an IPA module, and\n> - * exposes an IPAInterface. This mechanism is used for IPAs that are not\n> - * isolated in a separate process to allow direct calls from pipeline handler\n> - * using the IPAInterface API instead of the lower-level ipa_context API.\n> - *\n> - * The IPAInterface methods are converted to the ipa_context API by translating\n> - * all C++ arguments into plain C structures or byte arrays that contain no\n> - * pointer, as required by the ipa_context API.\n> - */\n> -\n> -/**\n> - * \\brief Construct an IPAContextWrapper instance that wraps the \\a context\n> - * \\param[in] context The IPA module context\n> - *\n> - * Ownership of the \\a context is passed to the IPAContextWrapper. The context remains\n> - * valid for the whole lifetime of the wrapper and is destroyed automatically\n> - * with it.\n> - */\n> -IPAContextWrapper::IPAContextWrapper(struct ipa_context *context)\n> -\t: ctx_(context), intf_(nullptr)\n> -{\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tbool forceCApi = !!utils::secure_getenv(\"LIBCAMERA_IPA_FORCE_C_API\");\n> -\n> -\tif (!forceCApi && ctx_ && ctx_->ops->get_interface) {\n> -\t\tintf_ = reinterpret_cast<IPAInterface *>(ctx_->ops->get_interface(ctx_));\n> -\t\tintf_->queueFrameAction.connect(this, &IPAContextWrapper::doQueueFrameAction);\n> -\t\treturn;\n> -\t}\n> -\n> -\tctx_->ops->register_callbacks(ctx_, &IPAContextWrapper::callbacks_,\n> -\t\t\t\t      this);\n> -}\n> -\n> -IPAContextWrapper::~IPAContextWrapper()\n> -{\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tctx_->ops->destroy(ctx_);\n> -}\n> -\n> -int IPAContextWrapper::init(const IPASettings &settings)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->init(settings);\n> -\n> -\tif (!ctx_)\n> -\t\treturn 0;\n> -\n> -\tstruct ipa_settings c_settings;\n> -\tc_settings.configuration_file = settings.configurationFile.c_str();\n> -\n> -\tctx_->ops->init(ctx_, &c_settings);\n> -\n> -\treturn 0;\n> -}\n> -\n> -int IPAContextWrapper::start()\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->start();\n> -\n> -\tif (!ctx_)\n> -\t\treturn 0;\n> -\n> -\treturn ctx_->ops->start(ctx_);\n> -}\n> -\n> -void IPAContextWrapper::stop()\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->stop();\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tctx_->ops->stop(ctx_);\n> -}\n> -\n> -void IPAContextWrapper::configure(const CameraSensorInfo &sensorInfo,\n> -\t\t\t\t  const std::map<unsigned int, IPAStream> &streamConfig,\n> -\t\t\t\t  const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n> -\t\t\t\t  const IPAOperationData &ipaConfig,\n> -\t\t\t\t  IPAOperationData *result)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->configure(sensorInfo, streamConfig,\n> -\t\t\t\t\tentityControls, ipaConfig, result);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tserializer_.reset();\n> -\n> -\t/* Translate the camera sensor info. */\n> -\tstruct ipa_sensor_info sensor_info = {};\n> -\tsensor_info.model = sensorInfo.model.c_str();\n> -\tsensor_info.bits_per_pixel = sensorInfo.bitsPerPixel;\n> -\tsensor_info.active_area.width = sensorInfo.activeAreaSize.width;\n> -\tsensor_info.active_area.height = sensorInfo.activeAreaSize.height;\n> -\tsensor_info.analog_crop.left = sensorInfo.analogCrop.x;\n> -\tsensor_info.analog_crop.top = sensorInfo.analogCrop.y;\n> -\tsensor_info.analog_crop.width = sensorInfo.analogCrop.width;\n> -\tsensor_info.analog_crop.height = sensorInfo.analogCrop.height;\n> -\tsensor_info.output_size.width = sensorInfo.outputSize.width;\n> -\tsensor_info.output_size.height = sensorInfo.outputSize.height;\n> -\tsensor_info.pixel_rate = sensorInfo.pixelRate;\n> -\tsensor_info.line_length = sensorInfo.lineLength;\n> -\n> -\t/* Translate the IPA stream configurations map. */\n> -\tstruct ipa_stream c_streams[streamConfig.size()];\n> -\n> -\tunsigned int i = 0;\n> -\tfor (const auto &stream : streamConfig) {\n> -\t\tstruct ipa_stream *c_stream = &c_streams[i];\n> -\t\tunsigned int id = stream.first;\n> -\t\tconst IPAStream &ipaStream = stream.second;\n> -\n> -\t\tc_stream->id = id;\n> -\t\tc_stream->pixel_format = ipaStream.pixelFormat;\n> -\t\tc_stream->width = ipaStream.size.width;\n> -\t\tc_stream->height = ipaStream.size.height;\n> -\n> -\t\t++i;\n> -\t}\n> -\n> -\t/* Translate the IPA entity controls map. */\n> -\tstruct ipa_control_info_map c_info_maps[entityControls.size()];\n> -\tstd::vector<std::vector<uint8_t>> data(entityControls.size());\n> -\n> -\ti = 0;\n> -\tfor (const auto &info : entityControls) {\n> -\t\tstruct ipa_control_info_map &c_info_map = c_info_maps[i];\n> -\t\tunsigned int id = info.first;\n> -\t\tconst ControlInfoMap &infoMap = info.second;\n> -\n> -\t\tsize_t infoMapSize = serializer_.binarySize(infoMap);\n> -\t\tdata[i].resize(infoMapSize);\n> -\t\tByteStreamBuffer byteStream(data[i].data(), data[i].size());\n> -\t\tserializer_.serialize(infoMap, byteStream);\n> -\n> -\t\tc_info_map.id = id;\n> -\t\tc_info_map.data = byteStream.base();\n> -\t\tc_info_map.size = byteStream.size();\n> -\n> -\t\t++i;\n> -\t}\n> -\n> -\t/* \\todo Translate the ipaConfig and reponse */\n> -\tctx_->ops->configure(ctx_, &sensor_info, c_streams, streamConfig.size(),\n> -\t\t\t     c_info_maps, entityControls.size());\n> -}\n> -\n> -void IPAContextWrapper::mapBuffers(const std::vector<IPABuffer> &buffers)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->mapBuffers(buffers);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tstruct ipa_buffer c_buffers[buffers.size()];\n> -\n> -\tfor (unsigned int i = 0; i < buffers.size(); ++i) {\n> -\t\tstruct ipa_buffer &c_buffer = c_buffers[i];\n> -\t\tconst IPABuffer &buffer = buffers[i];\n> -\t\tconst std::vector<FrameBuffer::Plane> &planes = buffer.planes;\n> -\n> -\t\tc_buffer.id = buffer.id;\n> -\t\tc_buffer.num_planes = planes.size();\n> -\n> -\t\tfor (unsigned int j = 0; j < planes.size(); ++j) {\n> -\t\t\tconst FrameBuffer::Plane &plane = planes[j];\n> -\t\t\tc_buffer.planes[j].dmabuf = plane.fd.fd();\n> -\t\t\tc_buffer.planes[j].length = plane.length;\n> -\t\t}\n> -\t}\n> -\n> -\tctx_->ops->map_buffers(ctx_, c_buffers, buffers.size());\n> -}\n> -\n> -void IPAContextWrapper::unmapBuffers(const std::vector<unsigned int> &ids)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->unmapBuffers(ids);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tctx_->ops->unmap_buffers(ctx_, ids.data(), ids.size());\n> -}\n> -\n> -void IPAContextWrapper::processEvent(const IPAOperationData &data)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->processEvent(data);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tstruct ipa_operation_data c_data;\n> -\tc_data.operation = data.operation;\n> -\tc_data.data = data.data.data();\n> -\tc_data.num_data = data.data.size();\n> -\n> -\tstruct ipa_control_list control_lists[data.controls.size()];\n> -\tc_data.lists = control_lists;\n> -\tc_data.num_lists = data.controls.size();\n> -\n> -\tstd::size_t listsSize = 0;\n> -\tfor (const auto &list : data.controls)\n> -\t\tlistsSize += serializer_.binarySize(list);\n> -\n> -\tstd::vector<uint8_t> binaryData(listsSize);\n> -\tByteStreamBuffer byteStreamBuffer(binaryData.data(), listsSize);\n> -\n> -\tunsigned int i = 0;\n> -\tfor (const auto &list : data.controls) {\n> -\t\tstruct ipa_control_list &c_list = control_lists[i];\n> -\t\tc_list.size = serializer_.binarySize(list);\n> -\t\tByteStreamBuffer b = byteStreamBuffer.carveOut(c_list.size);\n> -\n> -\t\tserializer_.serialize(list, b);\n> -\n> -\t\tc_list.data = b.base();\n> -\t}\n> -\n> -\tctx_->ops->process_event(ctx_, &c_data);\n> -}\n> -\n> -void IPAContextWrapper::doQueueFrameAction(unsigned int frame,\n> -\t\t\t\t\t   const IPAOperationData &data)\n> -{\n> -\tIPAInterface::queueFrameAction.emit(frame, data);\n> -}\n> -\n> -void IPAContextWrapper::queue_frame_action(void *ctx, unsigned int frame,\n> -\t\t\t\t\t   struct ipa_operation_data &data)\n> -{\n> -\tIPAContextWrapper *_this = static_cast<IPAContextWrapper *>(ctx);\n> -\tIPAOperationData opData;\n> -\n> -\topData.operation = data.operation;\n> -\tfor (unsigned int i = 0; i < data.num_data; ++i)\n> -\t\topData.data.push_back(data.data[i]);\n> -\n> -\tfor (unsigned int i = 0; i < data.num_lists; ++i) {\n> -\t\tconst struct ipa_control_list &c_list = data.lists[i];\n> -\t\tByteStreamBuffer b(c_list.data, c_list.size);\n> -\t\topData.controls.push_back(_this->serializer_.deserialize<ControlList>(b));\n> -\t}\n> -\n> -\t_this->doQueueFrameAction(frame, opData);\n> -}\n> -\n> -#ifndef __DOXYGEN__\n> -/*\n> - * This construct confuses Doxygen and makes it believe that all members of the\n> - * operations is a member of IPAContextWrapper. It must thus be hidden.\n> - */\n> -const struct ipa_callback_ops IPAContextWrapper::callbacks_ = {\n> -\t.queue_frame_action = &IPAContextWrapper::queue_frame_action,\n> -};\n> -#endif\n> -\n> -} /* namespace libcamera */\n> --\n> 2.27.0\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 86230BE082\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Nov 2020 16:09:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 577BF63325;\n\tTue, 17 Nov 2020 17:09:12 +0100 (CET)","from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 30ED86033B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Nov 2020 17:09:11 +0100 (CET)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id 879DC10001A;\n\tTue, 17 Nov 2020 16:09:10 +0000 (UTC)"],"Date":"Tue, 17 Nov 2020 17:09:12 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<20201117160912.5mddflexth4w4k5k@uno.localdomain>","References":"<20201106103707.49660-1-paul.elder@ideasonboard.com>\n\t<20201106103707.49660-15-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201106103707.49660-15-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 14/37] libcamera:\n\tipa_context_wrapper: Remove ipa_context_wrapper","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":13820,"web_url":"https://patchwork.libcamera.org/comment/13820/","msgid":"<20201120170929.GB17570@pendragon.ideasonboard.com>","date":"2020-11-20T17:09:29","subject":"Re: [libcamera-devel] [PATCH v4 14/37] libcamera:\n\tipa_context_wrapper: Remove ipa_context_wrapper","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Fri, Nov 06, 2020 at 07:36:44PM +0900, Paul Elder wrote:\n> Since ipa_context has been replaced with custom IPAInterfaces, it is not\n> longer needed. Remove it.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\nThe documentation of the IPAManager class still references the IPA\ncontext wrapper and ipa_context. With that fixed (probably in 13/37),\nsquashing this patch with 13/37 or keeping it separate,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n> No change in v4\n> \n> No change in v3\n> \n> New in v2\n> ---\n>  .../libcamera/internal/ipa_context_wrapper.h  |  52 ---\n>  include/libcamera/internal/meson.build        |   1 -\n>  include/libcamera/ipa/ipa_interface.h         | 106 -------\n>  src/libcamera/ipa_context_wrapper.cpp         | 297 ------------------\n>  4 files changed, 456 deletions(-)\n>  delete mode 100644 include/libcamera/internal/ipa_context_wrapper.h\n>  delete mode 100644 src/libcamera/ipa_context_wrapper.cpp\n> \n> diff --git a/include/libcamera/internal/ipa_context_wrapper.h b/include/libcamera/internal/ipa_context_wrapper.h\n> deleted file mode 100644\n> index 8f767e84..00000000\n> --- a/include/libcamera/internal/ipa_context_wrapper.h\n> +++ /dev/null\n> @@ -1,52 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2019, Google Inc.\n> - *\n> - * ipa_context_wrapper.h - Image Processing Algorithm context wrapper\n> - */\n> -#ifndef __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__\n> -#define __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__\n> -\n> -#include <libcamera/ipa/ipa_interface.h>\n> -\n> -#include \"libcamera/internal/control_serializer.h\"\n> -\n> -namespace libcamera {\n> -\n> -class IPAContextWrapper final : public IPAInterface\n> -{\n> -public:\n> -\tIPAContextWrapper(struct ipa_context *context);\n> -\t~IPAContextWrapper();\n> -\n> -\tint init(const IPASettings &settings) override;\n> -\tint start() override;\n> -\tvoid stop() override;\n> -\tvoid configure(const CameraSensorInfo &sensorInfo,\n> -\t\t       const std::map<unsigned int, IPAStream> &streamConfig,\n> -\t\t       const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n> -\t\t       const IPAOperationData &ipaConfig,\n> -\t\t       IPAOperationData *result) override;\n> -\n> -\tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n> -\tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n> -\n> -\tvirtual void processEvent(const IPAOperationData &data) override;\n> -\n> -private:\n> -\tstatic void queue_frame_action(void *ctx, unsigned int frame,\n> -\t\t\t\t       struct ipa_operation_data &data);\n> -\tstatic const struct ipa_callback_ops callbacks_;\n> -\n> -\tvoid doQueueFrameAction(unsigned int frame,\n> -\t\t\t\tconst IPAOperationData &data);\n> -\n> -\tstruct ipa_context *ctx_;\n> -\tIPAInterface *intf_;\n> -\n> -\tControlSerializer serializer_;\n> -};\n> -\n> -} /* namespace libcamera */\n> -\n> -#endif /* __LIBCAMERA_INTERNAL_IPA_CONTEXT_WRAPPER_H__ */\n> diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build\n> index 6500fe2a..592635a9 100644\n> --- a/include/libcamera/internal/meson.build\n> +++ b/include/libcamera/internal/meson.build\n> @@ -21,7 +21,6 @@ libcamera_internal_headers = files([\n>      'event_dispatcher_poll.h',\n>      'file.h',\n>      'formats.h',\n> -    'ipa_context_wrapper.h',\n>      'ipa_manager.h',\n>      'ipa_module.h',\n>      'ipa_proxy.h',\n> diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h\n> index 322b7079..48766b22 100644\n> --- a/include/libcamera/ipa/ipa_interface.h\n> +++ b/include/libcamera/ipa/ipa_interface.h\n> @@ -10,111 +10,6 @@\n>  #include <stddef.h>\n>  #include <stdint.h>\n>  \n> -#ifdef __cplusplus\n> -extern \"C\" {\n> -#endif\n> -\n> -struct ipa_context {\n> -\tconst struct ipa_context_ops *ops;\n> -};\n> -\n> -struct ipa_settings {\n> -\tconst char *configuration_file;\n> -};\n> -\n> -struct ipa_sensor_info {\n> -\tconst char *model;\n> -\tuint8_t bits_per_pixel;\n> -\tstruct {\n> -\t\tuint32_t width;\n> -\t\tuint32_t height;\n> -\t} active_area;\n> -\tstruct {\n> -\t\tint32_t left;\n> -\t\tint32_t top;\n> -\t\tuint32_t width;\n> -\t\tuint32_t height;\n> -\t} analog_crop;\n> -\tstruct {\n> -\t\tuint32_t width;\n> -\t\tuint32_t height;\n> -\t} output_size;\n> -\tuint64_t pixel_rate;\n> -\tuint32_t line_length;\n> -};\n> -\n> -struct ipa_stream {\n> -\tunsigned int id;\n> -\tunsigned int pixel_format;\n> -\tunsigned int width;\n> -\tunsigned int height;\n> -};\n> -\n> -struct ipa_control_info_map {\n> -\tunsigned int id;\n> -\tconst uint8_t *data;\n> -\tsize_t size;\n> -};\n> -\n> -struct ipa_buffer_plane {\n> -\tint dmabuf;\n> -\tsize_t length;\n> -};\n> -\n> -struct ipa_buffer {\n> -\tunsigned int id;\n> -\tunsigned int num_planes;\n> -\tstruct ipa_buffer_plane planes[3];\n> -};\n> -\n> -struct ipa_control_list {\n> -\tconst uint8_t *data;\n> -\tunsigned int size;\n> -};\n> -\n> -struct ipa_operation_data {\n> -\tunsigned int operation;\n> -\tconst uint32_t *data;\n> -\tunsigned int num_data;\n> -\tconst struct ipa_control_list *lists;\n> -\tunsigned int num_lists;\n> -};\n> -\n> -struct ipa_callback_ops {\n> -\tvoid (*queue_frame_action)(void *cb_ctx, unsigned int frame,\n> -\t\t\t\t   struct ipa_operation_data &data);\n> -};\n> -\n> -struct ipa_context_ops {\n> -\tvoid (*destroy)(struct ipa_context *ctx);\n> -\tvoid *(*get_interface)(struct ipa_context *ctx);\n> -\tvoid (*init)(struct ipa_context *ctx,\n> -\t\t     const struct ipa_settings *settings);\n> -\tint (*start)(struct ipa_context *ctx);\n> -\tvoid (*stop)(struct ipa_context *ctx);\n> -\tvoid (*register_callbacks)(struct ipa_context *ctx,\n> -\t\t\t\t   const struct ipa_callback_ops *callbacks,\n> -\t\t\t\t   void *cb_ctx);\n> -\tvoid (*configure)(struct ipa_context *ctx,\n> -\t\t\t  const struct ipa_sensor_info *sensor_info,\n> -\t\t\t  const struct ipa_stream *streams,\n> -\t\t\t  unsigned int num_streams,\n> -\t\t\t  const struct ipa_control_info_map *maps,\n> -\t\t\t  unsigned int num_maps);\n> -\tvoid (*map_buffers)(struct ipa_context *ctx,\n> -\t\t\t    const struct ipa_buffer *buffers,\n> -\t\t\t    size_t num_buffers);\n> -\tvoid (*unmap_buffers)(struct ipa_context *ctx, const unsigned int *ids,\n> -\t\t\t      size_t num_buffers);\n> -\tvoid (*process_event)(struct ipa_context *ctx,\n> -\t\t\t      const struct ipa_operation_data *data);\n> -};\n> -\n> -struct ipa_context *ipaCreate();\n> -\n> -#ifdef __cplusplus\n> -}\n> -\n>  #include <map>\n>  #include <vector>\n>  \n> @@ -170,6 +65,5 @@ public:\n>  };\n>  \n>  } /* namespace libcamera */\n> -#endif\n>  \n>  #endif /* __LIBCAMERA_IPA_INTERFACE_H__ */\n> diff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp\n> deleted file mode 100644\n> index 231300ce..00000000\n> --- a/src/libcamera/ipa_context_wrapper.cpp\n> +++ /dev/null\n> @@ -1,297 +0,0 @@\n> -/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> -/*\n> - * Copyright (C) 2019, Google Inc.\n> - *\n> - * ipa_context_wrapper.cpp - Image Processing Algorithm context wrapper\n> - */\n> -\n> -#include \"libcamera/internal/ipa_context_wrapper.h\"\n> -\n> -#include <vector>\n> -\n> -#include <libcamera/controls.h>\n> -\n> -#include \"libcamera/internal/byte_stream_buffer.h\"\n> -#include \"libcamera/internal/camera_sensor.h\"\n> -#include \"libcamera/internal/utils.h\"\n> -\n> -/**\n> - * \\file ipa_context_wrapper.h\n> - * \\brief Image Processing Algorithm context wrapper\n> - */\n> -\n> -namespace libcamera {\n> -\n> -/**\n> - * \\class IPAContextWrapper\n> - * \\brief Wrap an ipa_context and expose it as an IPAInterface\n> - *\n> - * The IPAContextWrapper class wraps an ipa_context, provided by an IPA module, and\n> - * exposes an IPAInterface. This mechanism is used for IPAs that are not\n> - * isolated in a separate process to allow direct calls from pipeline handler\n> - * using the IPAInterface API instead of the lower-level ipa_context API.\n> - *\n> - * The IPAInterface methods are converted to the ipa_context API by translating\n> - * all C++ arguments into plain C structures or byte arrays that contain no\n> - * pointer, as required by the ipa_context API.\n> - */\n> -\n> -/**\n> - * \\brief Construct an IPAContextWrapper instance that wraps the \\a context\n> - * \\param[in] context The IPA module context\n> - *\n> - * Ownership of the \\a context is passed to the IPAContextWrapper. The context remains\n> - * valid for the whole lifetime of the wrapper and is destroyed automatically\n> - * with it.\n> - */\n> -IPAContextWrapper::IPAContextWrapper(struct ipa_context *context)\n> -\t: ctx_(context), intf_(nullptr)\n> -{\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tbool forceCApi = !!utils::secure_getenv(\"LIBCAMERA_IPA_FORCE_C_API\");\n> -\n> -\tif (!forceCApi && ctx_ && ctx_->ops->get_interface) {\n> -\t\tintf_ = reinterpret_cast<IPAInterface *>(ctx_->ops->get_interface(ctx_));\n> -\t\tintf_->queueFrameAction.connect(this, &IPAContextWrapper::doQueueFrameAction);\n> -\t\treturn;\n> -\t}\n> -\n> -\tctx_->ops->register_callbacks(ctx_, &IPAContextWrapper::callbacks_,\n> -\t\t\t\t      this);\n> -}\n> -\n> -IPAContextWrapper::~IPAContextWrapper()\n> -{\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tctx_->ops->destroy(ctx_);\n> -}\n> -\n> -int IPAContextWrapper::init(const IPASettings &settings)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->init(settings);\n> -\n> -\tif (!ctx_)\n> -\t\treturn 0;\n> -\n> -\tstruct ipa_settings c_settings;\n> -\tc_settings.configuration_file = settings.configurationFile.c_str();\n> -\n> -\tctx_->ops->init(ctx_, &c_settings);\n> -\n> -\treturn 0;\n> -}\n> -\n> -int IPAContextWrapper::start()\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->start();\n> -\n> -\tif (!ctx_)\n> -\t\treturn 0;\n> -\n> -\treturn ctx_->ops->start(ctx_);\n> -}\n> -\n> -void IPAContextWrapper::stop()\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->stop();\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tctx_->ops->stop(ctx_);\n> -}\n> -\n> -void IPAContextWrapper::configure(const CameraSensorInfo &sensorInfo,\n> -\t\t\t\t  const std::map<unsigned int, IPAStream> &streamConfig,\n> -\t\t\t\t  const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n> -\t\t\t\t  const IPAOperationData &ipaConfig,\n> -\t\t\t\t  IPAOperationData *result)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->configure(sensorInfo, streamConfig,\n> -\t\t\t\t\tentityControls, ipaConfig, result);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tserializer_.reset();\n> -\n> -\t/* Translate the camera sensor info. */\n> -\tstruct ipa_sensor_info sensor_info = {};\n> -\tsensor_info.model = sensorInfo.model.c_str();\n> -\tsensor_info.bits_per_pixel = sensorInfo.bitsPerPixel;\n> -\tsensor_info.active_area.width = sensorInfo.activeAreaSize.width;\n> -\tsensor_info.active_area.height = sensorInfo.activeAreaSize.height;\n> -\tsensor_info.analog_crop.left = sensorInfo.analogCrop.x;\n> -\tsensor_info.analog_crop.top = sensorInfo.analogCrop.y;\n> -\tsensor_info.analog_crop.width = sensorInfo.analogCrop.width;\n> -\tsensor_info.analog_crop.height = sensorInfo.analogCrop.height;\n> -\tsensor_info.output_size.width = sensorInfo.outputSize.width;\n> -\tsensor_info.output_size.height = sensorInfo.outputSize.height;\n> -\tsensor_info.pixel_rate = sensorInfo.pixelRate;\n> -\tsensor_info.line_length = sensorInfo.lineLength;\n> -\n> -\t/* Translate the IPA stream configurations map. */\n> -\tstruct ipa_stream c_streams[streamConfig.size()];\n> -\n> -\tunsigned int i = 0;\n> -\tfor (const auto &stream : streamConfig) {\n> -\t\tstruct ipa_stream *c_stream = &c_streams[i];\n> -\t\tunsigned int id = stream.first;\n> -\t\tconst IPAStream &ipaStream = stream.second;\n> -\n> -\t\tc_stream->id = id;\n> -\t\tc_stream->pixel_format = ipaStream.pixelFormat;\n> -\t\tc_stream->width = ipaStream.size.width;\n> -\t\tc_stream->height = ipaStream.size.height;\n> -\n> -\t\t++i;\n> -\t}\n> -\n> -\t/* Translate the IPA entity controls map. */\n> -\tstruct ipa_control_info_map c_info_maps[entityControls.size()];\n> -\tstd::vector<std::vector<uint8_t>> data(entityControls.size());\n> -\n> -\ti = 0;\n> -\tfor (const auto &info : entityControls) {\n> -\t\tstruct ipa_control_info_map &c_info_map = c_info_maps[i];\n> -\t\tunsigned int id = info.first;\n> -\t\tconst ControlInfoMap &infoMap = info.second;\n> -\n> -\t\tsize_t infoMapSize = serializer_.binarySize(infoMap);\n> -\t\tdata[i].resize(infoMapSize);\n> -\t\tByteStreamBuffer byteStream(data[i].data(), data[i].size());\n> -\t\tserializer_.serialize(infoMap, byteStream);\n> -\n> -\t\tc_info_map.id = id;\n> -\t\tc_info_map.data = byteStream.base();\n> -\t\tc_info_map.size = byteStream.size();\n> -\n> -\t\t++i;\n> -\t}\n> -\n> -\t/* \\todo Translate the ipaConfig and reponse */\n> -\tctx_->ops->configure(ctx_, &sensor_info, c_streams, streamConfig.size(),\n> -\t\t\t     c_info_maps, entityControls.size());\n> -}\n> -\n> -void IPAContextWrapper::mapBuffers(const std::vector<IPABuffer> &buffers)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->mapBuffers(buffers);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tstruct ipa_buffer c_buffers[buffers.size()];\n> -\n> -\tfor (unsigned int i = 0; i < buffers.size(); ++i) {\n> -\t\tstruct ipa_buffer &c_buffer = c_buffers[i];\n> -\t\tconst IPABuffer &buffer = buffers[i];\n> -\t\tconst std::vector<FrameBuffer::Plane> &planes = buffer.planes;\n> -\n> -\t\tc_buffer.id = buffer.id;\n> -\t\tc_buffer.num_planes = planes.size();\n> -\n> -\t\tfor (unsigned int j = 0; j < planes.size(); ++j) {\n> -\t\t\tconst FrameBuffer::Plane &plane = planes[j];\n> -\t\t\tc_buffer.planes[j].dmabuf = plane.fd.fd();\n> -\t\t\tc_buffer.planes[j].length = plane.length;\n> -\t\t}\n> -\t}\n> -\n> -\tctx_->ops->map_buffers(ctx_, c_buffers, buffers.size());\n> -}\n> -\n> -void IPAContextWrapper::unmapBuffers(const std::vector<unsigned int> &ids)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->unmapBuffers(ids);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tctx_->ops->unmap_buffers(ctx_, ids.data(), ids.size());\n> -}\n> -\n> -void IPAContextWrapper::processEvent(const IPAOperationData &data)\n> -{\n> -\tif (intf_)\n> -\t\treturn intf_->processEvent(data);\n> -\n> -\tif (!ctx_)\n> -\t\treturn;\n> -\n> -\tstruct ipa_operation_data c_data;\n> -\tc_data.operation = data.operation;\n> -\tc_data.data = data.data.data();\n> -\tc_data.num_data = data.data.size();\n> -\n> -\tstruct ipa_control_list control_lists[data.controls.size()];\n> -\tc_data.lists = control_lists;\n> -\tc_data.num_lists = data.controls.size();\n> -\n> -\tstd::size_t listsSize = 0;\n> -\tfor (const auto &list : data.controls)\n> -\t\tlistsSize += serializer_.binarySize(list);\n> -\n> -\tstd::vector<uint8_t> binaryData(listsSize);\n> -\tByteStreamBuffer byteStreamBuffer(binaryData.data(), listsSize);\n> -\n> -\tunsigned int i = 0;\n> -\tfor (const auto &list : data.controls) {\n> -\t\tstruct ipa_control_list &c_list = control_lists[i];\n> -\t\tc_list.size = serializer_.binarySize(list);\n> -\t\tByteStreamBuffer b = byteStreamBuffer.carveOut(c_list.size);\n> -\n> -\t\tserializer_.serialize(list, b);\n> -\n> -\t\tc_list.data = b.base();\n> -\t}\n> -\n> -\tctx_->ops->process_event(ctx_, &c_data);\n> -}\n> -\n> -void IPAContextWrapper::doQueueFrameAction(unsigned int frame,\n> -\t\t\t\t\t   const IPAOperationData &data)\n> -{\n> -\tIPAInterface::queueFrameAction.emit(frame, data);\n> -}\n> -\n> -void IPAContextWrapper::queue_frame_action(void *ctx, unsigned int frame,\n> -\t\t\t\t\t   struct ipa_operation_data &data)\n> -{\n> -\tIPAContextWrapper *_this = static_cast<IPAContextWrapper *>(ctx);\n> -\tIPAOperationData opData;\n> -\n> -\topData.operation = data.operation;\n> -\tfor (unsigned int i = 0; i < data.num_data; ++i)\n> -\t\topData.data.push_back(data.data[i]);\n> -\n> -\tfor (unsigned int i = 0; i < data.num_lists; ++i) {\n> -\t\tconst struct ipa_control_list &c_list = data.lists[i];\n> -\t\tByteStreamBuffer b(c_list.data, c_list.size);\n> -\t\topData.controls.push_back(_this->serializer_.deserialize<ControlList>(b));\n> -\t}\n> -\n> -\t_this->doQueueFrameAction(frame, opData);\n> -}\n> -\n> -#ifndef __DOXYGEN__\n> -/*\n> - * This construct confuses Doxygen and makes it believe that all members of the\n> - * operations is a member of IPAContextWrapper. It must thus be hidden.\n> - */\n> -const struct ipa_callback_ops IPAContextWrapper::callbacks_ = {\n> -\t.queue_frame_action = &IPAContextWrapper::queue_frame_action,\n> -};\n> -#endif\n> -\n> -} /* namespace libcamera */","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D1422BE176\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Nov 2020 17:09:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4973B625AC;\n\tFri, 20 Nov 2020 18:09:39 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A30B96220D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Nov 2020 18:09:37 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1EA7B240;\n\tFri, 20 Nov 2020 18:09:37 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"WXhBROMY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1605892177;\n\tbh=BS+uDkqM0+EJnBfNOIMuBopXg6jfeKWrTCM0Fy78YvQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=WXhBROMYWf3StX/npaMvxkSdPjwqDMqlwxALQkE82yeiQn0AWq24E7w+Q03MfVgC2\n\t2GfkMUhH0+tipNqGg26aVteFCLUIJPEu9TA2xFm/D6YJJCVu5tzR7agS/T3TbO5K0x\n\tqMpIpImyckAoAjeYfBDxwuHBRaW4DOexSIalkH/c=","Date":"Fri, 20 Nov 2020 19:09:29 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<20201120170929.GB17570@pendragon.ideasonboard.com>","References":"<20201106103707.49660-1-paul.elder@ideasonboard.com>\n\t<20201106103707.49660-15-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201106103707.49660-15-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v4 14/37] libcamera:\n\tipa_context_wrapper: Remove ipa_context_wrapper","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]