Classes | Typedefs | Enumerations | Functions | Variables
dai::utility Namespace Reference

Classes

struct  H264Parser
 
struct  H265Parser
 
struct  H26xParser
 
class  VectorWriter
 

Typedefs

typedef unsigned int uint
 
typedef unsigned long ulong
 

Enumerations

enum  Profile { Profile::H264, Profile::H265 }
 
enum  SliceType {
  SliceType::P, SliceType::B, SliceType::I, SliceType::SP,
  SliceType::SI, SliceType::Unknown
}
 

Functions

std::uint32_t checksum (const void *buffer, std::size_t size)
 
std::uint32_t checksum (const void *buffer, std::size_t size, uint32_t prevChecksum)
 
template<SerializationType TYPE, typename T , std::enable_if_t< TYPE==SerializationType::JSON_MSGPACK, bool > = true>
bool deserialize (const std::uint8_t *data, std::size_t size, T &obj)
 
template<typename T >
bool deserialize (const std::uint8_t *data, std::size_t size, T &obj)
 
template<typename T >
bool deserialize (const std::uint8_t *data, std::size_t size, T &obj, SerializationType type)
 
template<SerializationType TYPE, typename T >
bool deserialize (const std::vector< std::uint8_t > &data, T &obj)
 
template<typename T >
bool deserialize (const std::vector< std::uint8_t > &data, T &obj)
 
template<typename T >
bool deserialize (const std::vector< std::uint8_t > &data, T &obj, SerializationType type)
 
uint findEnd (buf &bs, uint pos)
 
uint findStart (buf &bs, uint pos)
 
std::string getEnv (const std::string &var)
 
std::string getEnv (const std::string &var, spdlog::logger &logger)
 
SliceType getSliceType (uint num, Profile p)
 
std::vector< SliceTypegetTypesH264 (buf &bs, bool breakOnFirst)
 
std::vector< SliceTypegetTypesH264 (const std::vector< std::uint8_t > &bs, bool breakOnFirst=false)
 
std::vector< SliceTypegetTypesH265 (buf &bs, bool breakOnFirst)
 
std::vector< SliceTypegetTypesH265 (const std::vector< std::uint8_t > &bs, bool breakOnFirst=false)
 
std::string parseDeviceName (EepromData eeprom, EepromData eepromFactory={})
 Parses device name from given EepromData combination. More...
 
std::string parseProductName (EepromData eeprom, EepromData eepromFactory={})
 Parses product name from given EepromData combination. More...
 
std::tuple< uint, ulongreadGE (buf &bs, ulong pos)
 
uint readUint (buf &bs, ulong start, ulong end)
 
bool scodeEq (buf &bs, uint pos, buf code)
 
template<SerializationType TYPE, typename T >
std::vector< std::uint8_t > serialize (const T &obj)
 
template<typename T >
std::vector< std::uint8_t > serialize (const T &obj)
 
template<typename T >
std::vector< std::uint8_t > serialize (const T &obj, SerializationType type)
 
template<SerializationType TYPE, typename T , std::enable_if_t< TYPE==SerializationType::JSON_MSGPACK, bool > = true>
bool serialize (const T &obj, std::vector< std::uint8_t > &data)
 
template<typename T >
bool serialize (const T &obj, std::vector< std::uint8_t > &data)
 
template<typename T >
bool serialize (const T &obj, std::vector< std::uint8_t > &data, SerializationType type)
 
std::vector< std::string > split (const std::string &s, char delimiter)
 Splits given string by delimiter. More...
 

Variables

const typedef std::vector< std::uint8_t > buf
 
static std::unordered_map< std::string, std::string > map
 
static std::mutex mtx
 
static constexpr char path_convert_err [] = "<Unicode path not convertible>"
 

Typedef Documentation

◆ uint

typedef unsigned int dai::utility::uint

Definition at line 38 of file H26xParsers.cpp.

◆ ulong

typedef unsigned long dai::utility::ulong

Definition at line 39 of file H26xParsers.cpp.

Enumeration Type Documentation

◆ Profile

enum dai::utility::Profile
strong
Enumerator
H264 
H265 

Definition at line 9 of file H26xParsers.hpp.

◆ SliceType

Enumerator
SP 
SI 
Unknown 

Definition at line 10 of file H26xParsers.hpp.

Function Documentation

◆ checksum() [1/2]

std::uint32_t dai::utility::checksum ( const void *  buffer,
std::size_t  size 
)

Simple hash function - djb2

Parameters
bufferPointer to buffer of data to hash
sizeSize of buffer in bytes

Definition at line 17 of file Checksum.cpp.

◆ checksum() [2/2]

std::uint32_t dai::utility::checksum ( const void *  buffer,
std::size_t  size,
uint32_t  prevChecksum 
)

Simple hash function - djb2

Parameters
bufferPointer to buffer of data to hash
sizeSize of buffer in bytes
prevChecksumPrevious checksum - useful for doing hash on blocks of data

Definition at line 6 of file Checksum.cpp.

◆ deserialize() [1/6]

template<SerializationType TYPE, typename T , std::enable_if_t< TYPE==SerializationType::JSON_MSGPACK, bool > = true>
bool dai::utility::deserialize ( const std::uint8_t *  data,
std::size_t  size,
T &  obj 
)
inline

Definition at line 44 of file Serialization.hpp.

◆ deserialize() [2/6]

template<typename T >
bool dai::utility::deserialize ( const std::uint8_t *  data,
std::size_t  size,
T &  obj 
)
inline

Definition at line 212 of file Serialization.hpp.

◆ deserialize() [3/6]

template<typename T >
bool dai::utility::deserialize ( const std::uint8_t *  data,
std::size_t  size,
T &  obj,
SerializationType  type 
)
inline

Definition at line 170 of file Serialization.hpp.

◆ deserialize() [4/6]

template<SerializationType TYPE, typename T >
bool dai::utility::deserialize ( const std::vector< std::uint8_t > &  data,
T &  obj 
)
inline

Definition at line 198 of file Serialization.hpp.

◆ deserialize() [5/6]

template<typename T >
bool dai::utility::deserialize ( const std::vector< std::uint8_t > &  data,
T &  obj 
)
inline

Definition at line 216 of file Serialization.hpp.

◆ deserialize() [6/6]

template<typename T >
bool dai::utility::deserialize ( const std::vector< std::uint8_t > &  data,
T &  obj,
SerializationType  type 
)
inline

Definition at line 183 of file Serialization.hpp.

◆ findEnd()

uint dai::utility::findEnd ( buf bs,
uint  pos 
)

Definition at line 106 of file H26xParsers.cpp.

◆ findStart()

uint dai::utility::findStart ( buf bs,
uint  pos 
)

Definition at line 90 of file H26xParsers.cpp.

◆ getEnv() [1/2]

std::string dai::utility::getEnv ( const std::string &  var)

Definition at line 18 of file Environment.cpp.

◆ getEnv() [2/2]

std::string dai::utility::getEnv ( const std::string &  var,
spdlog::logger &  logger 
)

Definition at line 22 of file Environment.cpp.

◆ getSliceType()

SliceType dai::utility::getSliceType ( uint  num,
Profile  p 
)

Definition at line 42 of file H26xParsers.cpp.

◆ getTypesH264() [1/2]

std::vector<SliceType> dai::utility::getTypesH264 ( buf bs,
bool  breakOnFirst 
)

Definition at line 284 of file H26xParsers.cpp.

◆ getTypesH264() [2/2]

std::vector<SliceType> dai::utility::getTypesH264 ( const std::vector< std::uint8_t > &  bs,
bool  breakOnFirst = false 
)

◆ getTypesH265() [1/2]

std::vector<SliceType> dai::utility::getTypesH265 ( buf bs,
bool  breakOnFirst 
)

Definition at line 287 of file H26xParsers.cpp.

◆ getTypesH265() [2/2]

std::vector<SliceType> dai::utility::getTypesH265 ( const std::vector< std::uint8_t > &  bs,
bool  breakOnFirst = false 
)

◆ parseDeviceName()

std::string dai::utility::parseDeviceName ( EepromData  eeprom,
EepromData  eepromFactory = {} 
)

Parses device name from given EepromData combination.

Parameters
eepromEepromData containing fields to parse device name from
eepromFactoryAdditional factory eeprom which takes precedence when parsing
Returns
string contaning device name or empty

Definition at line 46 of file EepromDataParser.cpp.

◆ parseProductName()

std::string dai::utility::parseProductName ( EepromData  eeprom,
EepromData  eepromFactory = {} 
)

Parses product name from given EepromData combination.

Parameters
eepromEepromData containing fields to parse product name from
eepromFactoryAdditional factory eeprom which takes precedence when parsing
Returns
string contaning product name or empty

Definition at line 22 of file EepromDataParser.cpp.

◆ readGE()

std::tuple<uint, ulong> dai::utility::readGE ( buf bs,
ulong  pos 
)

Definition at line 129 of file H26xParsers.cpp.

◆ readUint()

uint dai::utility::readUint ( buf bs,
ulong  start,
ulong  end 
)

Definition at line 120 of file H26xParsers.cpp.

◆ scodeEq()

bool dai::utility::scodeEq ( buf bs,
uint  pos,
buf  code 
)

Definition at line 80 of file H26xParsers.cpp.

◆ serialize() [1/6]

template<SerializationType TYPE, typename T >
std::vector<std::uint8_t> dai::utility::serialize ( const T &  obj)
inline

Definition at line 189 of file Serialization.hpp.

◆ serialize() [2/6]

template<typename T >
std::vector<std::uint8_t> dai::utility::serialize ( const T &  obj)
inline

Definition at line 208 of file Serialization.hpp.

◆ serialize() [3/6]

template<typename T >
std::vector<std::uint8_t> dai::utility::serialize ( const T &  obj,
SerializationType  type 
)
inline

Definition at line 160 of file Serialization.hpp.

◆ serialize() [4/6]

template<SerializationType TYPE, typename T , std::enable_if_t< TYPE==SerializationType::JSON_MSGPACK, bool > = true>
bool dai::utility::serialize ( const T &  obj,
std::vector< std::uint8_t > &  data 
)
inline

Definition at line 38 of file Serialization.hpp.

◆ serialize() [5/6]

template<typename T >
bool dai::utility::serialize ( const T &  obj,
std::vector< std::uint8_t > &  data 
)
inline

Definition at line 204 of file Serialization.hpp.

◆ serialize() [6/6]

template<typename T >
bool dai::utility::serialize ( const T &  obj,
std::vector< std::uint8_t > &  data,
SerializationType  type 
)
inline

Definition at line 147 of file Serialization.hpp.

◆ split()

std::vector< std::string > dai::utility::split ( const std::string &  s,
char  delimiter 
)

Splits given string by delimiter.

Parameters
sstring to split
delimitercharacter by which to split
Returns
vector of split strings

Definition at line 6 of file EepromDataParser.cpp.

Variable Documentation

◆ buf

const typedef std::vector<std::uint8_t> dai::utility::buf

Definition at line 40 of file H26xParsers.cpp.

◆ map

std::unordered_map<std::string, std::string> dai::utility::map
static

Definition at line 16 of file Environment.cpp.

◆ mtx

std::mutex dai::utility::mtx
static

Definition at line 15 of file Environment.cpp.

◆ path_convert_err

constexpr char dai::utility::path_convert_err[] = "<Unicode path not convertible>"
staticconstexpr

Definition at line 16 of file spdlog-fmt.hpp.



depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20