NVIDIA DeepStream SDK API Reference

7.0 Release
gstnvdspreprocess_allocator.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021 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 __GSTNVDSPREPROCESSALLOCATOR_H__
14 #define __GSTNVDSPREPROCESSALLOCATOR_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 {
37  std::vector<CUgraphicsResource> cuda_resources;
39  std::vector<CUeglFrame> egl_frames;
43  std::vector<void *> frame_memory_ptrs;
45 
55 
59 typedef struct {
61  guint width;
63  guint height;
67  guint batch_size;
71 
82 GstAllocator *gst_nvdspreprocess_allocator_new (GstNvDsPreProcessVideoBufferAllocatorInfo *info, size_t raw_buf_size,
83  guint gpu_id, gboolean debug_tensor);
84 
85 #endif
gst_nvdspreprocess_allocator_new
GstAllocator * gst_nvdspreprocess_allocator_new(GstNvDsPreProcessVideoBufferAllocatorInfo *info, size_t raw_buf_size, guint gpu_id, gboolean debug_tensor)
Create a new GstNvDsPreProcessAllocator with the given parameters.
gst_nvdspreprocess_buffer_get_memory
GstNvDsPreProcessMemory * gst_nvdspreprocess_buffer_get_memory(GstBuffer *buffer)
Get GstNvDsPreProcessMemory structure associated with buffer allocated using GstNvDsPreProcessAllocat...
GstNvDsPreProcessMemory::egl_frames
std::vector< CUeglFrame > egl_frames
Vector of CUDA eglFrames created by mapping the above cuda resources.
Definition: gstnvdspreprocess_allocator.h:39
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:509
GstNvDsPreProcessMemory::surf
NvBufSurface * surf
surface corresponding to memory allocated
Definition: gstnvdspreprocess_allocator.h:35
GstNvDsPreProcessVideoBufferAllocatorInfo
structure containing video buffer allocator info
Definition: gstnvdspreprocess_allocator.h:59
GstNvDsPreProcessVideoBufferAllocatorInfo::memory_type
NvBufSurfaceMemType memory_type
memory type of buffer
Definition: gstnvdspreprocess_allocator.h:69
GstNvDsPreProcessVideoBufferAllocatorInfo::batch_size
guint batch_size
batch size
Definition: gstnvdspreprocess_allocator.h:67
NvBufSurfaceMemType
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: nvbufsurface.h:306
GstNvDsPreProcessMemory::cuda_resources
std::vector< CUgraphicsResource > cuda_resources
Vector of cuda resources created by registering the above egl images in CUDA.
Definition: gstnvdspreprocess_allocator.h:37
GstNvDsPreProcessMemory::frame_memory_ptrs
std::vector< void * > frame_memory_ptrs
Vector of pointer to individual frame memories in the batch memory.
Definition: gstnvdspreprocess_allocator.h:43
GstBuffer
struct _GstBuffer GstBuffer
Definition: idatatype.h:19
GstNvDsPreProcessVideoBufferAllocatorInfo::width
guint width
video buffer width
Definition: gstnvdspreprocess_allocator.h:61
GstNvDsPreProcessMemory
This file describes the custom memory allocator for the Gstreamer TensorRT plugin.
Definition: gstnvdspreprocess_allocator.h:32
nvbufsurface.h
GstNvDsPreProcessMemory::dev_memory_ptr
void * dev_memory_ptr
Pointer to the memory allocated for the batch of frames (DGPU).
Definition: gstnvdspreprocess_allocator.h:41
GstNvDsPreProcessVideoBufferAllocatorInfo::height
guint height
video buffer height
Definition: gstnvdspreprocess_allocator.h:63
GstNvDsPreProcessVideoBufferAllocatorInfo::color_format
NvBufSurfaceColorFormat color_format
color format
Definition: gstnvdspreprocess_allocator.h:65
NvBufSurfaceColorFormat
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
Definition: nvbufsurface.h:103