|
|
NVIDIA DeepStream SDK API Reference
|
8.0 Release
|
Go to the documentation of this file.
13 #ifndef __GST_NVDSPREPROCESS_H__
14 #define __GST_NVDSPREPROCESS_H__
16 #include <gst/base/gstbasetransform.h>
17 #include <gst/video/video.h>
20 #include <cuda_runtime.h>
21 #include "nvbufsurface.h"
22 #include "nvbufsurftransform.h"
23 #include "gst-nvquery.h"
26 #include "nvdspreprocess_interface.h"
27 #include "nvdspreprocess_meta.h"
29 #include "nvtx3/nvToolsExt.h"
31 #include <condition_variable>
34 #include <unordered_map>
38 #define PACKAGE "nvdsvideotemplate"
40 #define LICENSE "Proprietary"
41 #define DESCRIPTION "NVIDIA custom preprocessing plugin for integration with DeepStream on DGPU/Jetson"
42 #define BINARY_PACKAGE "NVIDIA DeepStream Preprocessing using custom algorithms for different streams"
43 #define URL "http://nvidia.com/"
51 #define GST_TYPE_NVDSPREPROCESS (gst_nvdspreprocess_get_type())
52 #define GST_NVDSPREPROCESS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVDSPREPROCESS,GstNvDsPreProcess))
53 #define GST_NVDSPREPROCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVDSPREPROCESS,GstNvDsPreProcessClass))
54 #define GST_NVDSPREPROCESS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_NVDSPREPROCESS, GstNvDsPreProcessClass))
55 #define GST_IS_NVDSPREPROCESS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVDSPREPROCESS))
56 #define GST_IS_NVDSPREPROCESS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVDSPREPROCESS))
57 #define GST_NVDSPREPROCESS_CAST(obj) ((GstNvDsPreProcess *)(obj))
63 std::vector<NvDsRoiMeta> roi_vector;
69 std::vector<gint> src_ids;
72 std::vector<gint> operate_on_class_ids;
78 std::string custom_transform_function_name;
88 std::unordered_map<gint, GstNvDsPreProcessFrame> framemeta_map;
91 gboolean process_on_roi = 0;
94 gboolean process_on_all_objects = 0;
97 gboolean draw_roi = 0;
103 guint min_input_object_width;
104 guint min_input_object_height;
105 guint max_input_object_width;
106 guint max_input_object_height;
109 guint replicated_src_id;
113 guint interval_counter = 0;
140 GstBufferPool *m_gstpool =
nullptr;
148 gboolean processing_width;
150 gboolean processing_height;
152 gboolean network_input_order;
154 gboolean network_input_shape;
156 gboolean network_color_format;
158 gboolean tensor_data_type;
160 gboolean tensor_name;
162 gboolean custom_lib_path;
164 gboolean custom_tensor_function_name;
168 gboolean operate_on_class_ids;
170 gboolean process_on_roi;
172 gboolean process_on_all_objects;
174 gboolean roi_params_src;
176 gboolean scaling_pool_interpolation_filter;
178 gboolean scaling_pool_memory_type;
184 gboolean min_input_object_width;
186 gboolean min_input_object_height;
188 gboolean max_input_object_width;
190 gboolean max_input_object_height;
263 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.