|
NVIDIA DeepStream SDK API Reference
|
6.4 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 current_device = -1; cudaGetDevice(¤t_device); \
42 struct cudaDeviceProp prop; cudaGetDeviceProperties(&prop, current_device); \
43 if(prop.integrated) mem_type=NVBUF_MEM_SURFACE_ARRAY;\
44 else mem_type=NVBUF_MEM_CUDA_DEVICE;}
48 #define CHECK_NVDS_MEMORY_AND_GPUID(object, surface) \
51 if (((surface->memType == NVBUF_MEM_DEFAULT || surface->memType == NVBUF_MEM_CUDA_DEVICE) && \
52 ((int)surface->gpuId != (int)object->gpu_id)) || \
53 (((int)surface->gpuId == (int)object->gpu_id) && (surface->memType == NVBUF_MEM_SYSTEM))) { \
54 GST_ELEMENT_ERROR (object, RESOURCE, FAILED, \
55 ("Memory Compatibility Error:Input surface gpu-id doesnt match with configured gpu-id for element," \
56 " please allocate input using unified memory, or use same gpu-ids OR,"\
57 " if same gpu-ids are used ensure appropriate Cuda memories are used"),\
58 ("surface-gpu-id=%d,%s-gpu-id=%d",surface->gpuId,GST_ELEMENT_NAME(object),\
67 #define GST_TYPE_NVBUF_MEMORY_TYPE (gst_nvbuf_memory_get_type ())
70 #define GST_TYPE_COMPUTE_HW (gst_compute_hw_get_type ())
73 #define GST_TYPE_INTERPOLATION_METHOD (gst_video_interpolation_method_get_type ())
79 #define PROP_NVDS_GPU_ID_INSTALL(gobject_class) \
81 g_object_class_install_property (gobject_class, PROP_GPU_DEVICE_ID, \
82 g_param_spec_uint ("gpu-id", "Set GPU Device ID for operation", \
83 "Set GPU Device ID for operation", \
85 (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
86 GST_PARAM_MUTABLE_READY))); \
89 #define PROP_NVBUF_MEMORY_TYPE_INSTALL(gobject_class) \
91 g_object_class_install_property (gobject_class, PROP_NVBUF_MEMORY_TYPE, \
92 g_param_spec_enum ("nvbuf-memory-type", "Type of NvBufSurface memory allocated", \
93 "Type of NvBufSurface Memory to be allocated for output buffers", \
94 GST_TYPE_NVBUF_MEMORY_TYPE, \
96 (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
97 GST_PARAM_MUTABLE_READY))); \
100 #define PROP_COMPUTE_HW_INSTALL(gobject_class) \
102 g_object_class_install_property (gobject_class, PROP_COMPUTE_HW, \
103 g_param_spec_enum ("compute-hw", "compute-hw", \
104 "Compute Scaling HW", \
105 GST_TYPE_COMPUTE_HW, NvBufSurfTransformCompute_Default, \
106 (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
107 GST_PARAM_CONTROLLABLE | G_PARAM_CONSTRUCT))); \
110 #define PROP_INTERPOLATION_METHOD_INSTALL(gobject_class) \
112 g_object_class_install_property (gobject_class, PROP_INTERPOLATION_METHOD, \
113 g_param_spec_enum ("interpolation-method", "Interpolation-method", \
114 "Set interpolation methods", \
115 GST_TYPE_INTERPOLATION_METHOD, NvBufSurfTransformInter_Default, \
116 (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
117 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)