Commit 24460ef5 authored by das-qa's avatar das-qa
Browse files

Add python demo: deepstream-test1, deepstream-test2, deepstream-test3 and deepstream-test4

parent 77e9fc8c
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_APP_VERSION_H__
#define __NVGSTDS_APP_VERSION_H__
#define NVDS_APP_VERSION_MAJOR 7
#define NVDS_APP_VERSION_MINOR 1
#define NVDS_APP_VERSION_MICRO 0
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2020 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_AUDIO_CLASSIFIER_H__
#define __NVGSTDS_AUDIO_CLASSIFIER_H__
#ifdef __cplusplus
extern "C"
{
#endif
#include "deepstream_gie.h"
typedef struct
{
GstElement *bin;
GstElement *queue;
GstElement *classifier;
} NvDsAudioClassifierBin;
/**
* Initialize @ref NvDsAudioClassifierBin. It creates and adds primary infer and
* other elements needed for processing to the bin.
* It also sets properties mentioned in the configuration file under
* group @ref CONFIG_GROUP_AUDIO_CLASSIFIER
*
* @param[in] config pointer to infer @ref NvDsGieConfig parsed from
* configuration file.
* @param[in] bin pointer to @ref NvDsAudioClassifierBin to be filled.
*
* @return true if bin created successfully.
*/
gboolean create_audio_classifier_bin (NvDsGieConfig *config,
NvDsAudioClassifierBin *bin);
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2020 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_C2D_MSG_H__
#define __NVGSTDS_C2D_MSG_H__
#include <gst/gst.h>
#include "nvmsgbroker.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct NvDsC2DContext {
gpointer libHandle;
gchar *protoLib;
gchar *connStr;
gchar *configFile;
gpointer uData;
GHashTable *hashMap;
NvMsgBrokerClientHandle connHandle;
nv_msgbroker_subscribe_cb_t subscribeCb;
} NvDsC2DContext;
typedef struct NvDsMsgConsumerConfig {
gboolean enable;
gchar *proto_lib;
gchar *conn_str;
gchar *config_file_path;
GPtrArray *topicList;
gchar *sensor_list_file;
} NvDsMsgConsumerConfig;
NvDsC2DContext*
start_cloud_to_device_messaging (NvDsMsgConsumerConfig *config,
nv_msgbroker_subscribe_cb_t cb,
void *uData);
gboolean stop_cloud_to_device_messaging (NvDsC2DContext* uCtx);
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2020 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_C2D_MSG_UTIL_H__
#define __NVGSTDS_C2D_MSG_UTIL_H__
#include <glib.h>
#include "deepstream_c2d_msg.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef enum {
NVDS_C2D_MSG_SR_START,
NVDS_C2D_MSG_SR_STOP
} NvDsC2DMsgType;
typedef struct NvDsC2DMsg {
NvDsC2DMsgType type;
gpointer message;
guint msgSize;
} NvDsC2DMsg;
typedef struct NvDsC2DMsgSR {
gchar *sensorStr;
gint startTime;
guint duration;
} NvDsC2DMsgSR;
NvDsC2DMsg* nvds_c2d_parse_cloud_message (gpointer data, guint size);
void nvds_c2d_release_message (NvDsC2DMsg *msg);
gboolean nvds_c2d_parse_sensor (NvDsC2DContext *ctx, const gchar *file);
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2019 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_COMMON_H__
#define __NVGSTDS_COMMON_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "deepstream_config.h"
#define NVGSTDS_ERR_MSG_V(msg, ...) \
g_print("** ERROR: <%s:%d>: " msg "\n", __func__, __LINE__, ##__VA_ARGS__)
#define NVGSTDS_INFO_MSG_V(msg, ...) \
g_print("** INFO: <%s:%d>: " msg "\n", __func__, __LINE__, ##__VA_ARGS__)
#define NVGSTDS_WARN_MSG_V(msg, ...) \
g_print("** WARN: <%s:%d>: " msg "\n", __func__, __LINE__, ##__VA_ARGS__)
#define NVGSTDS_LINK_ELEMENT(elem1, elem2) \
do { \
if (!gst_element_link (elem1,elem2)) { \
GstCaps *src_caps, *sink_caps; \
src_caps = gst_pad_query_caps ((GstPad *) (elem1)->srcpads->data, NULL); \
sink_caps = gst_pad_query_caps ((GstPad *) (elem2)->sinkpads->data, NULL); \
NVGSTDS_ERR_MSG_V ("Failed to link '%s' (%s) and '%s' (%s)", \
GST_ELEMENT_NAME (elem1), \
gst_caps_to_string (src_caps), \
GST_ELEMENT_NAME (elem2), \
gst_caps_to_string (sink_caps)); \
goto done; \
} \
} while (0)
#define NVGSTDS_LINK_ELEMENT_FULL(elem1, elem1_pad_name, elem2, elem2_pad_name) \
do { \
GstPad *elem1_pad = gst_element_get_static_pad(elem1, elem1_pad_name); \
GstPad *elem2_pad = gst_element_get_static_pad(elem2, elem2_pad_name); \
GstPadLinkReturn ret = gst_pad_link (elem1_pad,elem2_pad); \
if (ret != GST_PAD_LINK_OK) { \
gchar *n1 = gst_pad_get_name (elem1_pad); \
gchar *n2 = gst_pad_get_name (elem2_pad); \
NVGSTDS_ERR_MSG_V ("Failed to link '%s' and '%s': %d", \
n1, n2, ret); \
g_free (n1); \
g_free (n2); \
gst_object_unref (elem1_pad); \
gst_object_unref (elem2_pad); \
goto done; \
} \
gst_object_unref (elem1_pad); \
gst_object_unref (elem2_pad); \
} while (0)
#define NVGSTDS_BIN_ADD_GHOST_PAD_NAMED(bin, elem, pad, ghost_pad_name) \
do { \
GstPad *gstpad = gst_element_get_static_pad (elem, pad); \
if (!gstpad) { \
NVGSTDS_ERR_MSG_V ("Could not find '%s' in '%s'", pad, \
GST_ELEMENT_NAME(elem)); \
goto done; \
} \
gst_element_add_pad (bin, gst_ghost_pad_new (ghost_pad_name, gstpad)); \
gst_object_unref (gstpad); \
} while (0)
#define NVGSTDS_BIN_ADD_GHOST_PAD(bin, elem, pad) \
NVGSTDS_BIN_ADD_GHOST_PAD_NAMED (bin, elem, pad, pad)
#define NVGSTDS_ELEM_ADD_PROBE(probe_id, elem, pad, probe_func, probe_type, probe_data) \
do { \
GstPad *gstpad = gst_element_get_static_pad (elem, pad); \
if (!gstpad) { \
NVGSTDS_ERR_MSG_V ("Could not find '%s' in '%s'", pad, \
GST_ELEMENT_NAME(elem)); \
goto done; \
} \
probe_id = gst_pad_add_probe(gstpad, (probe_type), probe_func, probe_data, NULL); \
gst_object_unref (gstpad); \
} while (0)
#define NVGSTDS_ELEM_REMOVE_PROBE(probe_id, elem, pad) \
do { \
if (probe_id == 0 || !elem) { \
break; \
} \
GstPad *gstpad = gst_element_get_static_pad (elem, pad); \
if (!gstpad) { \
NVGSTDS_ERR_MSG_V ("Could not find '%s' in '%s'", pad, \
GST_ELEMENT_NAME(elem)); \
break; \
} \
gst_pad_remove_probe(gstpad, probe_id); \
gst_object_unref (gstpad); \
} while (0)
#define GET_FILE_PATH(path) ((path) + (((path) && strstr ((path), "file://")) ? 7 : 0))
/**
* Function to link sink pad of an element to source pad of tee.
*
* @param[in] tee Tee element.
* @param[in] sinkelem downstream element.
*
* @return true if link successful.
*/
gboolean
link_element_to_tee_src_pad (GstElement * tee, GstElement * sinkelem);
/**
* Function to link source pad of an element to sink pad of muxer element.
*
* @param[in] streammux muxer element.
* @param[in] elem upstream element.
* @param[in] index pad index of muxer element.
*
* @return true if link successful.
*/
gboolean
link_element_to_streammux_sink_pad (GstElement *streammux, GstElement *elem,
gint index);
/**
* Function to unlink source pad of an element from sink pad of muxer element.
*
* @param[in] streammux muxer element.
* @param[in] elem upstream element.
*
* @return true if unlinking was successful.
*/
gboolean
unlink_element_from_streammux_sink_pad (GstElement *streammux, GstElement *elem);
/**
* Function to link sink pad of an element to source pad of demux element.
*
* @param[in] demux demuxer element.
* @param[in] elem downstream element.
* @param[in] index pad index of demuxer element.
*
* @return true if link successful.
*/
gboolean
link_element_to_demux_src_pad (GstElement *demux, GstElement *elem,
guint index);
/*
* Function to replace string with another string.
* Make sure @ref src is big enough to accommodate replacements.
*
* @param[in] str string to search in.
* @param[in] replace string to replace.
* @param[in] replace_with string to replace @ref replace with.
*/
void
str_replace (gchar * str, const gchar * replace, const gchar * replace_with);
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_CONFIG_H__
#define __NVGSTDS_CONFIG_H__
#ifdef __aarch64__
#define IS_TEGRA
#endif
#define MEMORY_FEATURES "memory:NVMM"
#ifdef IS_TEGRA
#define NVDS_ELEM_SRC_CAMERA_CSI "nvarguscamerasrc"
#else
#define NVDS_ELEM_SRC_CAMERA_CSI "videotestsrc"
#endif
#define NVDS_ELEM_SRC_CAMERA_V4L2 "v4l2src"
#define NVDS_ELEM_SRC_URI "uridecodebin"
#define NVDS_ELEM_SRC_MULTIFILE "multifilesrc"
#define NVDS_ELEM_SRC_ALSA "alsasrc"
#define NVDS_ELEM_DECODEBIN "decodebin"
#define NVDS_ELEM_WAVPARSE "wavparse"
#define NVDS_ELEM_QUEUE "queue"
#define NVDS_ELEM_CAPS_FILTER "capsfilter"
#define NVDS_ELEM_TEE "tee"
#define NVDS_ELEM_IDENTITY "identity"
#define NVDS_ELEM_PREPROCESS "nvdspreprocess"
#define NVDS_ELEM_SECONDARY_PREPROCESS "nvdspreprocess"
#define NVDS_ELEM_PGIE "nvinfer"
#define NVDS_ELEM_SGIE "nvinfer"
#define NVDS_ELEM_NVINFER "nvinfer"
#define NVDS_ELEM_INFER_SERVER "nvinferserver"
#define NVDS_ELEM_INFER_AUDIO "nvinferaudio"
#define NVDS_ELEM_TRACKER "nvtracker"
#define NVDS_ELEM_VIDEO_CONV "nvvideoconvert"
#define NVDS_ELEM_AUDIO_CONV "audioconvert"
#define NVDS_ELEM_AUDIO_RESAMPLER "audioresample"
#define NVDS_ELEM_STREAM_MUX "nvstreammux"
#define NVDS_ELEM_STREAM_DEMUX "nvstreamdemux"
#define NVDS_ELEM_TILER "nvmultistreamtiler"
#define NVDS_ELEM_OSD "nvdsosd"
#define NVDS_ELEM_SEGVISUAL "nvsegvisual"
#define NVDS_ELEM_DSANALYTICS_ELEMENT "nvdsanalytics"
#define NVDS_ELEM_DSEXAMPLE_ELEMENT "dsexample"
#define NVDS_ELEM_DEWARPER "nvdewarper"
#define NVDS_ELEM_SPOTANALYSIS "nvspot"
#define NVDS_ELEM_NVAISLE "nvaisle"
#define NVDS_ELEM_BBOXFILTER "nvbboxfilter"
#define NVDS_ELEM_MSG_CONV "nvmsgconv"
#define NVDS_ELEM_MSG_BROKER "nvmsgbroker"
#define NVDS_ELEM_SINK_FAKESINK "fakesink"
#define NVDS_ELEM_SINK_FILE "filesink"
#define NVDS_ELEM_SINK_EGL "nveglglessink"
#define NVDS_ELEM_SINK_3D "nv3dsink"
#define NVDS_ELEM_SINK_DRM "nvdrmvideosink"
#define NVDS_ELEM_EGLTRANSFORM "nvegltransform"
#define NVDS_ELEM_MUX_MP4 "qtmux"
#define NVDS_ELEM_MKV "matroskamux"
#define NVDS_ELEM_ENC_H264_HW "nvv4l2h264enc"
#define NVDS_ELEM_ENC_H265_HW "nvv4l2h265enc"
#define NVDS_ELEM_ENC_MPEG4 "avenc_mpeg4"
#define NVDS_ELEM_ENC_H264_SW "x264enc"
#define NVDS_ELEM_ENC_H265_SW "x265enc"
#define MAX_SOURCE_BINS 1024
#define MAX_SINK_BINS (1024)
#define MAX_SECONDARY_GIE_BINS (16)
#define MAX_SECONDARY_PREPROCESS_BINS (16)
#define MAX_MESSAGE_CONSUMERS (16)
#define NVDS_ELEM_NVMULTIURISRCBIN "nvmultiurisrcbin"
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_CONFIG_PARSER_H__
#define __NVGSTDS_CONFIG_PARSER_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "deepstream_config.h"
#include "deepstream_sources.h"
#include "deepstream_preprocess.h"
#include "deepstream_primary_gie.h"
#include "deepstream_audio_classifier.h"
#include "deepstream_tiled_display.h"
#include "deepstream_gie.h"
#include "deepstream_sinks.h"
#include "deepstream_osd.h"
#include "deepstream_segvisual.h"
#include "deepstream_sources.h"
#include "deepstream_dsanalytics.h"
#include "deepstream_dsexample.h"
#include "deepstream_streammux.h"
#include "deepstream_tracker.h"
#include "deepstream_dewarper.h"
#include "deepstream_c2d_msg.h"
#include "deepstream_image_save.h"
#define CONFIG_GROUP_SOURCE_LIST "source-list"
#define CONFIG_GROUP_SOURCE_LIST_NUM_SOURCE_BINS "num-source-bins"
#define CONFIG_GROUP_SOURCE_LIST_URI_LIST "list"
/** this vector is one to one mapped with the uri-list/list */
#define CONFIG_GROUP_SOURCE_LIST_SENSOR_ID_LIST "sensor-id-list"
#define CONFIG_GROUP_SOURCE_LIST_SENSOR_NAME_LIST "sensor-name-list"
/** additional configs to support nvmultiurisrcbin usage */
#define CONFIG_GROUP_SOURCE_LIST_USE_NVMULTIURISRCBIN "use-nvmultiurisrcbin"
#define CONFIG_GROUP_SOURCE_LIST_STREAM_NAME_DISPLAY "stream-name-display"
#define CONFIG_GROUP_SOURCE_LIST_MAX_BATCH_SIZE "max-batch-size"
#define CONFIG_GROUP_SOURCE_LIST_HTTP_IP "http-ip"
#define CONFIG_GROUP_SOURCE_LIST_HTTP_PORT "http-port"
#define CONFIG_GROUP_SOURCE_EXTRACT_SEI_TYPE5_DATA "extract-sei-type5-data"
#define CONFIG_GROUP_SOURCE_SEI_UUID "sei-uuid"
#define CONFIG_GROUP_SOURCE_LIST_LOW_LATENCY_MODE "low-latency-mode"
#define CONFIG_GROUP_SOURCE_ALL "source-attr-all"
#define CONFIG_GROUP_SOURCE "source"
#define CONFIG_GROUP_OSD "osd"
#define CONFIG_GROUP_SEGVISUAL "segvisual"
#define CONFIG_GROUP_PREPROCESS "pre-process"
#define CONFIG_GROUP_SECONDARY_PREPROCESS "secondary-pre-process"
#define CONFIG_GROUP_PRIMARY_GIE "primary-gie"
#define CONFIG_GROUP_SECONDARY_GIE "secondary-gie"
#define CONFIG_GROUP_TRACKER "tracker"
#define CONFIG_GROUP_SINK "sink"
#define CONFIG_GROUP_TILED_DISPLAY "tiled-display"
#define CONFIG_GROUP_DSANALYTICS "nvds-analytics"
#define CONFIG_GROUP_DSEXAMPLE "ds-example"
#define CONFIG_GROUP_STREAMMUX "streammux"
#define CONFIG_GROUP_DEWARPER "dewarper"
#define CONFIG_GROUP_MSG_CONVERTER "message-converter"
#define CONFIG_GROUP_MSG_CONSUMER "message-consumer"
#define CONFIG_GROUP_IMG_SAVE "img-save"
#define CONFIG_GROUP_AUDIO_TRANSFORM "audio-transform"
#define CONFIG_GROUP_AUDIO_CLASSIFIER "audio-classifier"
#define CONFIG_GROUP_SOURCE_GPU_ID "gpu-id"
#define CONFIG_GROUP_SOURCE_TYPE "type"
#define CONFIG_GROUP_SOURCE_CUDA_MEM_TYPE "nvbuf-memory-type"
#define CONFIG_GROUP_SOURCE_CAMERA_WIDTH "camera-width"
#define CONFIG_GROUP_SOURCE_CAMERA_HEIGHT "camera-height"
#define CONFIG_GROUP_SOURCE_CAMERA_FPS_N "camera-fps-n"
#define CONFIG_GROUP_SOURCE_CAMERA_FPS_D "camera-fps-d"
#define CONFIG_GROUP_SOURCE_CAMERA_CSI_SID "camera-csi-sensor-id"
#define CONFIG_GROUP_SOURCE_CAMERA_V4L2_DEVNODE "camera-v4l2-dev-node"
#define CONFIG_GROUP_SOURCE_URI "uri"
#define CONFIG_GROUP_SOURCE_LIVE_SOURCE "live-source"
#define CONFIG_GROUP_SOURCE_FILE_LOOP "file-loop"
#define CONFIG_GROUP_SOURCE_LATENCY "latency"
#define CONFIG_GROUP_SOURCE_NUM_SOURCES "num-sources"
#define CONFIG_GROUP_SOURCE_INTRA_DECODE "intra-decode-enable"
#define CONFIG_GROUP_SOURCE_DEC_SKIP_FRAMES "dec-skip-frames"
#define CONFIG_GROUP_SOURCE_NUM_DECODE_SURFACES "num-decode-surfaces"
#define CONFIG_GROUP_SOURCE_NUM_EXTRA_SURFACES "num-extra-surfaces"
#define CONFIG_GROUP_SOURCE_DROP_FRAME_INTERVAL "drop-frame-interval"
#define CONFIG_GROUP_SOURCE_CAMERA_ID "camera-id"
#define CONFIG_GROUP_SOURCE_ID "source-id"
#define CONFIG_GROUP_SOURCE_SELECT_RTP_PROTOCOL "select-rtp-protocol"
#define CONFIG_GROUP_SOURCE_RTSP_RECONNECT_INTERVAL_SEC "rtsp-reconnect-interval-sec"
#define CONFIG_GROUP_SOURCE_RTSP_RECONNECT_ATTEMPTS "rtsp-reconnect-attempts"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_ENABLE "smart-record"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_DIRPATH "smart-rec-dir-path"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_FILE_PREFIX "smart-rec-file-prefix"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_CACHE_SIZE_LEGACY "smart-rec-video-cache"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_CACHE_SIZE "smart-rec-cache"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_CONTAINER "smart-rec-container"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_START_TIME "smart-rec-start-time"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_DEFAULT_DURATION "smart-rec-default-duration"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_DURATION "smart-rec-duration"
#define CONFIG_GROUP_SOURCE_SMART_RECORD_INTERVAL "smart-rec-interval"
/**
* Function to parse class label file. Parses the labels into a 2D-array of
* strings. Refer the SDK documentation for format of the labels file.
*
* @param[in] config pointer to @ref NvDsGieConfig
*
* @return true if file parsed successfully else returns false.
*/
gboolean
parse_labels_file (NvDsGieConfig *config);
/**
* Function to read properties of source element from configuration file.
*
* @param[in] config pointer to @ref NvDsDewarperConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] group name of property group @ref CONFIG_GROUP_DEWARPER
* @param[in] cfg_file_path path of configuration file.
*
* @return true if parsed successfully.
*/
gboolean
parse_dewarper (NvDsDewarperConfig * config, GKeyFile * key_file, gchar *cfg_file_path, gchar * group);
/**
* Function to read properties of source element from configuration file.
*
* @param[in] config pointer to @ref NvDsSourceConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] group name of property group @ref CONFIG_GROUP_SOURCE
* @param[in] cfg_file_path path of configuration file.
*
* @return true if parsed successfully.
*/
gboolean
parse_source (NvDsSourceConfig * config, GKeyFile * key_file,
gchar * group, gchar * cfg_file_path);
/**
* Function to read properties of NvSegVisual element from configuration file.
*
* @param[in] config pointer to @ref NvDsSegVisualConfig
* @param[in] key_file pointer to file having key value pairs.
*
* @return true if parsed successfully.
*/
gboolean parse_segvisual (NvDsSegVisualConfig * config, GKeyFile * key_file);
/**
* Function to read properties of OSD element from configuration file.
*
* @param[in] config pointer to @ref NvDsOSDConfig
* @param[in] key_file pointer to file having key value pairs.
*
* @return true if parsed successfully.
*/
gboolean parse_osd (NvDsOSDConfig * config, GKeyFile * key_file);
/**
* Function to read properties of nvdspreprocess element from configuration file.
*
* @param[in] config pointer to @ref NvDsPreProcessConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] group name of property group @ref CONFIG_GROUP_PREPROCESS and
* @ref CONFIG_GROUP_SECONDARY_PREPROCESS
* @param[in] cfg_file_path path of configuration file.
*
* @return true if parsed successfully.
*/
gboolean
parse_preprocess (NvDsPreProcessConfig * config, GKeyFile * key_file,
gchar * group, gchar * cfg_file_path);
/**
* Function to read properties of infer element from configuration file.
*
* @param[in] config pointer to @ref NvDsGieConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] group name of property group @ref CONFIG_GROUP_PRIMARY_GIE and
* @ref CONFIG_GROUP_SECONDARY_GIE
* @param[in] cfg_file_path path of configuration file.
*
* @return true if parsed successfully.
*/
gboolean
parse_gie (NvDsGieConfig * config, GKeyFile * key_file, gchar * group,
gchar * cfg_file_path);
/**
* Function to read properties of tracker element from configuration file.
*
* @param[in] config pointer to @ref NvDsTrackerConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] cfg_file_path path of configuration file.
*
* @return true if parsed successfully.
*/
gboolean
parse_tracker (NvDsTrackerConfig * config, GKeyFile * key_file, gchar * cfg_file_path);
/**
* Function to read properties of sink element from configuration file.
*
* @param[in] config pointer to @ref NvDsSinkSubBinConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] group name of property group @ref CONFIG_GROUP_SINK
*
* @return true if parsed successfully.
*/
gboolean
parse_sink (NvDsSinkSubBinConfig * config, GKeyFile * key_file, gchar * group, gchar * cfg_file_path);
/**
* Function to read properties of tiler element from configuration file.
*
* @param[in] config pointer to @ref NvDsTiledDisplayConfig
* @param[in] key_file pointer to file having key value pairs.
*
* @return true if parsed successfully.
*/
gboolean
parse_tiled_display (NvDsTiledDisplayConfig * config, GKeyFile * key_file);
/**
* Function to read properties of dsanalytics element from configuration file.
*
* @param[in] config pointer to @ref NvDsDsAnalyticsConfig
* @param[in] key_file pointer to file having key value pairs.
*
* @return true if parsed successfully.
*/
gboolean
parse_dsanalytics (NvDsDsAnalyticsConfig * config, GKeyFile * key_file, gchar* cfg_file_path);
/**
* Function to read properties of dsexample element from configuration file.
*
* @param[in] config pointer to @ref NvDsDsExampleConfig
* @param[in] key_file pointer to file having key value pairs.
*
* @return true if parsed successfully.
*/
gboolean
parse_dsexample (NvDsDsExampleConfig * config, GKeyFile * key_file);
/**
* Function to read properties of streammux element from configuration file.
*
* @param[in] config pointer to @ref NvDsStreammuxConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] cfg_file_path path of configuration file.
*
* @return true if parsed successfully.
*/
gboolean
parse_streammux (NvDsStreammuxConfig * config, GKeyFile * key_file, gchar * cfg_file_path);
/**
* Function to read properties of message converter element from configuration file.
*
* @param[in] config pointer to @ref NvDsSinkMsgConvBrokerConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] group name of property group @ref CONFIG_GROUP_MSG_CONVERTER
* @param[in] cfg_file_path path of configuration file.
*
* @return true if parsed successfully.
*/
gboolean
parse_msgconv (NvDsSinkMsgConvBrokerConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path);
/**
* Function to read properties of message consumer element from configuration file.
*
* @param[in] config pointer to @ref NvDsMsgConsumerConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] group name of property group @ref CONFIG_GROUP_MSG_CONSUMER
* @param[in] cfg_file_path path of configuration file.
*
* @return true if parsed successfully.
*/
gboolean
parse_msgconsumer (NvDsMsgConsumerConfig *config, GKeyFile *key_file, gchar *group, gchar *cfg_file_path);
/**
* Function to read properties of image save from configuration file.
*
* @param[in] config pointer to @ref NvDsMsgConsumerConfig
* @param[in] key_file pointer to file having key value pairs.
* @param[in] group name of property group @ref CONFIG_GROUP_MSG_CONSUMER
* @param[in] cfg_file_path path of configuration file.
*
* @return true if parsed successfully.
*/
gboolean
parse_image_save (NvDsImageSave *config, GKeyFile *key_file,
gchar *group, gchar *cfg_file_path);
/**
* Utility function to convert relative path in configuration file
* with absolute path.
*
* @param[in] cfg_file_path path of configuration file.
* @param[in] file_path relative path of file.
*/
gchar *
get_absolute_file_path (gchar *cfg_file_path, gchar * file_path);
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef _NVGSTDS_STREAMMUX_YAML_H_
#define _NVGSTDS_STREAMMUX_YAML_H_
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type"
#include <yaml-cpp/yaml.h>
#pragma GCC diagnostic pop
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "deepstream_streammux.h"
#include "deepstream_tiled_display.h"
#include "deepstream_osd.h"
#include "deepstream_segvisual.h"
#include "deepstream_image_save.h"
#include "deepstream_c2d_msg.h"
#include "deepstream_sinks.h"
#include "deepstream_sources.h"
#include "deepstream_tracker.h"
#include "deepstream_gie.h"
#include "deepstream_preprocess.h"
#include "deepstream_dewarper.h"
#include "deepstream_dsanalytics.h"
#include "deepstream_dsexample.h"
#define _MAX_STR_LENGTH 1024
std::vector<std::string> split_string (std::string input);
gboolean
get_absolute_file_path_yaml (
const gchar * cfg_file_path, const gchar * file_path,
char *abs_path_str);
gboolean
parse_streammux_yaml (NvDsStreammuxConfig *config, gchar *cfg_file_path);
gboolean
parse_tiled_display_yaml (NvDsTiledDisplayConfig *config, gchar *cfg_file_path);
gboolean
parse_osd_yaml (NvDsOSDConfig *config, gchar *cfg_file_path);
gboolean
parse_segvisual_yaml (NvDsSegVisualConfig *config, gchar *cfg_file_path);
gboolean
parse_image_save_yaml (NvDsImageSave *config, gchar *cfg_file_path);
gboolean
parse_msgconsumer_yaml (NvDsMsgConsumerConfig *config, std::string group, gchar *cfg_file_path);
gboolean
parse_msgconv_yaml (NvDsSinkMsgConvBrokerConfig *config, std::string group, gchar *cfg_file_path);
gboolean
parse_sink_yaml (NvDsSinkSubBinConfig *config, std::string group, gchar * cfg_file_path);
gboolean
parse_source_yaml (NvDsSourceConfig *config, std::vector<std::string> headers,
std::vector<std::string> source_values, gchar *cfg_file_path);
gboolean
parse_tracker_yaml (NvDsTrackerConfig *config, gchar *cfg_file_path);
gboolean
parse_gie_yaml (NvDsGieConfig *config, std::string group, gchar *cfg_file_path);
gboolean
parse_preprocess_yaml (NvDsPreProcessConfig *config, gchar* cfg_file_path);
gboolean
parse_dewarper_yaml (NvDsDewarperConfig * config, std::string group_str, gchar *cfg_file_path);
gboolean
parse_dsexample_yaml (NvDsDsExampleConfig *config, gchar *cfg_file_path);
gboolean
parse_dsanalytics_yaml (NvDsDsAnalyticsConfig *config, gchar* cfg_file_path);
#ifdef __cplusplus
}
#endif
#endif /* _NVGSTDS_DSEXAMPLE_H_ */
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_DEWARPER_H__
#define __NVGSTDS_DEWARPER_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
GstElement *bin;
GstElement *queue;
GstElement *src_queue;
GstElement *conv_queue;
GstElement *nvvidconv;
GstElement *cap_filter;
GstElement *dewarper_caps_filter;
GstElement *nvdewarper;
} NvDsDewarperBin;
typedef struct
{
gboolean enable;
guint gpu_id;
guint num_out_buffers;
guint dewarper_dump_frames;
gchar *config_file;
guint nvbuf_memory_type;
guint source_id;
guint num_surfaces_per_frame;
guint num_batch_buffers;
} NvDsDewarperConfig;
gboolean create_dewarper_bin (NvDsDewarperConfig * config, NvDsDewarperBin * bin);
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef _NVGSTDS_DSANALYTICS_H_
#define _NVGSTDS_DSANALYTICS_H_
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
// Create a bin for the element only if enabled
gboolean enable;
guint unique_id;
// Config file path having properties for the element
gchar *config_file_path;
} NvDsDsAnalyticsConfig;
// Struct to store references to the bin and elements
typedef struct
{
GstElement *bin;
GstElement *queue;
GstElement *elem_dsanalytics;
} NvDsDsAnalyticsBin;
// Function to create the bin and set properties
gboolean
create_dsanalytics_bin (NvDsDsAnalyticsConfig *config, NvDsDsAnalyticsBin *bin);
#ifdef __cplusplus
}
#endif
#endif /* _NVGSTDS_DSANALYTICS_H_ */
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef _NVGSTDS_DSEXAMPLE_H_
#define _NVGSTDS_DSEXAMPLE_H_
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
// Create a bin for the element only if enabled
gboolean enable;
// Struct members to store config / properties for the element
gboolean full_frame;
gint processing_width;
gint processing_height;
gboolean blur_objects;
guint unique_id;
guint gpu_id;
guint batch_size;
// For nvvidconv
guint nvbuf_memory_type;
} NvDsDsExampleConfig;
// Struct to store references to the bin and elements
typedef struct
{
GstElement *bin;
GstElement *queue;
GstElement *pre_conv;
GstElement *cap_filter;
GstElement *elem_dsexample;
} NvDsDsExampleBin;
// Function to create the bin and set properties
gboolean
create_dsexample_bin (NvDsDsExampleConfig *config, NvDsDsExampleBin *bin);
#ifdef __cplusplus
}
#endif
#endif /* _NVGSTDS_DSEXAMPLE_H_ */
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2020 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_GIE_H__
#define __NVGSTDS_GIE_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "gstnvdsmeta.h"
#include "gstnvdsinfer.h"
#include "deepstream_config.h"
typedef enum
{
NV_DS_GIE_PLUGIN_INFER = 0,
NV_DS_GIE_PLUGIN_INFER_SERVER,
} NvDsGiePluginType;
typedef struct
{
gboolean enable;
gchar *config_file_path;
gboolean input_tensor_meta;
gboolean override_colors;
gint operate_on_gie_id;
gboolean is_operate_on_gie_id_set;
gint operate_on_classes;
gint num_operate_on_class_ids;
gint *list_operate_on_class_ids;
gboolean have_bg_color;
NvOSD_ColorParams bbox_bg_color;
NvOSD_ColorParams bbox_border_color;
GHashTable *bbox_border_color_table;
GHashTable *bbox_bg_color_table;
guint batch_size;
gboolean is_batch_size_set;
guint interval;
gboolean is_interval_set;
guint unique_id;
gboolean is_unique_id_set;
guint gpu_id;
gboolean is_gpu_id_set;
guint nvbuf_memory_type;
gchar *model_engine_file_path;
gchar *audio_transform;
guint frame_size;
gboolean is_frame_size_set;
guint hop_size;
gboolean is_hop_size_set;
guint input_audio_rate;
gchar *label_file_path;
guint n_labels;
guint *n_label_outputs;
gchar ***labels;
gchar *raw_output_directory;
gulong file_write_frame_num;
gchar *tag;
NvDsGiePluginType plugin_type;
} NvDsGieConfig;
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_IMAGE_SAVE_H__
#define __NVGSTDS_IMAGE_SAVE_H__
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct {
gboolean enable;
guint gpu_id;
gchar *output_folder_path;
gboolean save_image_full_frame;
gboolean save_image_cropped_object;
gchar *frame_to_skip_rules_path;
guint second_to_skip_interval;
gdouble min_confidence;
gdouble max_confidence;
guint min_box_width;
guint min_box_height;
} NvDsImageSave;
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2019 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_OSD_H__
#define __NVGSTDS_OSD_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "nvll_osd_struct.h"
typedef struct
{
GstElement *bin;
GstElement *queue;
GstElement *nvvidconv;
GstElement *conv_queue;
GstElement *cap_filter;
GstElement *nvosd;
} NvDsOSDBin;
typedef struct
{
gboolean enable;
gboolean text_has_bg;
gboolean enable_clock;
gboolean draw_text;
gboolean draw_bbox;
gboolean draw_mask;
gint text_size;
gint border_width;
gint clock_text_size;
gint clock_x_offset;
gint clock_y_offset;
guint gpu_id;
guint nvbuf_memory_type; /* For nvvidconv */
guint num_out_buffers;
gchar *font;
gchar *hw_blend_color_attr;
NvOSD_Mode mode;
NvOSD_ColorParams clock_color;
NvOSD_ColorParams text_color;
NvOSD_ColorParams text_bg_color;
} NvDsOSDConfig;
/**
* Initialize @ref NvDsOSDBin. It creates and adds OSD and other elements
* needed for processing to the bin. It also sets properties mentioned
* in the configuration file under group @ref CONFIG_GROUP_OSD
*
* @param[in] config pointer to OSD @ref NvDsOSDConfig parsed from config file.
* @param[in] bin pointer to @ref NvDsOSDBin to be filled.
*
* @return true if bin created successfully.
*/
gboolean create_osd_bin (NvDsOSDConfig *config, NvDsOSDBin *bin);
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_PERF_H__
#define __NVGSTDS_PERF_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
#include "deepstream_config.h"
typedef struct
{
guint source_id;
gchar const* uri;
gchar const* sensor_id;
gchar const* sensor_name;
}NvDsFPSSensorInfo;
typedef struct
{
guint source_id;
char *stream_name;
gchar const* sensor_id;
gchar const* sensor_name;
} NvDsAppSourceDetail;
typedef struct
{
gdouble fps[MAX_SOURCE_BINS];
gdouble fps_avg[MAX_SOURCE_BINS];
guint num_instances;
NvDsAppSourceDetail source_detail[MAX_SOURCE_BINS];
guint active_source_size;
gboolean stream_name_display;
gboolean use_nvmultiurisrcbin;
} NvDsAppPerfStruct;
typedef void (*perf_callback) (gpointer ctx, NvDsAppPerfStruct * str);
typedef struct
{
guint buffer_cnt;
guint total_buffer_cnt;
struct timeval total_fps_time;
struct timeval start_fps_time;
struct timeval last_fps_time;
struct timeval last_sample_fps_time;
} NvDsInstancePerfStruct;
typedef struct
{
gulong measurement_interval_ms;
gulong perf_measurement_timeout_id;
guint num_instances;
gboolean stop;
gpointer context;
GMutex struct_lock;
perf_callback callback;
GstPad *sink_bin_pad;
gulong fps_measure_probe_id;
NvDsInstancePerfStruct instance_str[MAX_SOURCE_BINS];
guint dewarper_surfaces_per_frame;
GHashTable *FPSInfoHash;
gboolean stream_name_display;
gboolean use_nvmultiurisrcbin;
} NvDsAppPerfStructInt;
gboolean enable_perf_measurement (NvDsAppPerfStructInt *str,
GstPad *sink_bin_pad, guint num_sources, gulong interval_sec,
guint num_surfaces_per_frame, perf_callback callback);
void pause_perf_measurement (NvDsAppPerfStructInt *str);
void resume_perf_measurement (NvDsAppPerfStructInt *str);
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_PREPROCESS_H__
#define __NVGSTDS_PREPROCESS_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
/** create a bin for the element only if enabled */
gboolean enable;
/*gie id on which preprocessing is to be done*/
gint operate_on_gie_id;
gboolean is_operate_on_gie_id_set;
/** config file path having properties for preprocess */
gchar *config_file_path;
} NvDsPreProcessConfig;
typedef struct
{
GstElement *bin;
GstElement *queue;
GstElement *preprocess;
} NvDsPreProcessBin;
/**
* Initialize @ref NvDsPreProcessBin. It creates and adds preprocess and
* other elements needed for processing to the bin.
* It also sets properties mentioned in the configuration file under
* group @ref CONFIG_GROUP_PREPROCESS
*
* @param[in] config pointer to infer @ref NvDsPreProcessConfig parsed from
* configuration file.
* @param[in] bin pointer to @ref NvDsPreProcessBin to be filled.
*
* @return true if bin created successfully.
*/
gboolean create_preprocess_bin (NvDsPreProcessConfig *config,
NvDsPreProcessBin *bin);
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2019 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_PRIMARY_GIE_H__
#define __NVGSTDS_PRIMARY_GIE_H__
#ifdef __cplusplus
extern "C"
{
#endif
#include "deepstream_gie.h"
typedef struct
{
GstElement *bin;
GstElement *queue;
GstElement *nvvidconv;
GstElement *primary_gie;
} NvDsPrimaryGieBin;
/**
* Initialize @ref NvDsPrimaryGieBin. It creates and adds primary infer and
* other elements needed for processing to the bin.
* It also sets properties mentioned in the configuration file under
* group @ref CONFIG_GROUP_PRIMARY_GIE
*
* @param[in] config pointer to infer @ref NvDsGieConfig parsed from
* configuration file.
* @param[in] bin pointer to @ref NvDsPrimaryGieBin to be filled.
*
* @return true if bin created successfully.
*/
gboolean create_primary_gie_bin (NvDsGieConfig *config,
NvDsPrimaryGieBin *bin);
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2019 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_SECONDARY_GIE_H__
#define __NVGSTDS_SECONDARY_GIE_H__
#include "deepstream_gie.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
GstElement *queue;
GstElement *secondary_gie;
GstElement *tee;
GstElement *sink;
gboolean create;
guint num_children;
gint parent_index;
} NvDsSecondaryGieBinSubBin;
typedef struct
{
GstElement *bin;
GstElement *tee;
GstElement *queue;
gulong wait_for_sgie_process_buf_probe_id;
gboolean stop;
gboolean flush;
NvDsSecondaryGieBinSubBin sub_bins[MAX_SECONDARY_GIE_BINS];
GMutex wait_lock;
GCond wait_cond;
} NvDsSecondaryGieBin;
/**
* Initialize @ref NvDsSecondaryGieBin. It creates and adds secondary infer and
* other elements needed for processing to the bin.
* It also sets properties mentioned in the configuration file under
* group @ref CONFIG_GROUP_SECONDARY_GIE
*
* @param[in] num_secondary_gie number of secondary infers.
* @param[in] primary_gie_unique_id Unique id of primary infer to work on.
* @param[in] config_array array of pointers of type @ref NvDsGieConfig
* parsed from configuration file.
* @param[in] bin pointer to @ref NvDsSecondaryGieBin to be filled.
*
* @return true if bin created successfully.
*/
gboolean create_secondary_gie_bin (guint num_secondary_gie,
guint primary_gie_unique_id, NvDsGieConfig *config_array,
NvDsSecondaryGieBin *bin);
/**
* Release the resources.
*/
void destroy_secondary_gie_bin (NvDsSecondaryGieBin *bin);
#ifdef __cplusplus
}
#endif
#endif
/*
* SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_SECONDARY_PREPROCESS_H__
#define __NVGSTDS_SECONDARY_PREPROCESS_H__
#include <gst/gst.h>
#include "deepstream_preprocess.h"
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
GstElement *queue;
GstElement *secondary_preprocess;
GstElement *tee;
GstElement *sink;
gboolean create;
guint num_children;
gint parent_index;
} NvDsSecondaryPreProcessBinSubBin;
typedef struct
{
GstElement *bin;
GstElement *tee;
GstElement *queue;
gulong wait_for_secondary_preprocess_process_buf_probe_id;
gboolean stop;
gboolean flush;
NvDsSecondaryPreProcessBinSubBin sub_bins[MAX_SECONDARY_GIE_BINS];
GMutex wait_lock;
GCond wait_cond;
} NvDsSecondaryPreProcessBin;
/**
* Initialize @ref NvDsSecondaryPreProcessBin. It creates and adds secondary preprocess and
* other elements needed for processing to the bin.
* It also sets properties mentioned in the configuration file under
* group @ref CONFIG_GROUP_SECONDARY_PREPROCESS
*
* @param[in] num_secondary_gie number of secondary preprocess.
* @param[in] config_array array of pointers of type @ref NvDsPreProcessConfig
* parsed from configuration file.
* @param[in] bin pointer to @ref NvDsSecondaryPreProcessBin to be filled.
*
* @return true if bin created successfully.
*/
gboolean create_secondary_preprocess_bin (guint num_secondary_preprocess,
guint primary_gie_unique_id,
NvDsPreProcessConfig *config_array,
NvDsSecondaryPreProcessBin *bin);
/**
* Release the resources.
*/
void destroy_secondary_preprocess_bin (NvDsSecondaryPreProcessBin *bin);
#ifdef __cplusplus
}
#endif
#endif
\ No newline at end of file
/*
* SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
* property and proprietary rights in and to this material, related
* documentation and any modifications thereto. Any use, reproduction,
* disclosure or distribution of this material and related documentation
* without an express license agreement from NVIDIA CORPORATION or
* its affiliates is strictly prohibited.
*/
#ifndef __NVGSTDS_SEGVISUAL_H__
#define __NVGSTDS_SEGVISUAL_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
GstElement *bin;
GstElement *queue;
GstElement *nvvidconv;
GstElement *conv_queue;
GstElement *cap_filter;
GstElement *nvsegvisual;
} NvDsSegVisualBin;
typedef struct
{
gboolean enable;
guint gpu_id;
guint max_batch_size;
guint width;
guint height;
guint nvbuf_memory_type; /* For nvvidconv */
} NvDsSegVisualConfig;
/**
* Initialize @ref NvDsSegVisualBin. It creates and adds SegVisual and other elements
* needed for processing to the bin. It also sets properties mentioned
* in the configuration file under group @ref CONFIG_GROUP_SegVisual
*
* @param[in] config pointer to SegVisual @ref NvDsSegVisualConfig parsed from config file.
* @param[in] bin pointer to @ref NvDsSegVisualBin to be filled.
*
* @return true if bin created successfully.
*/
gboolean create_segvisual_bin (NvDsSegVisualConfig *config, NvDsSegVisualBin *bin);
#ifdef __cplusplus
}
#endif
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment