|
NVIDIA DeepStream SDK API Reference
|
8.0 Release
|
Go to the documentation of this file.
21 #ifndef __GST_NVCOMMON_H__
22 #define __GST_NVCOMMON_H__
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))
34 #define GET_DEFAULT_MEM_TYPE(mem_type) {mem_type=NVBUF_MEM_CUDA_DEVICE;}
38 #define CHECK_DEFAULT_MEM(memType1, memType2) ((memType1 == NVBUF_MEM_DEFAULT && memType2 == NVBUF_MEM_SURFACE_ARRAY) || \
39 (memType1 == NVBUF_MEM_SURFACE_ARRAY && memType2 == NVBUF_MEM_DEFAULT))
41 #define GET_DEFAULT_MEM_TYPE(mem_type) {int is_nvgpu = 0; NvBufSurfaceDeviceInfo dev_info; \
42 if (NvBufSurfaceGetDeviceInfo(&dev_info) == 0) { \
43 if (dev_info.driverType == NVBUF_DRIVER_TYPE_NVGPU) { \
47 if(is_nvgpu) mem_type=NVBUF_MEM_SURFACE_ARRAY;\
48 else mem_type=NVBUF_MEM_CUDA_DEVICE;}
51 #define CHECK_NVDS_MEMORY_AND_GPUID(object, surface) \
54 if (((surface->memType == NVBUF_MEM_DEFAULT || surface->memType == NVBUF_MEM_CUDA_DEVICE) && \
55 ((int)surface->gpuId != (int)object->gpu_id)) || \
56 (((int)surface->gpuId == (int)object->gpu_id) && (surface->memType == NVBUF_MEM_SYSTEM))) { \
57 GST_ELEMENT_ERROR (object, RESOURCE, FAILED, \
58 ("Memory Compatibility Error:Input surface gpu-id doesnt match with configured gpu-id for element," \
59 " please allocate input using unified memory, or use same gpu-ids OR,"\
60 " if same gpu-ids are used ensure appropriate Cuda memories are used"),\
61 ("surface-gpu-id=%d,%s-gpu-id=%d",surface->gpuId,GST_ELEMENT_NAME(object),\
70 #define GST_TYPE_NVBUF_MEMORY_TYPE (gst_nvbuf_memory_get_type ())
73 #define GST_TYPE_COMPUTE_HW (gst_compute_hw_get_type ())
76 #define GST_TYPE_INTERPOLATION_METHOD (gst_video_interpolation_method_get_type ())
82 #define PROP_NVDS_GPU_ID_INSTALL(gobject_class) \
84 g_object_class_install_property (gobject_class, PROP_GPU_DEVICE_ID, \
85 g_param_spec_uint ("gpu-id", "Set GPU Device ID for operation", \
86 "Set GPU Device ID for operation", \
88 (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
89 GST_PARAM_MUTABLE_READY))); \
92 #define PROP_NVBUF_MEMORY_TYPE_INSTALL(gobject_class) \
94 g_object_class_install_property (gobject_class, PROP_NVBUF_MEMORY_TYPE, \
95 g_param_spec_enum ("nvbuf-memory-type", "Type of NvBufSurface memory allocated", \
96 "Type of NvBufSurface Memory to be allocated for output buffers", \
97 GST_TYPE_NVBUF_MEMORY_TYPE, \
99 (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
100 GST_PARAM_MUTABLE_READY))); \
103 #define PROP_COMPUTE_HW_INSTALL(gobject_class) \
105 g_object_class_install_property (gobject_class, PROP_COMPUTE_HW, \
106 g_param_spec_enum ("compute-hw", "compute-hw", \
107 "Compute Scaling HW", \
108 GST_TYPE_COMPUTE_HW, NvBufSurfTransformCompute_Default, \
109 (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
110 GST_PARAM_CONTROLLABLE | G_PARAM_CONSTRUCT))); \
113 #define PROP_INTERPOLATION_METHOD_INSTALL(gobject_class) \
115 g_object_class_install_property (gobject_class, PROP_INTERPOLATION_METHOD, \
116 g_param_spec_enum ("interpolation-method", "Interpolation-method", \
117 "Set interpolation methods", \
118 GST_TYPE_INTERPOLATION_METHOD, NvBufSurfTransformInter_Default, \
119 (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
120 GST_PARAM_CONTROLLABLE | G_PARAM_CONSTRUCT))); \
int gst_nvbuf_memory_get_value(const char *mem_type_string)
GType gst_compute_hw_get_type(void)
const char * gst_nvbuf_memory_get_name(int mem_type)
GType gst_nvbuf_memory_get_type(void)
GType gst_video_interpolation_method_get_type(void)