NVIDIA DeepStream SDK API Reference

6.2 Release
gst-nvcommon.h
Go to the documentation of this file.
1 
21 #ifndef __GST_NVCOMMON_H__
22 #define __GST_NVCOMMON_H__
23 
24 #include <gst/gst.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #ifndef __aarch64__
31 #define CHECK_DEFAULT_MEM(memType1, memType2) ((memType1 == NVBUF_MEM_DEFAULT && memType2 == NVBUF_MEM_CUDA_DEVICE) || \
32  (memType1 == NVBUF_MEM_CUDA_DEVICE && memType2 == NVBUF_MEM_DEFAULT))
33 #else
34 #define CHECK_DEFAULT_MEM(memType1, memType2) ((memType1 == NVBUF_MEM_DEFAULT && memType2 == NVBUF_MEM_SURFACE_ARRAY) || \
35  (memType1 == NVBUF_MEM_SURFACE_ARRAY && memType2 == NVBUF_MEM_DEFAULT))
36 #endif
37 
38 #define CHECK_NVDS_MEMORY_AND_GPUID(object, surface) \
39  ({ int _errtype=0;\
40  do { \
41  if (((surface->memType == NVBUF_MEM_DEFAULT || surface->memType == NVBUF_MEM_CUDA_DEVICE) && \
42  ((int)surface->gpuId != (int)object->gpu_id)) || \
43  (((int)surface->gpuId == (int)object->gpu_id) && (surface->memType == NVBUF_MEM_SYSTEM))) { \
44  GST_ELEMENT_ERROR (object, RESOURCE, FAILED, \
45  ("Memory Compatibility Error:Input surface gpu-id doesnt match with configured gpu-id for element," \
46  " please allocate input using unified memory, or use same gpu-ids OR,"\
47  " if same gpu-ids are used ensure appropriate Cuda memories are used"),\
48  ("surface-gpu-id=%d,%s-gpu-id=%d",surface->gpuId,GST_ELEMENT_NAME(object),\
49  object->gpu_id)); \
50  _errtype = 1;\
51  } \
52  } while(0); \
53  _errtype; \
54  })
55 
56 
57 #define GST_TYPE_NVBUF_MEMORY_TYPE (gst_nvbuf_memory_get_type ())
58 GType gst_nvbuf_memory_get_type (void);
59 
60 #define GST_TYPE_COMPUTE_HW (gst_compute_hw_get_type ())
61 GType gst_compute_hw_get_type (void);
62 
63 #define GST_TYPE_INTERPOLATION_METHOD (gst_video_interpolation_method_get_type ())
65 
66 
67 #define PROP_NVDS_GPU_ID_INSTALL(gobject_class) \
68 do { \
69 g_object_class_install_property (gobject_class, PROP_GPU_DEVICE_ID, \
70  g_param_spec_uint ("gpu-id", "Set GPU Device ID for operation", \
71  "Set GPU Device ID for operation", \
72  0, G_MAXUINT, 0, \
73  (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
74  GST_PARAM_MUTABLE_READY))); \
75 }while(0)
76 
77 #define PROP_NVBUF_MEMORY_TYPE_INSTALL(gobject_class) \
78 do { \
79  g_object_class_install_property (gobject_class, PROP_NVBUF_MEMORY_TYPE, \
80  g_param_spec_enum ("nvbuf-memory-type", "Type of NvBufSurface memory allocated", \
81  "Type of NvBufSurface Memory to be allocated for output buffers", \
82  GST_TYPE_NVBUF_MEMORY_TYPE, \
83  NVBUF_MEM_DEFAULT, \
84  (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
85  GST_PARAM_MUTABLE_READY))); \
86 }while(0)
87 
88 #define PROP_COMPUTE_HW_INSTALL(gobject_class) \
89 do { \
90  g_object_class_install_property (gobject_class, PROP_COMPUTE_HW, \
91  g_param_spec_enum ("compute-hw", "compute-hw", \
92  "Compute Scaling HW", \
93  GST_TYPE_COMPUTE_HW, NvBufSurfTransformCompute_Default, \
94  (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
95  GST_PARAM_CONTROLLABLE | G_PARAM_CONSTRUCT))); \
96 }while(0)
97 
98 #define PROP_INTERPOLATION_METHOD_INSTALL(gobject_class) \
99 do { \
100  g_object_class_install_property (gobject_class, PROP_INTERPOLATION_METHOD, \
101  g_param_spec_enum ("interpolation-method", "Interpolation-method", \
102  "Set interpolation methods", \
103  GST_TYPE_INTERPOLATION_METHOD, NvBufSurfTransformInter_Default, \
104  (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
105  GST_PARAM_CONTROLLABLE | G_PARAM_CONSTRUCT))); \
106 }while(0)
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif
gst_compute_hw_get_type
GType gst_compute_hw_get_type(void)
gst_nvbuf_memory_get_type
GType gst_nvbuf_memory_get_type(void)
gst_video_interpolation_method_get_type
GType gst_video_interpolation_method_get_type(void)