NVIDIA DeepStream SDK API Reference

9.1 Release
sources/apps/apps-common/includes/deepstream_config_file_parser.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-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 
18 #ifndef __NVGSTDS_CONFIG_PARSER_H__
19 #define __NVGSTDS_CONFIG_PARSER_H__
20 
21 #include <gst/gst.h>
22 
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27 
28 #include "deepstream_config.h"
29 #include "deepstream_sources.h"
30 #include "deepstream_preprocess.h"
31 #include "deepstream_primary_gie.h"
34 #include "deepstream_gie.h"
35 #include "deepstream_sinks.h"
36 #include "deepstream_osd.h"
37 #include "deepstream_segvisual.h"
38 #include "deepstream_sources.h"
39 #include "deepstream_dsanalytics.h"
40 #include "deepstream_dsexample.h"
41 #include "deepstream_streammux.h"
42 #include "deepstream_tracker.h"
45 #include "deepstream_replay.h"
46 #include "deepstream_dewarper.h"
47 #include "deepstream_c2d_msg.h"
48 #include "deepstream_image_save.h"
49 
50 #define CONFIG_GROUP_SOURCE_LIST "source-list"
51 #define CONFIG_GROUP_SOURCE_LIST_NUM_SOURCE_BINS "num-source-bins"
52 #define CONFIG_GROUP_SOURCE_LIST_URI_LIST "list"
53 
54 #define CONFIG_GROUP_SOURCE_LIST_SENSOR_ID_LIST "sensor-id-list"
55 #define CONFIG_GROUP_SOURCE_LIST_SENSOR_NAME_LIST "sensor-name-list"
56 
58 #define CONFIG_GROUP_SOURCE_LIST_USE_NVMULTIURISRCBIN "use-nvmultiurisrcbin"
59 #define CONFIG_GROUP_SOURCE_LIST_DUMMY_PAYLOAD "dummy-payload"
60 #define CONFIG_GROUP_SOURCE_LIST_CUSTOM_TS_TO_RFC "custom-ts-to-rfc"
61 #define CONFIG_GROUP_SOURCE_LIST_BATCHED_SENSOR_NAME "batched-sensor-name"
62 #define CONFIG_GROUP_SOURCE_LIST_STREAM_NAME_DISPLAY "stream-name-display"
63 #define CONFIG_GROUP_SOURCE_LIST_MAX_BATCH_SIZE "max-batch-size"
64 #define CONFIG_GROUP_SOURCE_LIST_HTTP_IP "http-ip"
65 #define CONFIG_GROUP_SOURCE_LIST_HTTP_PORT "http-port"
66 #define CONFIG_GROUP_SOURCE_EXTRACT_SEI_TYPE5_DATA "extract-sei-type5-data"
67 #define CONFIG_GROUP_SOURCE_SEI_UUID "sei-uuid"
68 #define CONFIG_GROUP_SOURCE_LIST_LOW_LATENCY_MODE "low-latency-mode"
69 
71 #define CONFIG_GROUP_SOURCE_LIST_ENABLE_ERROR_PROPAGATION "enable-error-propagation"
72 #define CONFIG_GROUP_SOURCE_LIST_PROTO_LIB "proto-lib"
73 #define CONFIG_GROUP_SOURCE_LIST_CONN_STR "conn-str"
74 #define CONFIG_GROUP_SOURCE_LIST_TOPIC "topic"
75 
76 
77 #define CONFIG_GROUP_SOURCE_ALL "source-attr-all"
78 
79 #define CONFIG_GROUP_SOURCE "source"
80 #define CONFIG_GROUP_OSD "osd"
81 #define CONFIG_GROUP_SEGVISUAL "segvisual"
82 #define CONFIG_GROUP_PREPROCESS "pre-process"
83 #define CONFIG_GROUP_SECONDARY_PREPROCESS "secondary-pre-process"
84 #define CONFIG_GROUP_PRIMARY_GIE "primary-gie"
85 #define CONFIG_GROUP_SECONDARY_GIE "secondary-gie"
86 #define CONFIG_GROUP_TRACKER "tracker"
87 #define CONFIG_GROUP_TEXT_EMBEDDER "text-embedder"
88 #define CONFIG_GROUP_VISIONENCODER "visionencoder"
89 #define CONFIG_GROUP_REPLAY "replay"
90 #define CONFIG_GROUP_SINK "sink"
91 #define CONFIG_GROUP_TILED_DISPLAY "tiled-display"
92 #define CONFIG_GROUP_DSANALYTICS "nvds-analytics"
93 #define CONFIG_GROUP_DSEXAMPLE "ds-example"
94 #define CONFIG_GROUP_STREAMMUX "streammux"
95 #define CONFIG_GROUP_DEWARPER "dewarper"
96 #define CONFIG_GROUP_MSG_CONVERTER "message-converter"
97 #define CONFIG_GROUP_MSG_CONSUMER "message-consumer"
98 #define CONFIG_GROUP_IMG_SAVE "img-save"
99 #define CONFIG_GROUP_AUDIO_TRANSFORM "audio-transform"
100 #define CONFIG_GROUP_AUDIO_CLASSIFIER "audio-classifier"
101 
102 #define CONFIG_GROUP_SOURCE_GPU_ID "gpu-id"
103 #define CONFIG_GROUP_SOURCE_TYPE "type"
104 #define CONFIG_GROUP_SOURCE_CUDA_MEM_TYPE "nvbuf-memory-type"
105 #define CONFIG_GROUP_SOURCE_CAMERA_WIDTH "camera-width"
106 #define CONFIG_GROUP_SOURCE_CAMERA_HEIGHT "camera-height"
107 #define CONFIG_GROUP_SOURCE_CAMERA_FPS_N "camera-fps-n"
108 #define CONFIG_GROUP_SOURCE_CAMERA_FPS_D "camera-fps-d"
109 #define CONFIG_GROUP_SOURCE_CAMERA_CSI_SID "camera-csi-sensor-id"
110 #define CONFIG_GROUP_SOURCE_CAMERA_V4L2_DEVNODE "camera-v4l2-dev-node"
111 #define CONFIG_GROUP_SOURCE_URI "uri"
112 #define CONFIG_GROUP_SOURCE_LIVE_SOURCE "live-source"
113 #define CONFIG_GROUP_SOURCE_FILE_LOOP "file-loop"
114 #define CONFIG_GROUP_SOURCE_LATENCY "latency"
115 #define CONFIG_GROUP_SOURCE_NUM_SOURCES "num-sources"
116 #define CONFIG_GROUP_SOURCE_INTRA_DECODE "intra-decode-enable"
117 #define CONFIG_GROUP_SOURCE_DEC_SKIP_FRAMES "dec-skip-frames"
118 #define CONFIG_GROUP_SOURCE_NUM_DECODE_SURFACES "num-decode-surfaces"
119 #define CONFIG_GROUP_SOURCE_NUM_EXTRA_SURFACES "num-extra-surfaces"
120 #define CONFIG_GROUP_SOURCE_DROP_FRAME_INTERVAL "drop-frame-interval"
121 #define CONFIG_GROUP_SOURCE_DROP_ON_LATENCY "drop-on-latency"
122 #define CONFIG_GROUP_SOURCE_CAMERA_ID "camera-id"
123 #define CONFIG_GROUP_SOURCE_ID "source-id"
124 #define CONFIG_GROUP_SOURCE_SELECT_RTP_PROTOCOL "select-rtp-protocol"
125 #define CONFIG_GROUP_SOURCE_LEAKY "leaky"
126 #define CONFIG_GROUP_SOURCE_MAX_SIZE_BUFFERS "max-size-buffers"
127 #define CONFIG_GROUP_SOURCE_RTSP_RECONNECT_INTERVAL_SEC "rtsp-reconnect-interval-sec"
128 #define CONFIG_GROUP_SOURCE_RTSP_RECONNECT_ATTEMPTS "rtsp-reconnect-attempts"
129 #define CONFIG_GROUP_SOURCE_RTSP_INIT_RECONNECT_INTERVAL_SEC "init-rtsp-reconnect-interval-sec"
130 #define CONFIG_GROUP_SOURCE_RTSP_BUFFER_MODE "buffer-mode"
131 #define CONFIG_GROUP_SOURCE_SMART_RECORD_ENABLE "smart-record"
132 #define CONFIG_GROUP_SOURCE_SMART_RECORD_DIRPATH "smart-rec-dir-path"
133 #define CONFIG_GROUP_SOURCE_SMART_RECORD_FILE_PREFIX "smart-rec-file-prefix"
134 #define CONFIG_GROUP_SOURCE_SMART_RECORD_CACHE_SIZE_LEGACY "smart-rec-video-cache"
135 #define CONFIG_GROUP_SOURCE_SMART_RECORD_CACHE_SIZE "smart-rec-cache"
136 #define CONFIG_GROUP_SOURCE_SMART_RECORD_CONTAINER "smart-rec-container"
137 #define CONFIG_GROUP_SOURCE_SMART_RECORD_START_TIME "smart-rec-start-time"
138 #define CONFIG_GROUP_SOURCE_SMART_RECORD_DEFAULT_DURATION "smart-rec-default-duration"
139 #define CONFIG_GROUP_SOURCE_SMART_RECORD_DURATION "smart-rec-duration"
140 #define CONFIG_GROUP_SOURCE_SMART_RECORD_INTERVAL "smart-rec-interval"
141 
150 gboolean
152 
163 gboolean
164 parse_dewarper (NvDsDewarperConfig * config, GKeyFile * key_file, gchar *cfg_file_path, gchar * group);
165 
176 gboolean
177 parse_source (NvDsSourceConfig * config, GKeyFile * key_file,
178  gchar * group, gchar * cfg_file_path);
179 
188 gboolean parse_segvisual (NvDsSegVisualConfig * config, GKeyFile * key_file);
189 
198 gboolean parse_osd (NvDsOSDConfig * config, GKeyFile * key_file);
199 
211 gboolean
212 parse_preprocess (NvDsPreProcessConfig * config, GKeyFile * key_file,
213  gchar * group, gchar * cfg_file_path);
214 
226 gboolean
227 parse_gie (NvDsGieConfig * config, GKeyFile * key_file, gchar * group,
228  gchar * cfg_file_path);
229 
239 gboolean
240 parse_tracker (NvDsTrackerConfig * config, GKeyFile * key_file, gchar * cfg_file_path);
241 
250 gboolean
251 parse_text_embedder (NvDsTextEmbedderConfig * config, GKeyFile * key_file,
252  gchar * cfg_file_path);
253 
264 gboolean
265 parse_visionencoder (NvDsVisionEncoderConfig * config, GKeyFile * key_file,
266  gchar * group, gchar * cfg_file_path);
267 
277 gboolean
278 parse_replay (NvDsReplayConfig * config, GKeyFile * key_file, gchar * cfg_file_path);
279 
289 gboolean
290 parse_sink (NvDsSinkSubBinConfig * config, GKeyFile * key_file, gchar * group, gchar * cfg_file_path);
291 
300 gboolean
301 parse_tiled_display (NvDsTiledDisplayConfig * config, GKeyFile * key_file);
302 
311 gboolean
312 parse_dsanalytics (NvDsDsAnalyticsConfig * config, GKeyFile * key_file, gchar* cfg_file_path);
313 
322 gboolean
323 parse_dsexample (NvDsDsExampleConfig * config, GKeyFile * key_file);
324 
334 gboolean
335 parse_streammux (NvDsStreammuxConfig * config, GKeyFile * key_file, gchar * cfg_file_path);
336 
347 gboolean
348 parse_msgconv (NvDsSinkMsgConvBrokerConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path);
349 
360 gboolean
361 parse_msgconsumer (NvDsMsgConsumerConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path);
362 
373 gboolean
374 parse_image_save (NvDsImageSave *config, GKeyFile *key_file,
375  gchar *group, gchar *cfg_file_path);
376 
384 gchar *
385 get_absolute_file_path (gchar *cfg_file_path, gchar * file_path);
386 
387 #ifdef __cplusplus
388 }
389 #endif
390 
391 #endif
deepstream_gie.h
NvDsVisionEncoderConfig
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:28
parse_dewarper
gboolean parse_dewarper(NvDsDewarperConfig *config, GKeyFile *key_file, gchar *cfg_file_path, gchar *group)
Function to read properties of source element from configuration file.
deepstream_replay.h
parse_replay
gboolean parse_replay(NvDsReplayConfig *config, GKeyFile *key_file, gchar *cfg_file_path)
Function to read properties of replay element from configuration file.
get_absolute_file_path
gchar * get_absolute_file_path(gchar *cfg_file_path, gchar *file_path)
Utility function to convert relative path in configuration file with absolute path.
deepstream_audio_classifier.h
deepstream_c2d_msg.h
parse_text_embedder
gboolean parse_text_embedder(NvDsTextEmbedderConfig *config, GKeyFile *key_file, gchar *cfg_file_path)
Function to read properties of text embedder element from configuration file.
NvDsPreProcessConfig
Definition: sources/apps/apps-common/includes/deepstream_preprocess.h:28
deepstream_tiled_display.h
deepstream_image_save.h
NvDsSinkSubBinConfig
Definition: sources/apps/apps-common/includes/deepstream_sinks.h:136
parse_source
gboolean parse_source(NvDsSourceConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path)
Function to read properties of source element from configuration file.
parse_dsexample
gboolean parse_dsexample(NvDsDsExampleConfig *config, GKeyFile *key_file)
Function to read properties of dsexample element from configuration file.
deepstream_streammux.h
NvDsImageSave
Definition: sources/apps/apps-common/includes/deepstream_image_save.h:26
parse_visionencoder
gboolean parse_visionencoder(NvDsVisionEncoderConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path)
Function to read properties of visionencoder element from configuration file.
NvDsSegVisualConfig
Definition: sources/apps/apps-common/includes/deepstream_segvisual.h:38
NvDsDsExampleConfig
Definition: sources/apps/apps-common/includes/deepstream_dsexample.h:28
NvDsTextEmbedderConfig
Definition: sources/apps/apps-common/includes/deepstream_text_embedder.h:28
deepstream_text_embedder.h
parse_sink
gboolean parse_sink(NvDsSinkSubBinConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path)
Function to read properties of sink element from configuration file.
NvDsSinkMsgConvBrokerConfig
Definition: sources/apps/apps-common/includes/deepstream_sinks.h:110
deepstream_sources.h
deepstream_tracker.h
parse_tiled_display
gboolean parse_tiled_display(NvDsTiledDisplayConfig *config, GKeyFile *key_file)
Function to read properties of tiler element from configuration file.
NvDsDsAnalyticsConfig
Definition: sources/apps/apps-common/includes/deepstream_dsanalytics.h:28
parse_osd
gboolean parse_osd(NvDsOSDConfig *config, GKeyFile *key_file)
Function to read properties of OSD element from configuration file.
parse_preprocess
gboolean parse_preprocess(NvDsPreProcessConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path)
Function to read properties of nvdspreprocess element from configuration file.
parse_tracker
gboolean parse_tracker(NvDsTrackerConfig *config, GKeyFile *key_file, gchar *cfg_file_path)
Function to read properties of tracker element from configuration file.
NvDsSourceConfig
Definition: sources/apps/apps-common/includes/deepstream_sources.h:43
deepstream_visionencoder.h
deepstream_preprocess.h
deepstream_dsexample.h
deepstream_dewarper.h
deepstream_config.h
parse_image_save
gboolean parse_image_save(NvDsImageSave *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path)
Function to read properties of image save from configuration file.
NvDsTiledDisplayConfig
Definition: sources/apps/apps-common/includes/deepstream_tiled_display.h:49
NvDsStreammuxConfig
Definition: sources/apps/apps-common/includes/deepstream_streammux.h:28
deepstream_osd.h
parse_gie
gboolean parse_gie(NvDsGieConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path)
Function to read properties of infer element from configuration file.
deepstream_segvisual.h
parse_segvisual
gboolean parse_segvisual(NvDsSegVisualConfig *config, GKeyFile *key_file)
Function to read properties of NvSegVisual element from configuration file.
deepstream_sinks.h
NvDsGieConfig
Definition: sources/apps/apps-common/includes/deepstream_gie.h:40
parse_msgconv
gboolean parse_msgconv(NvDsSinkMsgConvBrokerConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path)
Function to read properties of message converter element from configuration file.
NvDsReplayConfig
Definition: sources/apps/apps-common/includes/deepstream_replay.h:30
parse_labels_file
gboolean parse_labels_file(NvDsGieConfig *config)
Function to parse class label file.
deepstream_dsanalytics.h
NvDsTrackerConfig
Definition: sources/apps/apps-common/includes/deepstream_tracker.h:30
NvDsMsgConsumerConfig
Definition: sources/apps/apps-common/includes/deepstream_c2d_msg.h:40
parse_streammux
gboolean parse_streammux(NvDsStreammuxConfig *config, GKeyFile *key_file, gchar *cfg_file_path)
Function to read properties of streammux element from configuration file.
NvDsOSDConfig
Definition: sources/apps/apps-common/includes/deepstream_osd.h:40
parse_msgconsumer
gboolean parse_msgconsumer(NvDsMsgConsumerConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path)
Function to read properties of message consumer element from configuration file.
parse_dsanalytics
gboolean parse_dsanalytics(NvDsDsAnalyticsConfig *config, GKeyFile *key_file, gchar *cfg_file_path)
Function to read properties of dsanalytics element from configuration file.
NvDsDewarperConfig
Definition: sources/apps/apps-common/includes/deepstream_dewarper.h:40
deepstream_primary_gie.h