libcamera: libcamera::IPADataSerializer< T > Class Template Reference

libcamera v0.0.4 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
libcamera::IPADataSerializer< T > Class Template Reference

IPA Data Serializer. More...

## Static Public Member Functions
static std::tuple< std::vector< uint8_t >, std::vector< SharedFD > > | serialize (const T &data, ControlSerializer *cs=nullptr)
| Serialize an object into byte vector and fd vector.
static T | deserialize (const std::vector< uint8_t > &data, ControlSerializer *cs=nullptr)
| Deserialize byte vector into an object.
static T | deserialize (std::vector< uint8_t >::const_iterator dataBegin, std::vector< uint8_t >::const_iterator dataEnd, ControlSerializer *cs=nullptr)
| Deserialize byte vector into an object.
static T | deserialize (const std::vector< uint8_t > &data, const std::vector< SharedFD > &fds, ControlSerializer *cs=nullptr)
| Deserialize byte vector and fd vector into an object.
static T | deserialize (std::vector< uint8_t >::const_iterator dataBegin, std::vector< uint8_t >::const_iterator dataEnd, std::vector< SharedFD >::const_iterator fdsBegin, std::vector< SharedFD >::const_iterator fdsEnd, ControlSerializer *cs=nullptr)
| Deserialize byte vector and fd vector into an object.

## Detailed Description

template<typename T>
class libcamera::IPADataSerializer< T >

IPA Data Serializer.

Static template class that provides functions for serializing and deserializing IPA data.

Todo:
  Switch to Span instead of byte and fd vector

Todo:
  Harden the vector and map deserializer

Todo:
  For SharedFDs, instead of storing a validity flag, store an index into the fd array. This will allow us to use views instead of copying.

## Member Function Documentation

## ◆ deserialize() [1/4]

template<typename T >

template< typename T > libcamera::IPADataSerializer< T >::deserialize | ( | const std::vector< uint8_t > & | data,
|  | const std::vector< SharedFD > & | fds,
|  | ControlSerializer * | cs = `nullptr`
| ) |  |
| static

Deserialize byte vector and fd vector into an object.

Template Parameters

  T | Type of object to deserialize to

Parameters

  [in] | data | Byte vector to deserialize from
  [in] | fds | Fd vector to deserialize from
  [in] | cs | ControlSerializer

This version of deserialize() (or the iterator version) must be used if the object type T or its members contain SharedFD.

cs is only necessary if the object type T or its members contain ControlList or ControlInfoMap.

Returns
  The deserialized object

## ◆ deserialize() [2/4]

template<typename T >

template< typename T > libcamera::IPADataSerializer< T >::deserialize | ( | const std::vector< uint8_t > & | data,
|  | ControlSerializer * | cs = `nullptr`
| ) |  |
| static

Deserialize byte vector into an object.

Template Parameters

  T | Type of object to deserialize to

Parameters

  [in] | data | Byte vector to deserialize from
  [in] | cs | ControlSerializer

This version of deserialize() can be used if the object type T and its members don't have any SharedFD.

cs is only necessary if the object type T or its members contain ControlList or ControlInfoMap.

Returns
  The deserialized object

## ◆ deserialize() [3/4]

template<typename T >

template< typename T > libcamera::IPADataSerializer< T >::deserialize | ( | std::vector< uint8_t >::const_iterator | dataBegin,
|  | std::vector< uint8_t >::const_iterator | dataEnd,
|  | ControlSerializer * | cs = `nullptr`
| ) |  |
| static

Deserialize byte vector into an object.

Template Parameters

  T | Type of object to deserialize to

Parameters

  [in] | dataBegin | Begin iterator of byte vector to deserialize from
  [in] | dataEnd | End iterator of byte vector to deserialize from
  [in] | cs | ControlSerializer

This version of deserialize() can be used if the object type T and its members don't have any SharedFD.

cs is only necessary if the object type T or its members contain ControlList or ControlInfoMap.

Returns
  The deserialized object

## ◆ deserialize() [4/4]

template<typename T >

template< typename T > libcamera::IPADataSerializer< T >::deserialize | ( | std::vector< uint8_t >::const_iterator | dataBegin,
|  | std::vector< uint8_t >::const_iterator | dataEnd,
|  | std::vector< SharedFD >::const_iterator | fdsBegin,
|  | std::vector< SharedFD >::const_iterator | fdsEnd,
|  | ControlSerializer * | cs = `nullptr`
| ) |  |
| static

Deserialize byte vector and fd vector into an object.

Template Parameters

  T | Type of object to deserialize to

Parameters

  [in] | dataBegin | Begin iterator of byte vector to deserialize from
  [in] | dataEnd | End iterator of byte vector to deserialize from
  [in] | fdsBegin | Begin iterator of fd vector to deserialize from
  [in] | fdsEnd | End iterator of fd vector to deserialize from
  [in] | cs | ControlSerializer

This version of deserialize() (or the vector version) must be used if the object type T or its members contain SharedFD.

cs is only necessary if the object type T or its members contain ControlList or ControlInfoMap.

Returns
  The deserialized object

## ◆ serialize()

template<typename T >

template< typename T > libcamera::IPADataSerializer< T >::serialize | ( | const T & | data,
|  | ControlSerializer * | cs = `nullptr`
| ) |  |
| static

Serialize an object into byte vector and fd vector.

Template Parameters

  T | Type of object to serialize

Parameters

  [in] | data | Object to serialize
  [in] | cs | ControlSerializer

cs is only necessary if the object type T or its members contain ControlList or ControlInfoMap.

Returns
  Tuple of byte vector and fd vector, that is the serialized form of data

The documentation for this class was generated from the following files:

- include/libcamera/internal/ipa_data_serializer.h
- src/libcamera/ipa_data_serializer.cpp