Show a patch.

GET /api/1.1/patches/8908/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 8908,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/8908/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/8908/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20200721154308.106484-1-paul.elder@ideasonboard.com>",
    "date": "2020-07-21T15:43:07",
    "name": "[libcamera-devel,DO,NOT,MERGE,RFC] IPA: raspberrypi: Sample IPA data structure IDL definition and output",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "8f7067c5b79205875f55ee1a8c62ded42c8d8ed2",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/8908/mbox/",
    "series": [
        {
            "id": 1124,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1124/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1124",
            "date": "2020-07-21T15:43:07",
            "name": "[libcamera-devel,DO,NOT,MERGE,RFC] IPA: raspberrypi: Sample IPA data structure IDL definition and output",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1124/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/8908/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/8908/checks/",
    "tags": {},
    "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 1625BC2E68\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 21 Jul 2020 15:43:22 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9C34560907;\n\tTue, 21 Jul 2020 17:43:21 +0200 (CEST)",
            "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 D342B60554\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Jul 2020 17:43:19 +0200 (CEST)",
            "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E3A7151A;\n\tTue, 21 Jul 2020 17:43:17 +0200 (CEST)"
        ],
        "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=\"qhknHKTy\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1595346199;\n\tbh=u1oMt7qvVCD6818OpBaq8IFBQqQWRbm2JzOlGXw38nE=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=qhknHKTywZgFyWJSCUBkoMUx65H01TlQEhC65ZEKfVpLUpZjmnzAutZofnP8pCGrO\n\t5cn4CTbhmmiEY1X5Yb7ZbY37OAp9F/W4wOfVVul6monl8/h1H9b+2+zZq5tAAnVUcb\n\tS8Ila6exniui9I2A7/qDofdku5neTD7Pf38mUMig=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 22 Jul 2020 00:43:07 +0900",
        "Message-Id": "<20200721154308.106484-1-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [DO NOT MERGE] [RFC PATCH] IPA: raspberrypi:\n\tSample IPA data structure IDL definition and output",
        "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>",
        "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>"
    },
    "content": "In this whole patch, keep in mind that whenever flatbuffers is\nmentioned, it could be replaced by anything else, such as protobuf.\n\nAlso, in general, naming of anything is flexible. I tried to chose\nreasonable placeholders to show how things would work.\n\nI have not yet done the theoretical plumbing. I wanted to get this draft\nout first at least, before continuing too far without feedback.\n\nNote that transferring file descriptors is not included in this draft.\nI plan to implement this with a fieldPath->fd map that will be populated\nand propagated upon serialization, and then the fds can be transformed by\nthe IPAProxy as the data passes the process boundary, and then the fds\ncan be restored upon deserialization with the map.\n\n* Introduction\n\nraspberrypi.libcamera.decl shows a sample custom IPA data structure IDL\ndefinition for the raspberrypi pipeline handler. The intent is that I\nwill implement a custom compiler that will compile this definition into\nflatbuffers, as well as the header that will be included in the pipeline\nhandler and the IPA. flatbuffers will compile the flatbuffers definition\ninto the flatbuffers header that the included header will use for serdes.\n\nThe purpose of this custom IPA data structure definition is to allow\npipeline handlers and IPAs to use custom data structures for configure,\nprocessEvent, and queueFrameAction, rather than the rigid\nIPAOperationData. Hooking it up with framebuffers, and the compiler that\nI inted to write, will implement serdes for these custom data structures\nthat the IPAProxies can use.\n\nraspberrypi.fbs shows the intended output of the compiler that I intend\nto write, which will be in the input to the flatbuffers compiler.\n\nraspberrypi_wrapper.h shows the other intended output of the of the\ncompiler that I inted to write. This is the header that will be included\nby the pipeline handler and the IPA. The structs that are defined in\nthis header can be used directly by the pipeline handler and IPA, and\nthe serialize function and the deserialization constructor are meant to\nbe used by the IPAProxy (maybe they could be made private and IPAProxy\ninto a friend class?).\n\nThe custom compiler is necessary to place restrictions on the allowed\ndata definitions and make the definitions cleaner based on the\nrestrictions, as well as generate a header that is a wrapper around the\nflatbuffers-generated header for the pipeline handler and IPA to include.\n\n* Custom data definition file\n\nraspberrypi.libcamera.decl\n\nThere are three different types of custom data structures that must be\ndefined, for the three IPA functions that take IPAOperationData:\n- configure (for IPAInterface::configure())\n- event (for IPAInterface::processEvent())\n- action (for IPAInterface::queueFrameAction)\n\nDiscussion point: should configure have a separate input and output data\ndefinition?\n\nSince all three have an \"opcode\" and a payload, that is all that needs\nto be defined. The opcodes can be seen in the enums ConfigOps, EventOps,\nand ActionOps. The payloads can be seen in the unions ConfigPayload,\nEventPayload, and ActionPayload. Since the opcodes are essentially\nselectors into the unions, which field of the union the opcode points to\nmust be specified as shown in the enums.\n\nDiscussion point: ConfigPayload will become an element in a vector, so\nthere can be multiple instances of in in a single configure() call.\nConversely, EventPayload and ActionPayload are scalars in\nprocessEvent() and queueFrameAction. Should they be vectorized like\nConfigPayload?\n\nThese opcode and payload definitions are the only required components of\nthe custom data definition. Once these are satisfied, the rest of the\nfile follows standard flatbuffers rules.\n\nAlso, since flatbuffers structs are a bit of a pain, I've decided to\nonly allow flatbuffers tables in the definition. In C++ (and C if I ever\nhave to implement that compiler too...) they're wrapped as structs\nthough.\n\nUnions cannot have unions as a direct child.\n\n* flatbuffers input file\n\nraspberrypi.fbs is the intended output with raspberrypi.libcamera.decl,\nas described above.\n\nSome things to note...\n\n- RPiConfigParameters is not flags. I decided that rather than scanning\n  flags and parsing a vector payload based on that, it would be better\n  to have a vector of opcode-payload pairs.\n\n- NONE needs to be added to enums to appease flatbuffers. One of the\n  many reasons why I think we should have a custom data definition to\n  make writing the data definition cleaner for developers.\n\n- In flatbuffers, primitives cannot be members of unions. I'll add a\n  global header that defines wrappers around primitives. In the custom\n  data definition they are allowed, though. My compiler shall convert\n  them to the wrapper.\n\n- libcamera already comes with a really nice ControlList serdes. In the\n  flatbuffers global header I'll add the ControlList definition that is\n  seen here. It's just defined as a byte array, so we can use\n  libcamera's ControlList serializer. It does need to be renamed,\n  though.\n\n- As mentioned earlier, RPiConfigParams has a vector of opcode-payload\n  pairs, while RPiEventParams and RPiActionParams have a single\n  opcode-payload pair\n\n* Custom generated header\n\nraspberrypi_wrapper.h\n\nflatbuffers will compile the flatbuffers input file into a flatbuffers\nheader that can be included. This file cannot be used directly by\npipeline handlers and IPAs without them directly interfacing with\nflatbuffers and its API. Thus, a custom header will also be generated by\nthe compiler that I'll implement. This custom header implements wrappers\nfor the data structures defined in the custom data definition file for\npipeline handlers and IPAs to use, as well as serialize and deserialize\nfunctions for the proxies to use. The intended output of this header can\nbe seen in raspberrypi_wrapper.h.\n\nThe structs and enums and unions defined in this header can be used by\npipeline handlers and IPAs as-is (ie. no special API like flatbuffers).\n\nDiscussion point: maybe make the serialize function and deserialization\nconstructor private and make IPAProxy a friend class?\n\nA Serializable class is reference but never defined. This class is meant\nto simply have a serialize() function (deserialize is implemented as an\noverloaded constructor). This class might not even be necessary.\n\nThere are a couple helpers for serializing and deserializing\nControlList such that it can work well with the flatbuffers data\nstructures. I got the implementation from the test for\nControlSerializer.\n\nThere are a few rules for the compilation...\n\n- unions and enums are as-is\n\n- tables are compiled with its members as member variables, and have\n  three constructors, 1) empty default, 2) define all members, and\n  3) deserialization constructor. They also get a serialize function\n  that takes a flatbuffer builder and outputs a flatbuffer offset. This\n  allows recursion to do serialization. Only the top-level\n  (RPiConfigureParamsWrapper, RPiEventParamsWrapper,\n  RPiActionParamsWrapper) tables get a serialize functions that takes\n  void and returns a pair of byte array and length.\n\n- serialization is implemented as:\n  - for every member variable:\n    - if it is primitive, nop\n    - if it is controls, call serializeControlList\n    - if it is table, call table's serialize\n    - if it is a vector, convert the vector to a vector of flatbuffer\n      offsets by serializing every member based on the above three rules\n    - if it is a union:\n      - switch on opcode:\n        - set union type based on opcode\n        - set union content based on the same above four rules\n  - call flatbuffer's create object with all the serialized members\n\n- deserialization is implemented as a constructor. top-level tables take\n  a pointer to a byte array as input, while non-top-level tables take a\n  pointer to a byte array casted to the flatbuffers object. If the table\n  is used in a vector anywhere in the data definition, there will be\n  another deserialization constructor that takes a flatbuffer offset.\n  - cast input to flatbuffers offset (if necessary)\n  - for every member variable:\n    - if it is primitive, set the member variable\n    - if it is controls, set member variable with deserializeControlList\n    - if it is table, construct the table with the deserialization\n      constructor, and set the member variable\n    - if it is vector, convert the vector of flatbuffer offsets into the\n      vector of the member variable by deserializing based on the above\n      three rules\n    - if it is union:\n      - switch on opcode:\n        - set member variable union content based on same above four rules\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n include/libcamera/ipa/raspberrypi.fbs         |  99 ++++\n include/libcamera/ipa/raspberrypi.h           |  18 -\n .../libcamera/ipa/raspberrypi.libcamera.decl  |  75 +++\n include/libcamera/ipa/raspberrypi_wrapper.h   | 466 ++++++++++++++++++\n 4 files changed, 640 insertions(+), 18 deletions(-)\n create mode 100644 include/libcamera/ipa/raspberrypi.fbs\n create mode 100644 include/libcamera/ipa/raspberrypi.libcamera.decl\n create mode 100644 include/libcamera/ipa/raspberrypi_wrapper.h",
    "diff": "diff --git a/include/libcamera/ipa/raspberrypi.fbs b/include/libcamera/ipa/raspberrypi.fbs\nnew file mode 100644\nindex 0000000..15ec84a\n--- /dev/null\n+++ b/include/libcamera/ipa/raspberrypi.fbs\n@@ -0,0 +1,99 @@\n+enum RPiConfigParameters:uint16 {\n+\tNONE = 0,\n+\tRPI_IPA_CONFIG_LS_TABLE,\n+\tRPI_IPA_CONFIG_STAGGERED_WRITE,\n+\tRPI_IPA_CONFIG_SENSOR,\n+}\n+\n+enum RPiEvents:uint16 {\n+\tNONE = 0,\n+\tRPI_IPA_EVENT_SIGNAL_STAT_READY,\n+\tRPI_IPA_EVENT_SIGNAL_ISP_PREPARE,\n+\tRPI_IPA_EVENT_QUEUE_REQUEST,\n+}\n+\n+enum RPiActions:uint16 {\n+\tNONE = 0,\n+\tRPI_IPA_ACTION_V4L2_SET_STAGGERED,\n+\tRPI_IPA_ACTION_V4L2_SET_ISP,\n+\tRPI_IPA_ACTION_STATS_METADATA_COMPLETE,\n+\tRPI_IPA_ACTION_RUN_ISP,\n+\tRPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME,\n+\tRPI_IPA_ACTION_EMBEDDED_COMPLETE,\n+}\n+\n+// TODO define this for all primitive types, and make global\n+table UnsignedInt {\n+\tvalue:uint32;\n+}\n+\n+// TODO make this global\n+// TODO rename this\n+table ControlList {\n+\tlist:[uint8];\n+}\n+\n+// Data containers\n+\n+table RPiStaggeredWritePayload {\n+\tgainDelay:uint32;\n+\texposureDelay:uint32;\n+\tsensorMetadata:uint32;\n+}\n+\n+table RPiIspPreparePayload {\n+\tembeddedbufferId:uint32;\n+\tbayerbufferId:uint32;\n+}\n+\n+table RPiStatsCompletePayload {\n+\tbufferId:uint32;\n+\tcontrols:ControlList;\n+}\n+\n+\n+// Payload unions\n+\n+union RPiConfigureUnion {\n+\tlsTableHandle:UnsignedInt,\n+\tstaggeredWriteResult:RPiStaggeredWritePayload,\n+\tcontrols:ControlList,\n+}\n+\n+table RPiConfigurePayload {\n+        op:RPiConfigParameters;\n+\tpayload:RPiConfigureUnion;\n+}\n+\n+union RPiEventPayload {\n+\tbufferId:UnsignedInt,\n+\tispPrepare:RPiIspPreparePayload,\n+\tcontrols:ControlList,\n+}\n+\n+union RPiActionPayload {\n+\tbufferId:UnsignedInt,\n+\tstatsComplete:RPiStatsCompletePayload,\n+\tcontrols:ControlList,\n+}\n+\n+\n+// IPA function parameters\n+\n+table RPiConfigParams {\n+\tparams:[RPiConfigurePayload];\n+}\n+\n+table RPiEventParams {\n+\tev:RPiEvents;\n+\tpayload:RPiEventPayload;\n+}\n+\n+table RPiActionParams {\n+\top:RPiActions;\n+\tpayload:RPiActionPayload;\n+}\n+\n+root_type RPiConfigureParams;\n+root_type RPiEventParams;\n+root_type RPiActionParams;\ndiff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\nindex a493776..69b3808 100644\n--- a/include/libcamera/ipa/raspberrypi.h\n+++ b/include/libcamera/ipa/raspberrypi.h\n@@ -10,24 +10,6 @@\n #include <libcamera/control_ids.h>\n #include <libcamera/controls.h>\n \n-enum RPiConfigParameters {\n-\tRPI_IPA_CONFIG_LS_TABLE = (1 << 0),\n-\tRPI_IPA_CONFIG_STAGGERED_WRITE = (1 << 1),\n-\tRPI_IPA_CONFIG_SENSOR = (1 << 2),\n-};\n-\n-enum RPiOperations {\n-\tRPI_IPA_ACTION_V4L2_SET_STAGGERED = 1,\n-\tRPI_IPA_ACTION_V4L2_SET_ISP,\n-\tRPI_IPA_ACTION_STATS_METADATA_COMPLETE,\n-\tRPI_IPA_ACTION_RUN_ISP,\n-\tRPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME,\n-\tRPI_IPA_ACTION_EMBEDDED_COMPLETE,\n-\tRPI_IPA_EVENT_SIGNAL_STAT_READY,\n-\tRPI_IPA_EVENT_SIGNAL_ISP_PREPARE,\n-\tRPI_IPA_EVENT_QUEUE_REQUEST,\n-};\n-\n enum RPiIpaMask {\n \tID\t\t= 0x0ffff,\n \tSTATS\t\t= 0x10000,\ndiff --git a/include/libcamera/ipa/raspberrypi.libcamera.decl b/include/libcamera/ipa/raspberrypi.libcamera.decl\nnew file mode 100644\nindex 0000000..bd8c9c7\n--- /dev/null\n+++ b/include/libcamera/ipa/raspberrypi.libcamera.decl\n@@ -0,0 +1,75 @@\n+namespace RPi;\n+\n+// opcodes\n+// these must be enums, and must be named as shown\n+\n+// required\n+// must specify which union option each value corresponds to\n+enum ConfigOps {\n+\tRPI_IPA_CONFIG_LS_TABLE:lsTableHandle,\n+\tRPI_IPA_CONFIG_STAGGERED_WRITE:staggeredWriteResult,\n+\tRPI_IPA_CONFIG_SENSOR:controls,\n+}\n+\n+// required\n+// must specify which union option each value corresponds to\n+enum EventOps {\n+\tRPI_IPA_EVENT_SIGNAL_STAT_READY:bufferId,\n+\tRPI_IPA_EVENT_SIGNAL_ISP_PREPARE:ispPrepare,\n+\tRPI_IPA_EVENT_QUEUE_REQUEST:controls,\n+}\n+\n+// required\n+// must specify which union option each value corresponds to\n+enum ActionOps {\n+\tRPI_IPA_ACTION_V4L2_SET_STAGGERED:controls,\n+\tRPI_IPA_ACTION_V4L2_SET_ISP:controls,\n+\tRPI_IPA_ACTION_STATS_METADATA_COMPLETE:statsComplete,\n+\tRPI_IPA_ACTION_RUN_ISP:bufferId,\n+\tRPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME:bufferId,\n+\tRPI_IPA_ACTION_EMBEDDED_COMPLETE:bufferId,\n+}\n+\n+// Custom Data containers\n+\n+table RPiStaggeredWritePayload {\n+\tgainDelay:uint32;\n+\texposureDelay:uint32;\n+\tsensorMetadata:uint32;\n+}\n+\n+table RPiIspPreparePayload {\n+\tembeddedbufferId:uint32;\n+\tbayerbufferId:uint32;\n+}\n+\n+table RPiStatsCompletePayload {\n+\tbufferId:uint32;\n+\tcontrols:ControlList;\n+}\n+\n+\n+// First level payload unions\n+// these must be unions, and must be named as shown\n+\n+// required\n+// this one is actually in a vector of payload objects (op-union pair)\n+union ConfigPayload {\n+\tlsTableHandle:uint32,\n+\tstaggeredWriteResult:RPiStaggeredWritePayload,\n+\tcontrols:ControlList,\n+}\n+\n+// required\n+union EventPayload {\n+\tbufferId:uint32,\n+\tispPrepare:RPiIspPreparePayload,\n+\tcontrols:ControlList,\n+}\n+\n+// required\n+union ActionPayload {\n+\tbufferId:uint32,\n+\tstatsComplete:RPiStatsCompletePayload,\n+\tcontrols:ControlList,\n+}\ndiff --git a/include/libcamera/ipa/raspberrypi_wrapper.h b/include/libcamera/ipa/raspberrypi_wrapper.h\nnew file mode 100644\nindex 0000000..e5e1a06\n--- /dev/null\n+++ b/include/libcamera/ipa/raspberrypi_wrapper.h\n@@ -0,0 +1,466 @@\n+// will be automatically generated by custom compiler\n+\n+#ifndef __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_FB_H__\n+#define __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_FB_H__\n+\n+#include \"raspberrypi_generated.h\"\n+\n+namespace libcamera {\n+\n+// TODO this (and deserialize) should go global\n+inline flatbuffers::Offset<ControlList> serializeControlList(flatbuffers::FlatBufferBuilder &builder, ControlList &list)\n+{\n+\tControlSerializer serializer;\n+\n+\t// TODO need a way to specify the info map\n+\tsize_t size = serializer.binarySize(RPiControls);\n+\tstd::vector<uint8_t> infoData(size);\n+\tByteStreamBuffer buffer(infoData.data(), infoData.size());\n+\tserializer.serialize(RPiControls, buffer);\n+\n+\tsize = serializer.binarySize(list);\n+\tstd::vector<uint8_t> listData(size);\n+\tbuffer = ByteStreamBuffer(listData.data(), listData.size());\n+\tserializer.serialize(list, buffer);\n+\n+\t// don't need to error check; just write empty vector\n+\treturn CreateControlListDirect(builder, listData);\n+}\n+\n+// TODO fix the input type for this (like ControlListFB or something?)\n+inline ControlList deserializeControlList(ControlList *obj)\n+{\n+\tControlSerializer deserializer;\n+\tstd::vector<uint8_t> buf = std::vector(obj->begin(), obj->end());\n+\n+\tstd::vector<uint8_t> infoData(size);\n+\tBytesStreamBuffer buffer(const_cast<const uint8_t *>(infoData.data()), infoData.size());\n+\tControlInfoMap infoMap = deserializer.deserialize<ControlInfoMap>(buffer);\n+\t// TODO what to do for error checking?\n+\n+\tstd::vector<uint8_t> listData(size);\n+\tbuffer = ByteStreamBuffer(const_cast<const uint8_t *>(listData.data()), listData.size());\n+\tControlList list = deserializer.deserialize<ControlList>(buffer);\n+\n+\treturn list;\n+}\n+\n+\n+enum RPiConfigParametersWrapper {\n+\tRPI_IPA_CONFIG_LS_TABLE = 1,\n+\tRPI_IPA_CONFIG_STAGGERED_WRITE = 2,\n+\tRPI_IPA_CONFIG_SENSOR = 3,\n+};\n+\n+enum RPiEventsWrapper {\n+  RPI_IPA_EVENT_SIGNAL_STAT_READY = 1,\n+  RPI_IPA_EVENT_SIGNAL_ISP_PREPARE = 2,\n+  RPI_IPA_EVENT_QUEUE_REQUEST = 3,\n+};\n+\n+enum RPiActionsWrapper {\n+\tRPI_IPA_ACTION_V4L2_SET_STAGGERED,\n+\tRPI_IPA_ACTION_V4L2_SET_ISP,\n+\tRPI_IPA_ACTION_STATS_METADATA_COMPLETE,\n+\tRPI_IPA_ACTION_RUN_ISP,\n+\tRPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME,\n+\tRPI_IPA_ACTION_EMBEDDED_COMPLETE,\n+};\n+\n+struct RPiStaggeredWritePayloadWrapper : Serializable\n+{\n+\tRPiStaggeredWritePayloadWrapper() {}\n+\n+\tRPiStaggeredWritePayloadWrapper(uint32_t gainDelay, uint32_t exposureDelay, uint32_t sensorMetadata) : gainDelay_(gainDelay), exposureDelay_(exposureDelay), sensorMetadata_(sensorMetadata) {}\n+\n+\tRPiStaggeredWritePayloadWrapper(const RPiStaggeredWritePayload *buf)\n+\t{\n+\t\tconst RPiStaggeredWritePayload *obj = flatbuffers::GetRoot<RPiStaggeredWritePayload>(buf);\n+\n+\t\tgainDelay_ = obj->gainDelay();\n+\t\texposureDelay_ = obj->exposureDelay();\n+\t\tsensorMetadata_ = obj->sensorMetadata();\n+\t}\n+\n+\tflatbuffers::Offset<RPiStaggeredWritePayload> serialize(flatbuffers::FlatBufferBuilder &builder)\n+\t{\n+\t\t// - construct compound children depth-first\n+\t\t// - get simple data\n+\t\t// - feed to Create\n+\n+\t\t// nop for gainDelay_\n+\n+\t\t// nop for exposureDelay_\n+\n+\t\t// nop for sensorMetadata_\n+\n+\t\treturn CreateRPiStaggeredWritePayload(builder, gainDelay_, exposureDelay_, sensorMetadata_);\n+\t}\n+\n+\tuint32_t gainDelay_;\n+\tuint32_t exposureDelay_;\n+\tuint32_t sensorMetadata_;\n+}\n+\n+struct RPiIspPreparePayloadWrapper : Serializable\n+{\n+\tRPiIspPreparePayloadWrapper() {}\n+\n+\tRPiIspPreparePayloadWrapper(uint32_t embeddedbufferId, uint32_t bayerbufferId) : embeddedbufferId_(embeddedbufferId), bayerbufferId_(bayerbufferId) {}\n+\n+\tRPiIspPreparePayloadWrapper(const RPiIspPreparePayload *buf)\n+\t{\n+\t\tconst RPiIspPreparePayload *obj = flatbuffers::GetRoot<RPiIspPreparePayload>(buf);\n+\n+\t\tembeddedbufferId_ = obj->embeddedbufferId();\n+\t\tbayerbufferId_ = obj->bayerbufferId();\n+\t}\n+\n+\tflatbuffers::Offset<RPiIspPreparePayload> serialize(flatbuffers::FlatBufferBuilder &builder)\n+\t{\n+\t\t// - construct compound children depth-first\n+\t\t// - get simple data\n+\t\t// - feed to Create\n+\n+\t\t// nop for embeddedbufferId_\n+\n+\t\t// nop for bayerbufferId_\n+\n+\t\treturn CreateRPiIspPreparePayload(builder, embeddedbufferId_, bayerbufferId_);\n+\t}\n+\n+\tuint32_t embeddedbufferId_;\n+\tuint32_t bayerbufferId_;\n+}\n+\n+struct RPiStatsCompletePayloadWrapper : Serializable\n+{\n+\tRPiStatsCompletePayloadWrapper() {}\n+\n+\tRPiStatsCompletePayloadWrapper(uint32_t bufferId, ControlList &controls) : bufferId_(bufferId), controls_(controls) {}\n+\n+\t// deserialize\n+\tRPiStatsCompletePayloadWrapper(const RPiStatsCompletePayload *buf)\n+\t{\n+\t\tconst RPiStatsCompletePayload *obj = flatbuffers::GetRoot<RPiStatsCompletePayload>(buf);\n+\n+\t\tbufferId_ = obj->bufferId();\n+\t\tcontrols_ = deserializeControlList(obj->controls());\n+\t}\n+\n+\tflatbuffers::Offset<RPiStatsCompletePayloadWrapper> serialize(flatbuffers::FlatBufferBuilder &builder)\n+\t{\n+\t\t// - construct compound children depth-first\n+\t\t// - get simple data\n+\t\t// - feed to Create\n+\n+\t\t// nop for bufferId_\n+\n+\t\t// serialize controls_\n+\t\tflatbuffers::Offset<ControlList> controls = serializeControlList(builder, controls_);\n+\n+\t\treturn CreateRPiStatsCompletePayload(builder, bufferId_, controls);\n+\t}\n+\n+\tuint32_t bufferId_;\n+\tControlList controls_;\n+}\n+\n+union RPiConfigureUnionWrapper\n+{\n+\tuint32_t lsTableHandle_;\n+\tRPiStaggeredWritePayload staggeredWriteResult_;\n+\tControlList contols_;\n+}\n+\n+struct RPiConfigurePayloadWrapper : Serializable\n+{\n+\tRPiConfigurePayloadWrapper() {}\n+\n+\tRPiConfigurePayloadWrapper(enum RPiConfigParametersWrapper op, RPiConfigureUnionWrapper payload) : op_(op), payload_(payload) {}\n+\n+\t// deserialize\n+\tRPiConfigurePayloadWrapper(const RPiConfigurePayload *buf)\n+\t{\n+\t\t// yeah fill this in if you want\n+\t}\n+\n+\t// deserialize\n+\t// TODO need this if is a member of vector\n+\tRPiConfigurePayloadWrapper(flatbuffers::Offset<RPiConfigurePayload> &p)\n+\t{\n+\t\t// nop for op\n+\t\top_ = p.op();\n+\n+\t\t// start of union block for payload_\n+\t\tswitch (op_) {\n+\t\tcase RPI_IPA_CONFIG_LS_TABLE:\n+\t\t\tpayload_.lsTableHandle_ = p.payload_as_lsTableHandle();\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_CONFIG_STAGGERED_WRITE:\n+\t\t\tpayload_.staggeredWriteResult_ = RPiStaggeredWritePayloadWrapper(p.payload_as_staggeredWriteResult);\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_CONFIG_SENSOR:\n+\t\t\tpayload_.controls_ = deserializeControlList(p.payload_as_controls());\n+\t\t\tbreak;\n+\t\t}\n+\t\t// end of union block for payload_\n+\t}\n+\n+\tflatbuffers::Offset<RPiConfigurePayload> serialize(flatbuffers::FlatBufferBuilder &builder)\n+\t{\n+\t\t// - construct compound children depth-first\n+\t\t// - get simple data\n+\t\t// - feed to Create\n+\n+\t\t// nop for op_\n+\t\tRPiConfigureUnion payloadType;\n+\t\tflatbuffers::Offset<void> payload;\n+\n+\t\t// start of union block for payload_\n+\t\tswitch (op_) {\n+\t\tcase RPI_IPA_CONFIG_LS_TABLE:\n+\t\t\tpayloadType = RPiConfigureUnion_lsTableHandle;\n+\t\t\tpayload = CreateUnsignedInt(builder, payload_.lsTableHandle_);\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_CONFIG_STAGGERED_WRITE:\n+\t\t\tpayloadType = RPiConfigureUnion_staggeredWriteResult;\n+\t\t\tpayload = payload_.staggeredWriteResult_.serialize(builder);\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_CONFIG_SENSOR:\n+\t\t\t// controls\n+\t\t\tpayloadType = RPiConfigureUnion_controls;\n+\t\t\tpayload = serializeControlList(builder, payload_.controls_);\n+\t\t\tbreak;\n+\t\t}\n+\t\t// end of union block for payload_\n+\n+\t\treturn CreateRPiConfigurePayload(builder, op_, payloadType, payload);\n+\t}\n+\n+\tenum RPiConfigParametersWrapper op_;\n+\tRPiConfigureUnionWrapper payload_;\n+}\n+\n+union RPiEventPayloadWrapper\n+{\n+\tuint32_t bufferId_;\n+\tRPiIspPreparePayloadWrapper ispPrepare_;\n+\tControlList controls_;\n+}\n+\n+union RPiActionPayloadWrapper\n+{\n+\tuint32_t bufferId_;\n+\tRPiStatsCompletePayloadWrapper statsComplete_;\n+\tControlList controls_;\n+}\n+\n+struct RPiConfigureParamsWrapper : Serializable\n+{\n+\tRPiConfigureParamsWrapper() {}\n+\n+\tRPiConfigureParamsWrapper(std::vector<RPiConfigurePayloadWrapper> payload) : payload_(payload) {}\n+\n+\t// deserialize\n+\tRPiConfigureParamsWrapper(const uint8_t *buf)\n+\t{\n+\t\tconst RPiConfigureParams *obj = flatbuffers::GetRoot<RPiConfigureParams>(buf);\n+\n+\t\t// start of vector block for payload_\n+\t\tflatbuffers::Vector<flatbuffers::Offset<RPiConfigurePayload>> *payload = obj->params();\n+\t\tstd::transform(payload->begin(), payload->end(), std::back_inserter(payload_),\n+\t\t\t\t[](flatbuffers::Offset<RPiConfigurePayload> &p) -> RPiConfigurePayloadWrapper {\n+\t\t\t\t\treturn RPiConfigurePayloadWrapper(p);\n+\t\t\t\t});\n+\t\t// end of vector block for payload_\n+\t}\n+\n+\tflatbuffers::Offset<RPiConfigureParams> serialize(flatbuffers::FlatBufferBuilder &builder)\n+\t{\n+\t\t// - construct compound children depth-first\n+\t\t// - get simple data\n+\t\t// - feed to Create\n+\n+\t\t// start of vector block for payload_\n+\t\tstd::vector<flatbuffers::Offset<RPiConfigurePayload>> payload;\n+\t\tstd::transform(payload_.begin(), payload_.end(), std::back_inserter(payload),\n+\t\t\t\t[](RPiConfigurePayloadWrapper &p) -> flatbuffers::Offset<RPiConfigurePayload> { return p.serialize(builder); });\n+\t\t// end of vector block for payload_\n+\n+\t\t// use direct if there's vector as a member\n+\t\treturn CreateRPiConfigureParamsDirect(builder, payload);\n+\t}\n+\n+\t// this is only for root_type\n+\tstd::pair<uint8_t *, size_t> serialize()\n+\t{\n+\t\tflatbuffers::FlatBufferBuilder builder(1024);\n+\t\tbuilder.Finish(this.serialize(builder));\n+\n+\t\tuint8_t *buf = builder.GetBufferPointer();\n+\t\tsize_t size = builder.GetSize();\n+\t\treturn {buf, size};\n+\t}\n+\n+\tstd::vector<RPiConfigurePayloadWrapper> payload_;\n+}\n+\n+struct RPiEventParamsWrapper : Serializable\n+{\n+\tRPiEventParamsWrapper() {}\n+\n+\tRPiEventParamsWrapper(enum RPiEventsWrapper ev, RPiEventPayloadWrapper payload) : ev_(ev), payload_(payload) {}\n+\n+\t// deserialize\n+\tRPiEventParamsWrapper(const uint8_t *buf)\n+\t{\n+\t\tconst RPiEventParams *obj = flatbuffers::GetRoot<RPiEventParams>(buf);\n+\n+\t\tev_ = obj->ev();\n+\n+\t\t// start of union block for payload_\n+\t\tswitch (ev_) {\n+\t\tcase RPI_IPA_EVENT_SIGNAL_STAT_READY:\n+\t\t\tpayload_.bufferId_ = obj->payload_as_bufferId()->value();\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_EVENT_SIGNAL_ISP_PREPARE:\n+\t\t\tpayload_.ispPrepare_ = RPiIspPreparePayloadWrapper(obj->payload_as_ispPrepare());\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_EVENT_QUEUE_REQUEST:\n+\t\t\tpayload_.controls_ = deserializeControlList(obj->payload_as_controls());\n+\t\t\tbreak;\n+\t\t}\n+\t\t// end of union block for payload_\n+\t}\n+\n+\tflatbuffers::Offset<RPiEventParams> serialize(flatbuffers::FlatBufferBuilder &builder)\n+\t{\n+\t\t// - construct compound children depth-first\n+\t\t// - get simple data\n+\t\t// - feed to Create\n+\n+\t\t// nop for ev_\n+\n+\t\t// start of union block for payload_\n+\t\tRPiEventPayload payloadType;\n+\t\tflatbuffers::Offset<void> payload;\n+\n+\t\tswitch (ev_) {\n+\t\tcase RPI_IPA_EVENT_SIGNAL_STAT_READY:\n+\t\t\tpayloadType = RPiEventPayload_bufferId;\n+\t\t\tpayload = CreateUnsignedInt(builder, payload_.bufferId_);\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_EVENT_SIGNAL_ISP_PREPARE:\n+\t\t\tpayloadType = RPiEventPayload_ispPrepare;\n+\t\t\tpayload = payload_.ispPrepare_.serialize(builder);\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_EVENT_QUEUE_REQUEST:\n+\t\t\tpayloadType = RPiEventPayload_controls;\n+\t\t\tpayload = serializeControlList(builder, payload_.controls_);\n+\t\t\tbreak;\n+\t\t}\n+\t\t// end of union block\n+\n+\t\treturn CreateRPiEventParams(builder, ev_, payloadType, payload);\n+\t}\n+\n+\t// this is only for root_type\n+\tstd::pair<uint8_t *, size_t> serialize()\n+\t{\n+\t\tflatbuffers::FlatBufferBuilder builder(1024);\n+\t\tbuilder.Finish(this.serialize(builder));\n+\n+\t\tuint8_t *buf = builder.GetBufferPointer();\n+\t\tsize_t size = builder.GetSize();\n+\t\treturn {buf, size};\n+\t}\n+\n+\tenum RPiEventsWrapper ev_;\n+\tRPiEventPayloadWrapper payload_;\n+}\n+\n+struct RPiActionParamsWrapper : Serializable\n+{\n+\tRPiActionParamsWrapper() {}\n+\n+\tRPiActionParamsWrapper(enum RPiActionsWrapper op, RPiActionPayloadWrapper payload) : op_(op), payload_(payload) {}\n+\n+\t// deserialize\n+\tRPiActionParamsWrapper(const uint8_t *buf)\n+\t{\n+\t\tconst RPiActionParams *obj = flatbuffers::GetRoot<RPiActionParams>(buf);\n+\n+\t\top_ = obj->op();\n+\n+\t\t// start of union block for payload_\n+\t\tswitch (op_) {\n+\t\tcase RPI_IPA_ACTION_V4L2_SET_STAGGERED:\n+\t\tcase RPI_IPA_ACTION_V4L2_SET_ISP:\n+\t\t\tpayload_.controls_ = deserializeControlList(obj->payload_as_controls());\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_ACTION_STATS_METADATA_COMPLETE:\n+\t\t\tpayload_.statsComplete_ = RPiStatsCompletePayloadWrapper(obj->payload_as_statsComplete());\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_ACTION_RUN_ISP:\n+\t\tcase RPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME:\n+\t\tcase RPI_IPA_ACTION_EMBEDDED_COMPLETE:\n+\t\t\t// UnsignedInt needs ->value()\n+\t\t\tpayload_.bufferId_ = obj->payload_as_bufferId()->value();\n+\t\t\tbreak;\n+\t\t}\n+\t\t// end of union block for payload_\n+\t}\n+\n+\tflatbuffers::Offset<RPiEventParams> serialize(flatbuffers::FlatBufferBuilder &builder)\n+\t{\n+\t\t// - construct compound children depth-first\n+\t\t// - get simple data\n+\t\t// - feed to Create\n+\n+\t\t// nop for op_\n+\n+\t\t// start of union block for payload_\n+\t\tRPiActionPayload payloadType;\n+\t\tflatbuffers::Offset<void> payload;\n+\n+\t\tswitch (op_) {\n+\t\tcase RPI_IPA_ACTION_V4L2_SET_STAGGERED:\n+\t\tcase RPI_IPA_ACTION_V4L2_SET_ISP:\n+\t\t\tpayloadType = RPiActionPayload_controls;\n+\t\t\tpayload = serializeControlList(builder, payload_.controls_);\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_ACTION_STATS_METADATA_COMPLETE:\n+\t\t\tpayloadType = RPiActionPayload_statsComplete;\n+\t\t\tpayload = payload_.statsComplete_.serialize(builder);\n+\t\t\tbreak;\n+\t\tcase RPI_IPA_ACTION_RUN_ISP:\n+\t\tcase RPI_IPA_ACTION_RUN_ISP_AND_DROP_FRAME:\n+\t\tcase RPI_IPA_ACTION_EMBEDDED_COMPLETE:\n+\t\t\tpayloadType = RPiActionPayload_bufferId;\n+\t\t\tpayload = CreateUnsignedInt(builder, payload_.bufferId_);\n+\t\t\tbreak;\n+\t\t}\n+\t\t// end of union block for payload_\n+\n+\t\treturn CreateRPiActionParams(builder, op_, payloadType, payload);\n+\t}\n+\n+\t// this is only for root_type\n+\tstd::pair<uint8_t *, size_t> serialize()\n+\t{\n+\t\tflatbuffers::FlatBufferBuilder builder(1024);\n+\t\tbuilder.Finish(this.serialize(builder));\n+\n+\t\tuint8_t *buf = builder.GetBufferPointer();\n+\t\tsize_t size = builder.GetSize();\n+\t\treturn {buf, size};\n+\t}\n+\n+\tenum RPiActionsWrapper op_;\n+\tRPiActionPayloadWrapper payload_;\n+}\n+\n+} /* namespace libcamera */\n+\n+#endif /* __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_FB_H__ */\n",
    "prefixes": [
        "libcamera-devel",
        "DO",
        "NOT",
        "MERGE",
        "RFC"
    ]
}