b/include/libcamera/internal/control_serializer.h
@@ -47,9 +47,9 @@ private:
static void store(const ControlValue &value, ByteStreamBuffer &buffer);
static void store(const ControlInfo &info, ByteStreamBuffer &buffer);
- ControlValue loadControlValue(ControlType type, ByteStreamBuffer &buffer,
+ ControlValue loadControlValue(ByteStreamBuffer &buffer,
bool isArray = false, unsigned int count = 1);
- ControlInfo loadControlInfo(ControlType type, ByteStreamBuffer &buffer);
+ ControlInfo loadControlInfo(ByteStreamBuffer &buffer);
unsigned int serial_;
unsigned int serialSeed_;
b/src/libcamera/control_serializer.cpp
@@ -144,7 +144,7 @@ void ControlSerializer::reset()
size_t ControlSerializer::binarySize(const ControlValue &value)
{
- return value.data().size_bytes();
+ return sizeof(ControlType) + value.data().size_bytes();
}
size_t ControlSerializer::binarySize(const ControlInfo &info)
@@ -195,6 +195,8 @@ size_t ControlSerializer::binarySize(const
ControlList &list)
void ControlSerializer::store(const ControlValue &value,
ByteStreamBuffer &buffer)
{
+ const ControlType type = value.type();
+ buffer.write(&type);
buffer.write(value.data());
}