|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
26 #ifndef __GST_NVCOMMON_H__
27 #define __GST_NVCOMMON_H__
36 #define CHECK_DEFAULT_MEM(memType1, memType2) ((memType1 == NVBUF_MEM_DEFAULT && memType2 == NVBUF_MEM_CUDA_DEVICE) || \
37 (memType1 == NVBUF_MEM_CUDA_DEVICE && memType2 == NVBUF_MEM_DEFAULT))
39 #define GET_DEFAULT_MEM_TYPE(mem_type) {mem_type=NVBUF_MEM_CUDA_DEVICE;}
43 #define CHECK_DEFAULT_MEM(memType1, memType2) ((memType1 == NVBUF_MEM_DEFAULT && memType2 == NVBUF_MEM_SURFACE_ARRAY) || \
44 (memType1 == NVBUF_MEM_SURFACE_ARRAY && memType2 == NVBUF_MEM_DEFAULT))
47 #define GET_DEFAULT_MEM_TYPE(mem_type) {int is_nvgpu = 0; NvBufSurfaceDeviceInfo dev_info{}; \
48 if (NvBufSurfaceGetDeviceInfo(&dev_info) == 0) { \
49 if (dev_info.driverType == NVBUF_DRIVER_TYPE_NVGPU) { \
53 if(is_nvgpu) mem_type=NVBUF_MEM_SURFACE_ARRAY;\
54 else mem_type=NVBUF_MEM_CUDA_DEVICE;}
56 #define GET_DEFAULT_MEM_TYPE(mem_type) {int is_nvgpu = 0; NvBufSurfaceDeviceInfo dev_info = {0}; \
57 if (NvBufSurfaceGetDeviceInfo(&dev_info) == 0) { \
58 if (dev_info.driverType == NVBUF_DRIVER_TYPE_NVGPU) { \
62 if(is_nvgpu) mem_type=NVBUF_MEM_SURFACE_ARRAY;\
63 else mem_type=NVBUF_MEM_CUDA_DEVICE;}
69 #include "nvbufsurface.h"
72 #define CHECK_NVDS_MEMORY_AND_GPUID(object, surface) \
75 if (((surface->memType == NVBUF_MEM_DEFAULT || surface->memType == NVBUF_MEM_CUDA_DEVICE) && \
76 ((int)surface->gpuId != (int)object->gpu_id)) || \
77 (((int)surface->gpuId == (int)object->gpu_id) && (surface->memType == NVBUF_MEM_SYSTEM))) { \
78 GST_ELEMENT_ERROR (object, RESOURCE, FAILED, \
79 ("Memory Compatibility Error:Input surface gpu-id doesnt match with configured gpu-id for element," \
80 " please allocate input using unified memory, or use same gpu-ids OR,"\
81 " if same gpu-ids are used ensure appropriate Cuda memories are used"),\
82 ("surface-gpu-id=%d,%s-gpu-id=%d",surface->gpuId,GST_ELEMENT_NAME(object),\
91 #define GST_TYPE_NVBUF_MEMORY_TYPE (gst_nvbuf_memory_get_type ())
94 #define GST_TYPE_COMPUTE_HW (gst_compute_hw_get_type ())
97 #define GST_TYPE_INTERPOLATION_METHOD (gst_video_interpolation_method_get_type ())
103 #define PROP_NVDS_GPU_ID_INSTALL(gobject_class) \
105 g_object_class_install_property (gobject_class, PROP_GPU_DEVICE_ID, \
106 g_param_spec_uint ("gpu-id", "Set GPU Device ID for operation", \
107 "Set GPU Device ID for operation", \
109 (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
110 GST_PARAM_MUTABLE_READY))); \
113 #define PROP_NVBUF_MEMORY_TYPE_INSTALL(gobject_class) \
115 g_object_class_install_property (gobject_class, PROP_NVBUF_MEMORY_TYPE, \
116 g_param_spec_enum ("nvbuf-memory-type", "Type of NvBufSurface memory allocated", \
117 "Type of NvBufSurface Memory to be allocated for output buffers", \
118 GST_TYPE_NVBUF_MEMORY_TYPE, \
120 (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
121 GST_PARAM_MUTABLE_READY))); \
124 #define PROP_COMPUTE_HW_INSTALL(gobject_class) \
126 g_object_class_install_property (gobject_class, PROP_COMPUTE_HW, \
127 g_param_spec_enum ("compute-hw", "compute-hw", \
128 "Compute Scaling HW", \
129 GST_TYPE_COMPUTE_HW, NvBufSurfTransformCompute_Default, \
130 (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
131 GST_PARAM_CONTROLLABLE | G_PARAM_CONSTRUCT))); \
134 #define PROP_INTERPOLATION_METHOD_INSTALL(gobject_class) \
136 g_object_class_install_property (gobject_class, PROP_INTERPOLATION_METHOD, \
137 g_param_spec_enum ("interpolation-method", "Interpolation-method", \
138 "Set interpolation methods", \
139 GST_TYPE_INTERPOLATION_METHOD, NvBufSurfTransformInter_Default, \
140 (GParamFlags)(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | \
141 GST_PARAM_CONTROLLABLE | G_PARAM_CONSTRUCT))); \
#define CHECK_NVDS_MEMORY_AND_GPUID(object, surface)
Holds information about batched buffers.
const char * gst_nvbuf_memory_get_name(int mem_type)
int gst_nvbuf_memory_get_value(const char *mem_type_string)
GType gst_nvbuf_memory_get_type(void)
GType gst_compute_hw_get_type(void)
GType gst_video_interpolation_method_get_type(void)