diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-02-15 23:59:54 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-06 18:10:24 +0200 |
commit | cd0f7929ec0bdf3c98e552a6ce2e9147b8c6dd17 (patch) | |
tree | 8eb09864167944b7e3f6b0197fbc7872626ec6e4 /include | |
parent | 954bf1f656e610474d9a582774690dc505fb821b (diff) |
libcamera: controls: Expose raw data in ControlValue
Add a data() function to the ControlValue class to expose the raw data
stored by the class as a Span<const uint8_t>. This will be useful to
simplify the serialization of ControlValue instances.
The size computation for the raw data is moved from the
ControlSerializer, which is updated accordingly to use the data()
function in order to access the size. Simplification of the
ControlSerializer will happen in a subsequent change.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/controls.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 6f0ebf4f..4538be06 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -12,6 +12,8 @@ #include <string> #include <unordered_map> +#include <libcamera/span.h> + namespace libcamera { class ControlValidator; @@ -65,6 +67,7 @@ public: ControlType type() const { return type_; } bool isNone() const { return type_ == ControlTypeNone; } + Span<const uint8_t> data() const; std::string toString() const; |