[libcamera-devel] [RFC PATCH v2 02/10] libcamera: ipa_data_serializer: Modify (de)serialization for offset
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue Aug 24 00:15:14 CEST 2021
Hi Hiro,
Thank you for the patch.
On Mon, Aug 23, 2021 at 10:12:13PM +0900, Hirokazu Honda wrote:
> The offset variable is added to FrameBuffer::Plane. This modifies
> the serialization and deserialization code for the offset variable.
>
> Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
> ---
> src/libcamera/ipa_data_serializer.cpp | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp
> index 5b183c70..8d1ae4d2 100644
> --- a/src/libcamera/ipa_data_serializer.cpp
> +++ b/src/libcamera/ipa_data_serializer.cpp
> @@ -569,6 +569,7 @@ FileDescriptor IPADataSerializer<FileDescriptor>::deserialize(const std::vector<
> * FrameBuffer::Plane is serialized as:
> *
> * 4 byte - FileDescriptor
> + * 4 bytes - uint32_t Offset
> * 4 bytes - uint32_t Length
> */
> template<>
> @@ -586,6 +587,7 @@ IPADataSerializer<FrameBuffer::Plane>::serialize(const FrameBuffer::Plane &data,
> dataVec.insert(dataVec.end(), fdBuf.begin(), fdBuf.end());
> fdsVec.insert(fdsVec.end(), fdFds.begin(), fdFds.end());
>
> + appendPOD<uint32_t>(dataVec, data.offset);
> appendPOD<uint32_t>(dataVec, data.length);
>
> return { dataVec, fdsVec };
> @@ -603,7 +605,8 @@ IPADataSerializer<FrameBuffer::Plane>::deserialize(std::vector<uint8_t>::const_i
>
> ret.fd = IPADataSerializer<FileDescriptor>::deserialize(dataBegin, dataBegin + 4,
> fdsBegin, fdsBegin + 1);
> - ret.length = readPOD<uint32_t>(dataBegin, 4, dataEnd);
> + ret.offset = readPOD<uint32_t>(dataBegin, 1, dataEnd);
> + ret.length = readPOD<uint32_t>(dataBegin, 5, dataEnd);
This should be
ret.offset = readPOD<uint32_t>(dataBegin, 4, dataEnd);
ret.length = readPOD<uint32_t>(dataBegin, 8, dataEnd);
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
>
> return ret;
> }
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list