NVIDIA DeepStream SDK API Reference

6.4 Release
deepstream_config_file_parser.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __NVGSTDS_CONFIG_PARSER_H__
24 #define __NVGSTDS_CONFIG_PARSER_H__
25 
26 #include <gst/gst.h>
27 
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32 
33 #include "deepstream_config.h"
34 #include "deepstream_sources.h"
35 #include "deepstream_preprocess.h"
36 #include "deepstream_primary_gie.h"
39 #include "deepstream_gie.h"
40 #include "deepstream_sinks.h"
41 #include "deepstream_osd.h"
42 #include "deepstream_segvisual.h"
43 #include "deepstream_sources.h"
44 #include "deepstream_dsanalytics.h"
45 #include "deepstream_dsexample.h"
46 #include "deepstream_streammux.h"
47 #include "deepstream_tracker.h"
48 #include "deepstream_dewarper.h"
49 #include "deepstream_c2d_msg.h"
50 #include "deepstream_image_save.h"
51 
52 #define CONFIG_GROUP_SOURCE_LIST "source-list"
53 #define CONFIG_GROUP_SOURCE_LIST_NUM_SOURCE_BINS "num-source-bins"
54 #define CONFIG_GROUP_SOURCE_LIST_URI_LIST "list"
55 
56 #define CONFIG_GROUP_SOURCE_LIST_SENSOR_ID_LIST "sensor-id-list"
57 #define CONFIG_GROUP_SOURCE_LIST_SENSOR_NAME_LIST "sensor-name-list"
58 
60 #define CONFIG_GROUP_SOURCE_LIST_USE_NVMULTIURISRCBIN "use-nvmultiurisrcbin"
61 #define CONFIG_GROUP_SOURCE_LIST_STREAM_NAME_DISPLAY "stream-name-display"
62 #define CONFIG_GROUP_SOURCE_LIST_MAX_BATCH_SIZE "max-batch-size"
63 #define CONFIG_GROUP_SOURCE_LIST_HTTP_IP "http-ip"
64 #define CONFIG_GROUP_SOURCE_LIST_HTTP_PORT "http-port"
65 
66 #define CONFIG_GROUP_SOURCE_ALL "source-attr-all"
67 
68 #define CONFIG_GROUP_SOURCE "source"
69 #define CONFIG_GROUP_OSD "osd"
70 #define CONFIG_GROUP_SEGVISUAL "segvisual"
71 #define CONFIG_GROUP_PREPROCESS "pre-process"
72 #define CONFIG_GROUP_SECONDARY_PREPROCESS "secondary-pre-process"
73 #define CONFIG_GROUP_PRIMARY_GIE "primary-gie"
74 #define CONFIG_GROUP_SECONDARY_GIE "secondary-gie"
75 #define CONFIG_GROUP_TRACKER "tracker"
76 #define CONFIG_GROUP_SINK "sink"
77 #define CONFIG_GROUP_TILED_DISPLAY "tiled-display"
78 #define CONFIG_GROUP_DSANALYTICS "nvds-analytics"
79 #define CONFIG_GROUP_DSEXAMPLE "ds-example"
80 #define CONFIG_GROUP_STREAMMUX "streammux"
81 #define CONFIG_GROUP_DEWARPER "dewarper"
82 #define CONFIG_GROUP_MSG_CONVERTER "message-converter"
83 #define CONFIG_GROUP_MSG_CONSUMER "message-consumer"
84 #define CONFIG_GROUP_IMG_SAVE "img-save"
85 #define CONFIG_GROUP_AUDIO_TRANSFORM "audio-transform"
86 #define CONFIG_GROUP_AUDIO_CLASSIFIER "audio-classifier"
87 
88 #define CONFIG_GROUP_SOURCE_GPU_ID "gpu-id"
89 #define CONFIG_GROUP_SOURCE_TYPE "type"
90 #define CONFIG_GROUP_SOURCE_CUDA_MEM_TYPE "nvbuf-memory-type"
91 #define CONFIG_GROUP_SOURCE_CAMERA_WIDTH "camera-width"
92 #define CONFIG_GROUP_SOURCE_CAMERA_HEIGHT "camera-height"
93 #define CONFIG_GROUP_SOURCE_CAMERA_FPS_N "camera-fps-n"
94 #define CONFIG_GROUP_SOURCE_CAMERA_FPS_D "camera-fps-d"
95 #define CONFIG_GROUP_SOURCE_CAMERA_CSI_SID "camera-csi-sensor-id"
96 #define CONFIG_GROUP_SOURCE_CAMERA_V4L2_DEVNODE "camera-v4l2-dev-node"
97 #define CONFIG_GROUP_SOURCE_URI "uri"
98 #define CONFIG_GROUP_SOURCE_LIVE_SOURCE "live-source"
99 #define CONFIG_GROUP_SOURCE_FILE_LOOP "file-loop"
100 #define CONFIG_GROUP_SOURCE_LATENCY "latency"
101 #define CONFIG_GROUP_SOURCE_NUM_SOURCES "num-sources"
102 #define CONFIG_GROUP_SOURCE_INTRA_DECODE "intra-decode-enable"
103 #define CONFIG_GROUP_SOURCE_DEC_SKIP_FRAMES "dec-skip-frames"
104 #define CONFIG_GROUP_SOURCE_NUM_DECODE_SURFACES "num-decode-surfaces"
105 #define CONFIG_GROUP_SOURCE_NUM_EXTRA_SURFACES "num-extra-surfaces"
106 #define CONFIG_GROUP_SOURCE_DROP_FRAME_INTERVAL "drop-frame-interval"
107 #define CONFIG_GROUP_SOURCE_CAMERA_ID "camera-id"
108 #define CONFIG_GROUP_SOURCE_ID "source-id"
109 #define CONFIG_GROUP_SOURCE_SELECT_RTP_PROTOCOL "select-rtp-protocol"
110 #define CONFIG_GROUP_SOURCE_RTSP_RECONNECT_INTERVAL_SEC "rtsp-reconnect-interval-sec"
111 #define CONFIG_GROUP_SOURCE_RTSP_RECONNECT_ATTEMPTS "rtsp-reconnect-attempts"
112 #define CONFIG_GROUP_SOURCE_SMART_RECORD_ENABLE "smart-record"
113 #define CONFIG_GROUP_SOURCE_SMART_RECORD_DIRPATH "smart-rec-dir-path"
114 #define CONFIG_GROUP_SOURCE_SMART_RECORD_FILE_PREFIX "smart-rec-file-prefix"
115 #define CONFIG_GROUP_SOURCE_SMART_RECORD_CACHE_SIZE_LEGACY "smart-rec-video-cache"
116 #define CONFIG_GROUP_SOURCE_SMART_RECORD_CACHE_SIZE "smart-rec-cache"
117 #define CONFIG_GROUP_SOURCE_SMART_RECORD_CONTAINER "smart-rec-container"
118 #define CONFIG_GROUP_SOURCE_SMART_RECORD_START_TIME "smart-rec-start-time"
119 #define CONFIG_GROUP_SOURCE_SMART_RECORD_DEFAULT_DURATION "smart-rec-default-duration"
120 #define CONFIG_GROUP_SOURCE_SMART_RECORD_DURATION "smart-rec-duration"
121 #define CONFIG_GROUP_SOURCE_SMART_RECORD_INTERVAL "smart-rec-interval"
122 
131 gboolean
133 
144 gboolean
145 parse_dewarper (NvDsDewarperConfig * config, GKeyFile * key_file, gchar *cfg_file_path, gchar * group);
146 
157 gboolean
158 parse_source (NvDsSourceConfig * config, GKeyFile * key_file,
159  gchar * group, gchar * cfg_file_path);
160 
169 gboolean parse_segvisual (NvDsSegVisualConfig * config, GKeyFile * key_file);
170 
179 gboolean parse_osd (NvDsOSDConfig * config, GKeyFile * key_file);
180 
192 gboolean
193 parse_preprocess (NvDsPreProcessConfig * config, GKeyFile * key_file,
194  gchar * group, gchar * cfg_file_path);
195 
207 gboolean
208 parse_gie (NvDsGieConfig * config, GKeyFile * key_file, gchar * group,
209  gchar * cfg_file_path);
210 
220 gboolean
221 parse_tracker (NvDsTrackerConfig * config, GKeyFile * key_file, gchar * cfg_file_path);
222 
232 gboolean
233 parse_sink (NvDsSinkSubBinConfig * config, GKeyFile * key_file, gchar * group, gchar * cfg_file_path);
234 
243 gboolean
244 parse_tiled_display (NvDsTiledDisplayConfig * config, GKeyFile * key_file);
245 
254 gboolean
255 parse_dsanalytics (NvDsDsAnalyticsConfig * config, GKeyFile * key_file, gchar* cfg_file_path);
256 
265 gboolean
266 parse_dsexample (NvDsDsExampleConfig * config, GKeyFile * key_file);
267 
277 gboolean
278 parse_streammux (NvDsStreammuxConfig * config, GKeyFile * key_file, gchar * cfg_file_path);
279 
290 gboolean
291 parse_msgconv (NvDsSinkMsgConvBrokerConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path);
292 
303 gboolean
304 parse_msgconsumer (NvDsMsgConsumerConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path);
305 
316 gboolean
317 parse_image_save (NvDsImageSave *config, GKeyFile *key_file,
318  gchar *group, gchar *cfg_file_path);
319 
327 gchar *
328 get_absolute_file_path (gchar *cfg_file_path, gchar * file_path);
329 
330 #ifdef __cplusplus
331 }
332 #endif
333 
334 #endif
parse_segvisual
gboolean parse_segvisual(NvDsSegVisualConfig *config, GKeyFile *key_file)
Function to read properties of NvSegVisual element from configuration file.
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_tracker.h
deepstream_streammux.h
NvDsPreProcessConfig
Definition: deepstream_preprocess.h:33
deepstream_dsexample.h
deepstream_dewarper.h
parse_tiled_display
gboolean parse_tiled_display(NvDsTiledDisplayConfig *config, GKeyFile *key_file)
Function to read properties of tiler 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.
NvDsSinkSubBinConfig
Definition: deepstream_sinks.h:137
parse_dsanalytics
gboolean parse_dsanalytics(NvDsDsAnalyticsConfig *config, GKeyFile *key_file, gchar *cfg_file_path)
Function to read properties of dsanalytics element from configuration file.
NvDsImageSave
Definition: deepstream_image_save.h:31
NvDsSegVisualConfig
Definition: deepstream_segvisual.h:44
deepstream_image_save.h
NvDsDsExampleConfig
Definition: deepstream_dsexample.h:33
deepstream_config.h
NvDsSinkMsgConvBrokerConfig
Definition: deepstream_sinks.h:114
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_labels_file
gboolean parse_labels_file(NvDsGieConfig *config)
Function to parse class label file.
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.
deepstream_sinks.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.
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_primary_gie.h
NvDsDsAnalyticsConfig
Definition: deepstream_dsanalytics.h:33
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.
deepstream_osd.h
NvDsSourceConfig
Definition: deepstream_sources.h:47
deepstream_audio_classifier.h
deepstream_c2d_msg.h
NvDsTiledDisplayConfig
Definition: deepstream_tiled_display.h:54
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.
deepstream_gie.h
deepstream_sources.h
NvDsStreammuxConfig
Definition: deepstream_streammux.h:33
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.
NvDsGieConfig
Definition: deepstream_gie.h:43
parse_streammux
gboolean parse_streammux(NvDsStreammuxConfig *config, GKeyFile *key_file, gchar *cfg_file_path)
Function to read properties of streammux element from configuration file.
deepstream_preprocess.h
parse_dsexample
gboolean parse_dsexample(NvDsDsExampleConfig *config, GKeyFile *key_file)
Function to read properties of dsexample 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_segvisual.h
parse_osd
gboolean parse_osd(NvDsOSDConfig *config, GKeyFile *key_file)
Function to read properties of OSD element from configuration file.
NvDsTrackerConfig
Definition: deepstream_tracker.h:35
NvDsMsgConsumerConfig
Definition: deepstream_c2d_msg.h:46
deepstream_dsanalytics.h
deepstream_tiled_display.h
NvDsOSDConfig
Definition: deepstream_osd.h:45
NvDsDewarperConfig
Definition: deepstream_dewarper.h:45