NVIDIA DeepStream SDK API Reference

7.1 Release
gstnvinfer_allocator.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2020 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #ifndef __GSTNVINFERALLOCATOR_H__
14 #define __GSTNVINFERALLOCATOR_H__
15 
16 #include <cuda_runtime_api.h>
17 #include <gst/gst.h>
18 #include <vector>
19 #include "cudaEGL.h"
20 #include "nvbufsurface.h"
21 
32 typedef struct
33 {
36  std::vector<CUgraphicsResource> cuda_resources;
38  std::vector<CUeglFrame> egl_frames;
42  std::vector<void *> frame_memory_ptrs;
44 
54 
66 GstAllocator *gst_nvinfer_allocator_new (guint width, guint height,
67  NvBufSurfaceColorFormat color_format, guint batch_size, guint gpu_id);
68 
69 #endif
GstNvInferMemory::dev_memory_ptr
void * dev_memory_ptr
Pointer to the memory allocated for the batch of frames (DGPU).
Definition: gstnvinfer_allocator.h:40
GstNvInferMemory::cuda_resources
std::vector< CUgraphicsResource > cuda_resources
Vector of cuda resources created by registering the above egl images in CUDA.
Definition: gstnvinfer_allocator.h:36
GstNvInferMemory::egl_frames
std::vector< CUeglFrame > egl_frames
Vector of CUDA eglFrames created by mapping the above cuda resources.
Definition: gstnvinfer_allocator.h:38
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:520
GstNvInferMemory::surf
NvBufSurface * surf
Definition: gstnvinfer_allocator.h:34
GstNvInferMemory
This file describes the custom memory allocator for the Gstreamer TensorRT plugin.
Definition: gstnvinfer_allocator.h:32
GstNvInferMemory::frame_memory_ptrs
std::vector< void * > frame_memory_ptrs
Vector of pointer to individual frame memories in the batch memory.
Definition: gstnvinfer_allocator.h:42
GstBuffer
struct _GstBuffer GstBuffer
Definition: idatatype.h:19
gst_nvinfer_buffer_get_memory
GstNvInferMemory * gst_nvinfer_buffer_get_memory(GstBuffer *buffer)
Get GstNvInferMemory structure associated with buffer allocated using GstNvInferAllocator.
nvbufsurface.h
gst_nvinfer_allocator_new
GstAllocator * gst_nvinfer_allocator_new(guint width, guint height, NvBufSurfaceColorFormat color_format, guint batch_size, guint gpu_id)
Create a new GstNvInferAllocator with the given parameters.
NvBufSurfaceColorFormat
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
Definition: nvbufsurface.h:107