NVIDIA DeepStream SDK API Reference

8.0 Release
mega/deepstream_schema/deepstream_schema.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
22 #ifndef NVEVENTMSGCONV_H_
23 #define NVEVENTMSGCONV_H_
24 
25 #include "nvdsmeta.h"
26 #include "nvdsmeta_schema.h"
27 #include <iostream>
28 #include <string>
29 #include <unordered_map>
30 
31 using namespace std;
32 
33 #define CONFIG_GROUP_SENSOR "sensor"
34 #define CONFIG_GROUP_PLACE "place"
35 #define CONFIG_GROUP_ANALYTICS "analytics"
36 
37 #define CONFIG_KEY_COORDINATE "coordinate"
38 #define CONFIG_KEY_DESCRIPTION "description"
39 #define CONFIG_KEY_ENABLE "enable"
40 #define CONFIG_KEY_ID "id"
41 #define CONFIG_KEY_LANE "lane"
42 #define CONFIG_KEY_LEVEL "level"
43 #define CONFIG_KEY_LOCATION "location"
44 #define CONFIG_KEY_NAME "name"
45 #define CONFIG_KEY_SOURCE "source"
46 #define CONFIG_KEY_TYPE "type"
47 #define CONFIG_KEY_VERSION "version"
48 
49 
50 #define CONFIG_KEY_PLACE_SUB_FIELD1 "place-sub-field1"
51 #define CONFIG_KEY_PLACE_SUB_FIELD2 "place-sub-field2"
52 #define CONFIG_KEY_PLACE_SUB_FIELD3 "place-sub-field3"
53 
54 #define DEFAULT_CSV_FIELDS 10
55 
56 
57 #define CHECK_ERROR(error) \
58  if (error) { \
59  cout << "Error: " << error->message << endl; \
60  goto done; \
61  }
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
70 struct NvDsPlaceSubObject {
71  string field1;
72  string field2;
73  string field3;
74 };
75 
76 struct NvDsSensorObject {
77  string id;
78  string type;
79  string desc;
80  gdouble location[3];
81  gdouble coordinate[3];
82 };
83 
84 struct NvDsPlaceObject {
85  string id;
86  string name;
87  string type;
88  gdouble location[3];
89  gdouble coordinate[3];
90  NvDsPlaceSubObject subObj;
91 };
92 
93 struct NvDsAnalyticsObject {
94  string id;
95  string desc;
96  string source;
97  string version;
98 };
99 
100 struct NvDs3dDatamap {
101  string obj_key_2d;
102  string obj_key_3d;
103  string obj_key_fusion;
104  string lidar_data_key;
105  guint32 lidar_element_size = 4;
106  guint32 lidar_element_max_points = 10;
107 };
108 
109 struct NvDsPayloadPriv {
110  unordered_map<int, NvDsSensorObject> sensorObj;
111  unordered_map<int, NvDsPlaceObject> placeObj;
112  unordered_map<int, NvDsAnalyticsObject> analyticsObj;
113  NvDs3dDatamap datamapCfg;
114 };
115 
116 gchar* generate_event_message(void* privData, NvDsEventMsgMeta* meta);
117 gchar* generate_event_message_minimal(void* privData, NvDsEvent* events, guint size);
118 gchar* generate_event_message_protobuf(void* privData, NvDsEvent* events, guint size, size_t& message_len);
119 gchar* generate_dsmeta_message(void* privData, void* frameMeta, void* objMeta);
120 gchar* generate_dsmeta_message_minimal(void* privData, void* frameMeta);
121 gchar* generate_dsmeta_message_protobuf(void* privData, void* frameMeta, size_t& message_len);
122 gchar* generate_dsmeta_message_ds3d(void* privData, void* ptrDataMap, gboolean addLidarData, size_t& message_len);
124 void destroy_deepstream_schema_ctx(void* privData);
125 bool nvds_msg2p_parse_key_value(void* privData, const gchar* file);
126 bool nvds_msg2p_parse_csv(void* privData, const gchar* file);
127 bool nvds_msg2p_parse_yaml(void* privData, const gchar* file);
128 
129 #ifdef __cplusplus
130 }
131 #endif
132 #endif /* NVEVENTMSGCONV_H_ */
generate_dsmeta_message_protobuf
gchar * generate_dsmeta_message_protobuf(void *privData, void *frameMeta, size_t &message_len)
generate_dsmeta_message
gchar * generate_dsmeta_message(void *privData, void *frameMeta, void *objMeta)
NvDsPlaceObject
Definition: deepstream_schema/deepstream_schema.h:84
generate_dsmeta_message_ds3d
gchar * generate_dsmeta_message_ds3d(void *privData, void *ptrDataMap, gboolean addLidarData, size_t &message_len)
destroy_deepstream_schema_ctx
void destroy_deepstream_schema_ctx(void *privData)
NvDsPlaceSubObject
Store data parsed from the config file in these structures.
Definition: deepstream_schema/deepstream_schema.h:70
nvds_msg2p_parse_key_value
bool nvds_msg2p_parse_key_value(void *privData, const gchar *file)
_NvDsEvent
Holds event information.
Definition: nvdsmeta_schema.h:462
nvds_msg2p_parse_yaml
bool nvds_msg2p_parse_yaml(void *privData, const gchar *file)
generate_dsmeta_message_minimal
gchar * generate_dsmeta_message_minimal(void *privData, void *frameMeta)
NvDsSensorObject
Definition: deepstream_schema/deepstream_schema.h:76
generate_event_message_minimal
gchar * generate_event_message_minimal(void *privData, NvDsEvent *events, guint size)
NvDsEventMsgMeta
Holds event message meta data.
Definition: nvdsmeta_schema.h:390
create_deepstream_schema_ctx
void * create_deepstream_schema_ctx()
generate_event_message
gchar * generate_event_message(void *privData, NvDsEventMsgMeta *meta)
NvDs3dDatamap
Definition: deepstream_schema/deepstream_schema.h:100
NvDsAnalyticsObject
Definition: deepstream_schema/deepstream_schema.h:93
nvdsmeta.h
nvds_msg2p_parse_csv
bool nvds_msg2p_parse_csv(void *privData, const gchar *file)
generate_event_message_protobuf
gchar * generate_event_message_protobuf(void *privData, NvDsEvent *events, guint size, size_t &message_len)
nvdsmeta_schema.h
NvDsPayloadPriv
Definition: deepstream_schema/deepstream_schema.h:109