|
NVIDIA DeepStream SDK API Reference
|
6.4 Release
|
Go to the documentation of this file.
23 #ifndef __GST_DSEXAMPLE_H__
24 #define __GST_DSEXAMPLE_H__
26 #include <gst/base/gstbasetransform.h>
27 #include <gst/video/video.h>
31 #include "opencv2/imgproc/imgproc.hpp"
32 #include "opencv2/highgui/highgui.hpp"
36 #include <cuda_runtime.h>
42 #include "nvtx3/nvToolsExt.h"
44 #include <condition_variable>
50 #define PACKAGE "dsexample"
52 #define LICENSE "Proprietary"
53 #define DESCRIPTION "NVIDIA example plugin for integration with DeepStream on DGPU/Jetson"
54 #define BINARY_PACKAGE "NVIDIA DeepStream 3rdparty IP integration example plugin"
55 #define URL "http://nvidia.com/"
64 #define GST_TYPE_DSEXAMPLE (gst_dsexample_get_type())
65 #define GST_DSEXAMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DSEXAMPLE,GstDsExample))
66 #define GST_DSEXAMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DSEXAMPLE,GstDsExampleClass))
67 #define GST_DSEXAMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_DSEXAMPLE, GstDsExampleClass))
68 #define GST_IS_DSEXAMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DSEXAMPLE))
69 #define GST_IS_DSEXAMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DSEXAMPLE))
70 #define GST_DSEXAMPLE_CAST(obj) ((GstDsExample *)(obj))
73 #define NVDSEXAMPLE_MAX_BATCH_SIZE G_MAXUINT
158 gdouble scale_ratio_x = 0.0;
162 gdouble scale_ratio_y = 0.0;
168 guint batch_index = 0;
170 gulong frame_num = 0;
181 std::vector < GstDsExampleFrame >
frames;
185 gulong inbuf_batch_num = 0;
190 gboolean push_buffer = FALSE;
194 gboolean event_marker = FALSE;
203 nvtxRangeId_t nvtx_complete_buf_range = 0;
NvBufSurfTransformParams transform_params
Parameters to use for transforming buffers.
Holds information about the batch of frames to be inferred.
struct DsExampleCtx DsExampleCtx
GMutex process_lock
Processing Queue and related synchronization structures.
gboolean process_full_frame
Boolean indicating if entire frame or cropped objects should be processed.
Holds information about batched buffers.
gint processing_width
Resolution at which frames/objects should be processed.
GstVideoInfo video_info
Input video info (resolution, color format, framerate, etc)
typedefG_BEGIN_DECLS struct _GstDsExample GstDsExample
gulong current_batch_num
Current batch number of the input batch.
guint gpu_id
GPU ID on which we expect to execute the task.
GCond buf_cond
Gcondition for buf queue.
GQueue * buf_queue
Queue to receive processed data from output thread.
cudaStream_t cuda_stream
CUDA Stream used for allocating the CUDA task.
guint max_batch_size
Maximum batch size.
GCond process_cond
Gcondition for process queue.
Hold the information of single buffer in the batch.
nvtxDomainHandle_t nvtx_domain
NVTX Domain.
GstBaseTransformClass parent_class
guint64 frame_num
Frame number of the current input buffer.
NvBufSurfTransformConfigParams transform_config_params
Config params required by NvBufSurfTransform API.
GThread * process_thread
Output thread.
guint unique_id
Unique ID of the element.
gboolean stop
Boolean to signal output thread to stop.
GType gst_dsexample_get_type(void)
GQueue * process_queue
Queue to send data to output thread for processing.
std::vector< GstDsExampleFrame > frames
Vector of frames in the batch.
NvBufSurface * inter_buf
the intermediate scratch buffer for conversions RGBA
struct _GstBuffer GstBuffer
GstBaseTransform base_trans
DsExampleCtx * dsexamplelib_ctx
Context of the custom algorithm library.
GstFlowReturn last_flow_ret
GstFlowReturn returned by the latest buffer pad push.
NvBufSurface batch_insurf
Temporary NvBufSurface for batched transformations.