NVIDIA DeepStream SDK API Reference

9.1 Release
sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
27 #ifndef NVEVENTMSGCONV_H_
28 #define NVEVENTMSGCONV_H_
29 
30 #include "nvdsmeta.h"
31 #include "nvdsmeta_schema.h"
32 #include <iostream>
33 #include <string>
34 #include <unordered_map>
35 
36 using namespace std;
37 
38 #define CONFIG_GROUP_SENSOR "sensor"
39 #define CONFIG_GROUP_PLACE "place"
40 #define CONFIG_GROUP_ANALYTICS "analytics"
41 
42 #define CONFIG_KEY_COORDINATE "coordinate"
43 #define CONFIG_KEY_DESCRIPTION "description"
44 #define CONFIG_KEY_ENABLE "enable"
45 #define CONFIG_KEY_ID "id"
46 #define CONFIG_KEY_LANE "lane"
47 #define CONFIG_KEY_LEVEL "level"
48 #define CONFIG_KEY_LOCATION "location"
49 #define CONFIG_KEY_NAME "name"
50 #define CONFIG_KEY_SOURCE "source"
51 #define CONFIG_KEY_TYPE "type"
52 #define CONFIG_KEY_VERSION "version"
53 
54 
55 #define CONFIG_KEY_PLACE_SUB_FIELD1 "place-sub-field1"
56 #define CONFIG_KEY_PLACE_SUB_FIELD2 "place-sub-field2"
57 #define CONFIG_KEY_PLACE_SUB_FIELD3 "place-sub-field3"
58 
59 #define DEFAULT_CSV_FIELDS 10
60 
61 
62 #define CHECK_ERROR(error) \
63  if (error) { \
64  cout << "Error: " << error->message << endl; \
65  goto done; \
66  }
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
76  string field1;
77  string field2;
78  string field3;
79 };
80 
82  string id;
83  string type;
84  string desc;
85  gdouble location[3];
86  gdouble coordinate[3];
87 };
88 
90  string id;
91  string name;
92  string type;
93  gdouble location[3];
94  gdouble coordinate[3];
96 };
97 
99  string id;
100  string desc;
101  string source;
102  string version;
103 };
104 
106  string obj_key_2d;
107  string obj_key_3d;
110  guint32 lidar_element_size = 4;
111  guint32 lidar_element_max_points = 10;
112 };
113 
115  unordered_map<int, NvDsSensorObject> sensorObj;
116  unordered_map<int, NvDsPlaceObject> placeObj;
117  unordered_map<int, NvDsAnalyticsObject> analyticsObj;
119 };
120 
121 gchar* generate_event_message(void* privData, NvDsEventMsgMeta* meta);
122 gchar* generate_event_message_minimal(void* privData, NvDsEvent* events, guint size);
123 gchar* generate_event_message_protobuf(void* privData, NvDsEvent* events, guint size, size_t& message_len);
124 gchar* generate_dsmeta_message(void* privData, void* frameMeta, void* objMeta);
125 gchar* generate_dsmeta_message_minimal(void* privData, void* frameMeta);
126 gchar* generate_dsmeta_message_protobuf(void* privData, void* frameMeta, size_t& message_len);
127 gchar* generate_dsmeta_message_ds3d(void* privData, void* ptrDataMap, gboolean addLidarData, size_t& message_len);
129 void destroy_deepstream_schema_ctx(void* privData);
130 bool nvds_msg2p_parse_key_value(void* privData, const gchar* file);
131 bool nvds_msg2p_parse_csv(void* privData, const gchar* file);
132 bool nvds_msg2p_parse_yaml(void* privData, const gchar* file);
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 #endif /* NVEVENTMSGCONV_H_ */
NvDsAnalyticsObject::source
string source
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:101
NvDsPayloadPriv::placeObj
unordered_map< int, NvDsPlaceObject > placeObj
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:116
generate_event_message_minimal
gchar * generate_event_message_minimal(void *privData, NvDsEvent *events, guint size)
NvDsPlaceObject
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:89
generate_event_message_protobuf
gchar * generate_event_message_protobuf(void *privData, NvDsEvent *events, guint size, size_t &message_len)
NvDsPlaceSubObject
Store data parsed from the config file in these structures.
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:75
create_deepstream_schema_ctx
void * create_deepstream_schema_ctx()
NvDsAnalyticsObject::version
string version
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:102
NvDsPayloadPriv::sensorObj
unordered_map< int, NvDsSensorObject > sensorObj
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:115
_NvDsEvent
Holds event information.
Definition: sources/includes/nvdsmeta_schema.h:468
nvds_msg2p_parse_yaml
bool nvds_msg2p_parse_yaml(void *privData, const gchar *file)
NvDsPlaceObject::name
string name
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:91
NvDsPlaceSubObject::field2
string field2
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:77
NvDs3dDatamap::obj_key_fusion
string obj_key_fusion
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:108
NvDsPlaceObject::subObj
NvDsPlaceSubObject subObj
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:95
NvDsSensorObject::type
string type
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:83
generate_dsmeta_message_minimal
gchar * generate_dsmeta_message_minimal(void *privData, void *frameMeta)
NvDsAnalyticsObject::id
string id
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:99
generate_dsmeta_message
gchar * generate_dsmeta_message(void *privData, void *frameMeta, void *objMeta)
NvDsAnalyticsObject::desc
string desc
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:100
NvDsSensorObject::desc
string desc
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:84
NvDsSensorObject
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:81
generate_dsmeta_message_ds3d
gchar * generate_dsmeta_message_ds3d(void *privData, void *ptrDataMap, gboolean addLidarData, size_t &message_len)
NvDsEventMsgMeta
Holds event message meta data.
Definition: sources/includes/nvdsmeta_schema.h:394
NvDsPayloadPriv::datamapCfg
NvDs3dDatamap datamapCfg
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:118
NvDsSensorObject::id
string id
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:82
nvds_msg2p_parse_csv
bool nvds_msg2p_parse_csv(void *privData, const gchar *file)
generate_event_message
gchar * generate_event_message(void *privData, NvDsEventMsgMeta *meta)
NvDsPlaceSubObject::field3
string field3
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:78
destroy_deepstream_schema_ctx
void destroy_deepstream_schema_ctx(void *privData)
NvDs3dDatamap::obj_key_3d
string obj_key_3d
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:107
NvDs3dDatamap::lidar_data_key
string lidar_data_key
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:109
NvDsPlaceSubObject::field1
string field1
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:76
NvDs3dDatamap::obj_key_2d
string obj_key_2d
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:106
NvDsPlaceObject::id
string id
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:90
NvDsPayloadPriv::analyticsObj
unordered_map< int, NvDsAnalyticsObject > analyticsObj
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:117
NvDs3dDatamap
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:105
NvDsAnalyticsObject
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:98
NvDsPlaceObject::type
string type
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:92
nvds_msg2p_parse_key_value
bool nvds_msg2p_parse_key_value(void *privData, const gchar *file)
generate_dsmeta_message_protobuf
gchar * generate_dsmeta_message_protobuf(void *privData, void *frameMeta, size_t &message_len)
NvDsPayloadPriv
Definition: sources/libs/nvmsgconv/deepstream_schema/deepstream_schema.h:114