cvedia::rt¶
API for controlling the server and lifecycle management of runtime instances.
Namespaces¶
Classes¶
Types¶
| Name | |
|---|---|
| enum class | ThreadType |
| enum class | StorageType |
| enum class | Affinity |
| enum class | RoiRoundPolicy |
| enum class | RoiEvenPolicy |
| enum class unsigned | MetadataPriority |
| enum | FindingCat |
| enum | FindingSeverity |
| enum class | GroupType |
| enum class std::uint8_t | LicenseTag |
| enum class std::uint8_t | Intent |
| enum class std::uint8_t | IntentResponse |
| enum class | CValueType { NONE = -1, NUMBER = 0, BOOL = 1, STRING = 2, VECTOR = 3, MAP = 4, BUFFER = 5, MEM = 6} CValue object type enum: NONE,NUMBER,BOOL,STRING,VECTOR,MAP,VEC4F. |
| enum unsigned int | BufferDataType |
| enum class | BufferOwnership { COPY, BORROW, ADOPT} Buffer memory ownership mode. |
| enum | MemoryLayout |
| enum class | InstanceState |
| enum | InstanceStepResult |
| enum class int | LuaStateType |
| enum size_t | Codec |
| using std::function< bool(cmap const &)> | entityTypeDistinctionFunc |
| using std::function< bool(pCValue const &)> | analyticsTypeExistenceFunc |
| typedef std::vector< BufferLedgerEntry > | BufferLedger |
| typedef std::array< float, 4 > | Color4f |
| typedef Point_< int > | Point2i |
| typedef Point_< int64_t > | Point2l |
| typedef Point_< float > | Point2f |
| typedef Point_< double > | Point2d |
| typedef Point2i | Point |
| typedef Size_< int > | Size2i |
| typedef Size_< int64_t > | Size2l |
| typedef Size_< float > | Size2f |
| typedef Size_< double > | Size2d |
| typedef Size2i | Size |
| typedef Rect_< int > | Rect2i |
| typedef Rect_< float > | Rect2f |
| typedef Rect_< double > | Rect2d |
| typedef Rect2i | Rect |
| typedef void(*)(BufferInit *init) | _InstantiateBufferHandler |
| typedef TrackedCValuePtr | pCValue |
| typedef std::map< std::string, pCValue > | cmap |
| typedef std::vector< pCValue > | cvec |
| typedef std::shared_ptr< iface::Buffer > | cbuffer |
| typedef std::shared_ptr< const iface::Buffer > | const_cbuffer |
| typedef std::shared_ptr< std::vector< unsigned char > > | cmem |
| typedef std::unique_ptr< iface::CVDictRoot > | uCVDictRoot |
| typedef std::shared_ptr< iface::CVDict > | pCVDict |
| using std::vector< std::vector< unsigned long long > > | InferenceFanoutJobIds |
| template <class T > using tl::expected< T, std::error_code > |
expected |
| using tl::unexpected< std::error_code > | unexpected |
| typedef std::array< uint8_t, 16 > | UuidBytes |
Functions¶
| Name | |
|---|---|
| void | addBufferLedgerEntry(BufferImpl const * buffer, std::string const & operation, std::string const & details) |
| void | addBufferSourceContext(BufferImpl const * childBuffer, BufferImpl const * parentBuffer, std::string const & operation, std::string const & details) |
| void | printLedgerEntry(std::ostream & os, BufferLedgerEntry const & entry) |
| void | printLedger(std::ostream & os, BufferLedger const & ledger) |
| bool | isCvediaModel(pCValue const & modelConfig) |
| pCValue | composeFrame(cbuffer const & image, cmap const & meta) |
| pCValue | composeFrame(cv::InputArray image, BufferDataType type, cmap const & meta, double const timestamp, int const frameid) |
| std::string | nChar(std::string ch, size_t nRepeats) |
| void | preciseSleepFor(std::chrono::nanoseconds duration) |
| void | requestFineSystemTimers() |
| int | roiClampInt(int v, int lo, int hi) |
| int | roiRoundToInt(float v, RoiRoundPolicy policy) |
| int | roiAlignEven(int v, RoiEvenPolicy policy) |
| RoiNormResult | normalizeRoi(Rect2f rc, Size const & srcSize, bool relative, RoiRoundPolicy xyRound, RoiRoundPolicy whRound, RoiEvenPolicy xyEven, RoiEvenPolicy whEven, bool clampToBounds, int minWidth, int minHeight) |
| RoiNormResult | normalizeNv12Roi(Rect2f rc, Size const & srcSize, bool relative, bool clampToBounds =true) |
| RoiNormResult | normalizeYv12Roi(Rect2f rc, Size const & srcSize, bool relative, bool clampToBounds =true) |
| template <typename Tp > Rect_< Tp > & |
operator&=(Rect_< Tp > & a, Rect_< Tp > const & b) |
| template <typename _Tp > Rect_< _Tp > & |
**[operator |
| template <typename Tp > Rect_< Tp > |
operator&(Rect_< Tp > const & a, Rect_< Tp > const & b) |
| template <typename _Tp > Rect_< _Tp > |
**[operator |
| template <typename Tp > Point_< Tp > & |
operator+=(Point_< Tp > & a, Point_< Tp > const & b) |
| template <typename Tp > Point_< Tp > & |
operator-=(Point_< Tp > & a, Point_< Tp > const & b) |
| template <typename Tp > Point_< Tp > & |
operator*=(Point_< Tp > & a, int b) |
| template <typename Tp > Point_< Tp > & |
operator*=(Point_< Tp > & a, float b) |
| template <typename Tp > Point_< Tp > & |
operator*=(Point_< Tp > & a, double b) |
| template <typename Tp > Point_< Tp > & |
operator/=(Point_< Tp > & a, int b) |
| template <typename Tp > Point_< Tp > & |
operator/=(Point_< Tp > & a, float b) |
| template <typename Tp > Point_< Tp > & |
operator/=(Point_< Tp > & a, double b) |
| template <typename Tp > Point_< Tp > |
operator+(Point_< Tp > const & a, Point_< Tp > const & b) |
| template <typename Tp > Point_< Tp > |
operator-(Point_< Tp > const & a, Point_< Tp > const & b) |
| template <typename Tp > Point_< Tp > |
operator-(Point_< Tp > const & a) |
| template <typename Tp > Point_< Tp > |
operator*(Point_< Tp > const & a, int b) |
| template <typename Tp > Point_< Tp > |
operator*(int a, Point_< Tp > const & b) |
| template <typename Tp > Point_< Tp > |
operator*(Point_< Tp > const & a, float b) |
| template <typename Tp > Point_< Tp > |
operator*(float a, Point_< Tp > const & b) |
| template <typename Tp > Point_< Tp > |
operator*(Point_< Tp > const & a, double b) |
| template <typename Tp > Point_< Tp > |
operator*(double a, Point_< Tp > const & b) |
| template <typename Tp > double |
norm(Point_< Tp > const & pt) |
| MetadataPriority | metadataPriority(std::string_view type) |
| InputFormat | SourceFormat("Same as Source" , true , 0 , 0 , false ) |
| InputFormat | SoftwareFormat480P("480p (Software)" , false , 480 , 0 , true ) |
| InputFormat | SoftwareFormat720P("720p (Software)" , false , 720 , 0 , true ) |
| InputFormat | SoftwareFormat1080P("1080p (Software)" , false , 1080 , 0 , true ) |
| void | to_json(nlohmann::json & j, InstanceStatistics const & s) |
| void | from_json(nlohmann::json const & j, InstanceStatistics & s) |
| void | to_json(nlohmann::json & obj, FeatureInfo const & featureInfo) |
| void | from_json(nlohmann::json const & j, FeatureInfo & featureInfo) |
| void | to_json(nlohmann::json & obj, LicenseLedgerState const & ledgerInfo) |
| void | from_json(nlohmann::json const & j, LicenseLedgerState & ledgerInfo) |
| void | to_json(nlohmann::json & obj, LicenseLedgerInfoForInstance const & ledgerInfo) |
| void | from_json(nlohmann::json const & j, LicenseLedgerInfoForInstance & ledgerInfo) |
| void | to_json(nlohmann::json & j, RemoteServerInfo const & s) |
| void | from_json(nlohmann::json const & j, RemoteServerInfo & s) |
| std::string | codecToName(Codec codec) |
| Codec | nameToCodec(std::string const & name) |
Attributes¶
| Name | |
|---|---|
| std::map< FindingCat, std::string > | FindingCatToStr |
| std::map< FindingSeverity, std::string > | FindingSeverityToStr |
| std::string const | DEFAULT_REMOTE_SERVER_NAME |
| constexpr unsigned short | DEFAULT_WEBSERVER_PORT |
Types Documentation¶
enum ThreadType¶
| Enumerator | Value | Description |
|---|---|---|
| Global | ||
| Instance | ||
| Worker |
enum StorageType¶
| Enumerator | Value | Description |
|---|---|---|
| Global | ||
| Solution | ||
| Instance | ||
| None |
enum Affinity¶
| Enumerator | Value | Description |
|---|---|---|
| Powersave | ||
| Performance |
enum RoiRoundPolicy¶
| Enumerator | Value | Description |
|---|---|---|
| Floor | ||
| Ceil | ||
| Round |
enum RoiEvenPolicy¶
| Enumerator | Value | Description |
|---|---|---|
| None | ||
| Down | ||
| Up |
enum MetadataPriority¶
| Enumerator | Value | Description |
|---|---|---|
| Track | ||
| Crop | ||
| Event |
enum FindingCat¶
| Enumerator | Value | Description |
|---|---|---|
| generalError | ||
| missingKey | ||
| danglingKey | ||
| invalidValue |
enum FindingSeverity¶
| Enumerator | Value | Description |
|---|---|---|
| info | ||
| warning | ||
| error |
enum GroupType¶
| Enumerator | Value | Description |
|---|---|---|
| User | ||
| System | ||
| All |
enum LicenseTag¶
| Enumerator | Value | Description |
|---|---|---|
| Streams | 0 | |
| StandardAnalytics | 1 | |
| ArmedPersonAnalytics | 2 | |
| FallenPersonAnalytics | 3 | |
| LicensePlateAnalytics | 4 | |
| MetadataRecording | 5 | |
| CustomAnalytics | 6 | |
| SmokeAndFireDetection | 7 | |
| BasicAnalytics | 8 | |
| AttributeExtraction | 9 | |
| PpeAnalytics | 10 |
enum Intent¶
| Enumerator | Value | Description |
|---|---|---|
| Demand | 0 | |
| Release |
Represents an intent to inform the license enforcement system about the usage of specific license tags, allowing it to track and manage allowances.
enum IntentResponse¶
| Enumerator | Value | Description |
|---|---|---|
| None | 0 | |
| DemandReduced | ||
| DemandGranted | ||
| DemandNotGranted | ||
| DemandAlreadyGranted | ||
| DemandAcknowledgedNotGranted | ||
| DemandRetained |
enum CValueType¶
| Enumerator | Value | Description |
|---|---|---|
| NONE | -1 | |
| NUMBER | 0 | |
| BOOL | 1 | |
| STRING | 2 | |
| VECTOR | 3 | |
| MAP | 4 | |
| BUFFER | 5 | |
| MEM | 6 |
CValue object type enum: NONE,NUMBER,BOOL,STRING,VECTOR,MAP,VEC4F.
enum BufferDataType¶
| Enumerator | Value | Description |
|---|---|---|
| UNKNOWN | 0 | |
| GRAY | 8 | |
| NV12 | 12 | |
| YV12 | 13 | |
| BGR | 16 | |
| BGRA | 24 |
enum BufferOwnership¶
| Enumerator | Value | Description |
|---|---|---|
| COPY | ||
| BORROW | ||
| ADOPT |
Buffer memory ownership mode.
Determines how the buffer backend manages the underlying memory.
enum MemoryLayout¶
| Enumerator | Value | Description |
|---|---|---|
| NCHW | ||
| NHWC |
enum InstanceState¶
| Enumerator | Value | Description |
|---|---|---|
| INSTANCE_NONE | 0 | |
| INSTANCE_STOPPED | 1 | |
| INSTANCE_STARTING | 2 | |
| INSTANCE_PAUSED | 3 | |
| INSTANCE_RUNNING | 4 | |
| INSTANCE_FAIL | 5 |
enum InstanceStepResult¶
| Enumerator | Value | Description |
|---|---|---|
| INSTANCE_STEP_FAIL | 0 | |
| INSTANCE_STEP_OK | 1 | |
| INSTANCE_STEP_INVALID | 2 |
enum LuaStateType¶
| Enumerator | Value | Description |
|---|---|---|
| Other | 0 | |
| Main | ||
| Worker | ||
| Pooled | ||
| Event | ||
| COUNT |
enum Codec¶
| Enumerator | Value | Description |
|---|---|---|
| H264 | ||
| HEVC | ||
| MPEG2 | ||
| MPEG4 | ||
| MJPEG | ||
| VP8 | ||
| VP9 | ||
| VC1 | ||
| AV1 |
using entityTypeDistinctionFunc¶
using entityTypeDistinctionFunc = std::function<bool(cmap const&)>;
Analytics Entities are areas, lines or any other similar things that we can have in the future such that an instance can have multiples of. The distinction function gets the config of a single such entity to identify the type of entity, such as Crowding Area.
using analyticsTypeExistenceFunc¶
using analyticsTypeExistenceFunc = std::function<bool(pCValue const&)>;
Analytics Types are things that either an instance has it (and it is on) or it doesn't have it (or off), such as LPR. The distinction function gets the entire config of the instance to identify existence of an enabled analytics of the type.
typedef BufferLedger¶
typedef std::vector< BufferLedgerEntry > BufferLedger;
typedef Color4f¶
typedef std::array<float, 4> Color4f;
typedef Point2i¶
typedef Point_<int> Point2i;
typedef Point2l¶
typedef Point_<int64_t> Point2l;
typedef Point2f¶
typedef Point_<float> Point2f;
typedef Point2d¶
typedef Point_<double> Point2d;
typedef Point¶
typedef Point2i Point;
typedef Size2i¶
typedef Size_<int> Size2i;
typedef Size2l¶
typedef Size_<int64_t> Size2l;
typedef Size2f¶
typedef Size_<float> Size2f;
typedef Size2d¶
typedef Size_<double> Size2d;
typedef Size¶
typedef Size2i Size;
typedef Rect2i¶
typedef Rect_<int> Rect2i;
typedef Rect2f¶
typedef Rect_<float> Rect2f;
typedef Rect2d¶
typedef Rect_<double> Rect2d;
typedef Rect¶
typedef Rect2i Rect;
typedef _InstantiateBufferHandler¶
typedef void(* _InstantiateBufferHandler) (BufferInit *init);
typedef pCValue¶
typedef TrackedCValuePtr pCValue;
typedef cmap¶
typedef std::map<std::string, pCValue> cmap;
typedef cvec¶
typedef std::vector<pCValue> cvec;
typedef cbuffer¶
typedef std::shared_ptr<iface::Buffer> cbuffer;
typedef const_cbuffer¶
typedef std::shared_ptr<const iface::Buffer> const_cbuffer;
typedef cmem¶
typedef std::shared_ptr<std::vector<unsigned char> > cmem;
typedef uCVDictRoot¶
typedef std::unique_ptr<iface::CVDictRoot> uCVDictRoot;
typedef pCVDict¶
typedef std::shared_ptr<iface::CVDict> pCVDict;
using InferenceFanoutJobIds¶
using InferenceFanoutJobIds = std::vector<std::vector<unsigned long long> >;
using expected¶
template <class T >
using expected = tl::expected<T, std::error_code>;
using unexpected¶
using unexpected = tl::unexpected<std::error_code>;
typedef UuidBytes¶
typedef std::array<uint8_t, 16> UuidBytes;
Functions Documentation¶
function addBufferLedgerEntry¶
void addBufferLedgerEntry(
BufferImpl const * buffer,
std::string const & operation,
std::string const & details
)
function addBufferSourceContext¶
void addBufferSourceContext(
BufferImpl const * childBuffer,
BufferImpl const * parentBuffer,
std::string const & operation,
std::string const & details
)
function printLedgerEntry¶
void printLedgerEntry(
std::ostream & os,
BufferLedgerEntry const & entry
)
function printLedger¶
void printLedger(
std::ostream & os,
BufferLedger const & ledger
)
function isCvediaModel¶
bool isCvediaModel(
pCValue const & modelConfig
)
function composeFrame¶
pCValue composeFrame(
cbuffer const & image,
cmap const & meta
)
function composeFrame¶
pCValue composeFrame(
cv::InputArray image,
BufferDataType type,
cmap const & meta,
double const timestamp,
int const frameid
)
function nChar¶
std::string nChar(
std::string ch,
size_t nRepeats
)
function preciseSleepFor¶
inline void preciseSleepFor(
std::chrono::nanoseconds duration
)
function requestFineSystemTimers¶
inline void requestFineSystemTimers()
function roiClampInt¶
inline int roiClampInt(
int v,
int lo,
int hi
)
function roiRoundToInt¶
inline int roiRoundToInt(
float v,
RoiRoundPolicy policy
)
function roiAlignEven¶
inline int roiAlignEven(
int v,
RoiEvenPolicy policy
)
function normalizeRoi¶
inline RoiNormResult normalizeRoi(
Rect2f rc,
Size const & srcSize,
bool relative,
RoiRoundPolicy xyRound,
RoiRoundPolicy whRound,
RoiEvenPolicy xyEven,
RoiEvenPolicy whEven,
bool clampToBounds,
int minWidth,
int minHeight
)
function normalizeNv12Roi¶
inline RoiNormResult normalizeNv12Roi(
Rect2f rc,
Size const & srcSize,
bool relative,
bool clampToBounds =true
)
function normalizeYv12Roi¶
inline RoiNormResult normalizeYv12Roi(
Rect2f rc,
Size const & srcSize,
bool relative,
bool clampToBounds =true
)
function operator&=¶
template <typename Tp >
inline Rect_< Tp > & operator&=(
Rect_< Tp > & a,
Rect_< Tp > const & b
)
function operator|=¶
template <typename _Tp >
static inline Rect_< _Tp > & operator|=(
Rect_< _Tp > & a,
const Rect_< _Tp > & b
)
function operator&¶
template <typename Tp >
inline Rect_< Tp > operator&(
Rect_< Tp > const & a,
Rect_< Tp > const & b
)
function operator|¶
template <typename _Tp >
static inline Rect_< _Tp > operator|(
const Rect_< _Tp > & a,
const Rect_< _Tp > & b
)
function operator+=¶
template <typename Tp >
static inline Point_< Tp > & operator+=(
Point_< Tp > & a,
Point_< Tp > const & b
)
function operator-=¶
template <typename Tp >
static inline Point_< Tp > & operator-=(
Point_< Tp > & a,
Point_< Tp > const & b
)
function operator*=¶
template <typename Tp >
static inline Point_< Tp > & operator*=(
Point_< Tp > & a,
int b
)
function operator*=¶
template <typename Tp >
static inline Point_< Tp > & operator*=(
Point_< Tp > & a,
float b
)
function operator*=¶
template <typename Tp >
static inline Point_< Tp > & operator*=(
Point_< Tp > & a,
double b
)
function operator/=¶
template <typename Tp >
static inline Point_< Tp > & operator/=(
Point_< Tp > & a,
int b
)
function operator/=¶
template <typename Tp >
static inline Point_< Tp > & operator/=(
Point_< Tp > & a,
float b
)
function operator/=¶
template <typename Tp >
static inline Point_< Tp > & operator/=(
Point_< Tp > & a,
double b
)
function operator+¶
template <typename Tp >
static inline Point_< Tp > operator+(
Point_< Tp > const & a,
Point_< Tp > const & b
)
function operator-¶
template <typename Tp >
static inline Point_< Tp > operator-(
Point_< Tp > const & a,
Point_< Tp > const & b
)
function operator-¶
template <typename Tp >
static inline Point_< Tp > operator-(
Point_< Tp > const & a
)
function operator*¶
template <typename Tp >
static inline Point_< Tp > operator*(
Point_< Tp > const & a,
int b
)
function operator*¶
template <typename Tp >
static inline Point_< Tp > operator*(
int a,
Point_< Tp > const & b
)
function operator*¶
template <typename Tp >
static inline Point_< Tp > operator*(
Point_< Tp > const & a,
float b
)
function operator*¶
template <typename Tp >
static inline Point_< Tp > operator*(
float a,
Point_< Tp > const & b
)
function operator*¶
template <typename Tp >
static inline Point_< Tp > operator*(
Point_< Tp > const & a,
double b
)
function operator*¶
template <typename Tp >
static inline Point_< Tp > operator*(
double a,
Point_< Tp > const & b
)
function norm¶
template <typename Tp >
static inline double norm(
Point_< Tp > const & pt
)
function metadataPriority¶
inline MetadataPriority metadataPriority(
std::string_view type
)
function SourceFormat¶
static InputFormat SourceFormat(
"Same as Source" ,
true ,
0 ,
0 ,
false
)
function SoftwareFormat480P¶
static InputFormat SoftwareFormat480P(
"480p (Software)" ,
false ,
480 ,
0 ,
true
)
function SoftwareFormat720P¶
static InputFormat SoftwareFormat720P(
"720p (Software)" ,
false ,
720 ,
0 ,
true
)
function SoftwareFormat1080P¶
static InputFormat SoftwareFormat1080P(
"1080p (Software)" ,
false ,
1080 ,
0 ,
true
)
function to_json¶
inline void to_json(
nlohmann::json & j,
InstanceStatistics const & s
)
function from_json¶
inline void from_json(
nlohmann::json const & j,
InstanceStatistics & s
)
function to_json¶
inline void to_json(
nlohmann::json & obj,
FeatureInfo const & featureInfo
)
function from_json¶
inline void from_json(
nlohmann::json const & j,
FeatureInfo & featureInfo
)
function to_json¶
inline void to_json(
nlohmann::json & obj,
LicenseLedgerState const & ledgerInfo
)
function from_json¶
inline void from_json(
nlohmann::json const & j,
LicenseLedgerState & ledgerInfo
)
function to_json¶
inline void to_json(
nlohmann::json & obj,
LicenseLedgerInfoForInstance const & ledgerInfo
)
function from_json¶
inline void from_json(
nlohmann::json const & j,
LicenseLedgerInfoForInstance & ledgerInfo
)
function to_json¶
inline void to_json(
nlohmann::json & j,
RemoteServerInfo const & s
)
function from_json¶
inline void from_json(
nlohmann::json const & j,
RemoteServerInfo & s
)
function codecToName¶
inline std::string codecToName(
Codec codec
)
function nameToCodec¶
inline Codec nameToCodec(
std::string const & name
)
Attributes Documentation¶
variable FindingCatToStr¶
static std::map< FindingCat, std::string > FindingCatToStr {
{FindingCat::generalError, "GENERAL_ERROR"},
{FindingCat::missingKey, "MISSING_KEY"},
{FindingCat::danglingKey, "DANGLING_KEY"},
{FindingCat::invalidValue, "INVALID_VALUE"}
};
variable FindingSeverityToStr¶
static std::map< FindingSeverity, std::string > FindingSeverityToStr {
{FindingSeverity::info, "INFO"},
{FindingSeverity::warning, "WARNING"},
{FindingSeverity::error, "ERROR"}
};
variable DEFAULT_REMOTE_SERVER_NAME¶
std::string const DEFAULT_REMOTE_SERVER_NAME = "default";
variable DEFAULT_WEBSERVER_PORT¶
constexpr unsigned short DEFAULT_WEBSERVER_PORT = 3546;