|
|
NVIDIA DeepStream SDK API Reference
|
9.1 Release
|
Go to the documentation of this file.
18 #ifndef __GST_NVDSPREPROCESS_H__
19 #define __GST_NVDSPREPROCESS_H__
21 #include <gst/base/gstbasetransform.h>
22 #include <gst/video/video.h>
25 #include <cuda_runtime.h>
26 #include "nvbufsurface.h"
27 #include "nvbufsurftransform.h"
28 #include "gst-nvquery.h"
31 #include "nvdspreprocess_interface.h"
32 #include "nvdspreprocess_meta.h"
34 #include "nvtx3/nvToolsExt.h"
36 #include <condition_variable>
39 #include <unordered_map>
43 #define PACKAGE "nvdsvideotemplate"
45 #define LICENSE "Proprietary"
46 #define DESCRIPTION "NVIDIA custom preprocessing plugin for integration with DeepStream on DGPU/Jetson"
47 #define BINARY_PACKAGE "NVIDIA DeepStream Preprocessing using custom algorithms for different streams"
48 #define URL "http://nvidia.com/"
56 #define GST_TYPE_NVDSPREPROCESS (gst_nvdspreprocess_get_type())
57 #define GST_NVDSPREPROCESS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVDSPREPROCESS,GstNvDsPreProcess))
58 #define GST_NVDSPREPROCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVDSPREPROCESS,GstNvDsPreProcessClass))
59 #define GST_NVDSPREPROCESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_NVDSPREPROCESS, GstNvDsPreProcessClass))
60 #define GST_IS_NVDSPREPROCESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVDSPREPROCESS))
61 #define GST_IS_NVDSPREPROCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVDSPREPROCESS))
62 #define GST_NVDSPREPROCESS_CAST(obj) ((GstNvDsPreProcess *)(obj))
68 std::vector<NvDsRoiMeta> roi_vector;
74 std::vector<gint> src_ids;
77 std::vector<gint> operate_on_class_ids;
83 std::string custom_transform_function_name;
93 std::unordered_map<gint, GstNvDsPreProcessFrame> framemeta_map;
96 gboolean process_on_roi = 0;
99 gboolean process_on_all_objects = 0;
102 gboolean draw_roi = 0;
108 guint min_input_object_width;
109 guint min_input_object_height;
110 guint max_input_object_width;
111 guint max_input_object_height;
114 guint replicated_src_id;
118 guint interval_counter = 0;
145 GstBufferPool *m_gstpool =
nullptr;
153 gboolean processing_width;
155 gboolean processing_height;
157 gboolean network_input_order;
159 gboolean network_input_shape;
161 gboolean network_color_format;
163 gboolean tensor_data_type;
165 gboolean tensor_name;
167 gboolean custom_lib_path;
169 gboolean custom_tensor_function_name;
173 gboolean operate_on_class_ids;
175 gboolean process_on_roi;
177 gboolean process_on_all_objects;
179 gboolean roi_params_src;
181 gboolean scaling_pool_interpolation_filter;
183 gboolean scaling_pool_memory_type;
189 gboolean min_input_object_width;
191 gboolean min_input_object_height;
193 gboolean max_input_object_width;
195 gboolean max_input_object_height;
268 std::unique_ptr <NvDsPreProcessAcquirerImpl>
acquire_impl;
std::vector< guint64 > target_unique_ids
Target unique ids.
For Acquiring/releasing buffer from buffer pool.
guint64 frame_num
Frame number of the current input buffer.
Custom Initialization parameter for custom library.
NvBufSurfTransformConfigParams transform_config_params
Config params required by NvBufSurfTransform API.
gboolean process_on_frame
Boolean indicating if processing on frame or already cropped objects should be processed.
std::vector< GstNvDsPreProcessGroup * > nvdspreprocess_groups
group information as specified in config file
NvDsPreProcessCustomBuf * acquire() override
override acquire method in plugin
gboolean stop
Boolean to signal output thread to stop.
struct NvBufSurfTransformSyncObj * NvBufSurfTransformSyncObj_t
Holds the information about synchronization objects for asynchronous transform/composite APIs.
guint unique_id
Unique ID of the element.
GstBaseTransform base_trans
Gst Base Transform.
gchar * config_file_path
Config file path for nvdspreprocess.
gboolean symmetric_padding
Boolean to indicate symmetric padding.
gint operate_on_gie_id
Gie id to process.
GstNvDsPreProcessMemory * memory
Memory corresponding to the gst buffer.
Holds information about batched buffers.
Holds information about the batch of frames to be inferred.
std::string custom_tensor_function_name
custom tensor function name
GCond preprocess_cond
Gcondition for process queue.
gboolean maintain_aspect_ratio
Boolean to indicate maintain aspect ratio.
NvBufSurface batch_insurf
Temporary NvBufSurface for input to batched transformations.
NvDsPreProcessTensorParams tensor_params
Parameters for tensor preparation.
GstBuffer * gstbuf
Gst Buffer acquired from gst allocator.
NvBufSurface batch_outsurf
Temporary NvBufSurface for output from batched transformations.
guint gpu_id
GPU ID on which we expect to execute the task.
std::function< NvDsPreProcessStatus(CustomCtx *, NvDsPreProcessBatch *, NvDsPreProcessCustomBuf *&, CustomTensorParams &, NvDsPreProcessAcquirer *)> custom_tensor_function
wrapper to custom tensor function
GType gst_nvdspreprocess_get_type(void)
GstBufferPool * scaling_pool
Internal buffer pool for memory required for scaling input frames and cropping object.
guint meta_id
meta id for differentiating between multiple tensor meta from same gst buffer
NvDsPreProcessStatus
Enum for the status codes returned by NvDsPreProcessImpl.
NvBufSurfTransform_Compute
Specifies compute devices used by NvBufSurfTransform.
NvBufSurfTransform_Inter scaling_pool_interpolation_filter
interpolation filter for transformation
GQueue * preprocess_queue
Queue to send data to output thread for processing.
gulong current_batch_num
Current batch number of the input batch.
gchar * custom_lib_path
Custom Library Name.
NvDsPreProcessCustomBuf * tensor_buf
pointer to buffer provided to custom library for tensor preparation
gboolean enable
if disabled plugin will work in passthrough mode
GMutex framemeta_map_lock
Lock for framemeta_map.
std::unordered_map< gint, gint > * src_to_group_map
Map src-id : preprocess-group-id.
gint processing_width
Resolution width at which roi/full-frames should be processed.
GThread * output_thread
Output thread.
guint tensor_buf_pool_size
tensor buffer pool size
nvtxDomainHandle_t nvtx_domain
NVTX Domain.
NvDsPreProcessPropertySet property_set
struct denoting properties set by config file
struct denoting properties set by config file
Tensor params passed to custom library for tensor preparation.
NvBufSurfaceMemType scaling_pool_memory_type
scaling pool memory type
GMutex preprocess_lock
Processing Queue and related synchronization structures.
Custom Buffer passed to the custom lib for preparing tensor.
class for acquiring and releasing a buffer from tensor pool by custom lib.
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Strucuture containing Preprocess info.
CustomInitParams custom_initparams
custom lib init params
CustomCtx * custom_lib_ctx
pointer to the custom lib ctx
gboolean release(NvDsPreProcessCustomBuf *) override
override release method in plugin
GstBufferPool * tensor_pool
Internal buffer pool for memory required for tensor preparation.
Holds model parameters for tensor preparation.
NvDsPreProcessFormat scaling_pool_format
scaling pool color format
gint processing_height
Resolution height at which roi/full-frames should be processed.
Used by plugin to access GstBuffer and GstNvDsPreProcessMemory acquired by Custom Library.
GstBaseTransformClass parent_class
gst base transform class
NvDsPreProcessAcquirerImpl(GstBufferPool *pool)
constructor
guint max_batch_size
Maximum batch size.
Holds the color parameters of the box or text to be overlayed.
typedefG_BEGIN_DECLS struct _GstNvDsPreProcess GstNvDsPreProcess
NvBufSurfTransform_Inter
Specifies video interpolation methods.
NvBufSurfTransform_Compute scaling_pool_compute_hw
compute hw for transformation
void * custom_lib_handle
custom lib handle
GstFlowReturn last_flow_ret
GstFlowReturn returned by the latest buffer pad push.
struct CustomCtx CustomCtx
Context for custom library.
gboolean config_file_parse_successful
Config file parsing status.
This file describes the custom memory allocator for the Gstreamer TensorRT plugin.
guint scaling_buf_pool_size
Scaling buffer pool size.
cudaStream_t convert_stream
Cuda Stream to ROI crop, scale and convert.
NvDsPreProcessFormat
Defines model color formats.
NvBufSurfTransformParams transform_params
Parameters to use for transforming buffers.
struct _GstBuffer GstBuffer
std::unique_ptr< NvDsPreProcessAcquirerImpl > acquire_impl
Class for acquiring/releasing buffer from tensor pool.