NVIDIA DeepStream SDK API Reference

9.1 Release
sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef __GSTNVDSPREPROCESSALLOCATOR_H__
19 #define __GSTNVDSPREPROCESSALLOCATOR_H__
20 
21 #include <cuda_runtime_api.h>
22 #include <gst/gst.h>
23 #include <vector>
24 #include "cudaEGL.h"
25 #include "nvbufsurface.h"
26 
37 typedef struct
38 {
42  std::vector<CUgraphicsResource> cuda_resources;
44  std::vector<CUeglFrame> egl_frames;
48  std::vector<void *> frame_memory_ptrs;
50 
60 
64 typedef struct {
66  guint width;
68  guint height;
72  guint batch_size;
76 
87 GstAllocator *gst_nvdspreprocess_allocator_new (GstNvDsPreProcessVideoBufferAllocatorInfo *info, size_t raw_buf_size,
88  guint gpu_id, gboolean debug_tensor);
89 
90 #endif
NvBufSurface
Holds information about batched buffers.
Definition: sources/includes/nvbufsurface.h:597
GstNvDsPreProcessVideoBufferAllocatorInfo
structure containing video buffer allocator info
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:64
GstNvDsPreProcessVideoBufferAllocatorInfo::memory_type
NvBufSurfaceMemType memory_type
memory type of buffer
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:74
GstNvDsPreProcessVideoBufferAllocatorInfo::batch_size
guint batch_size
batch size
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:72
GstNvDsPreProcessMemory::surf
NvBufSurface * surf
surface corresponding to memory allocated
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:40
NvBufSurfaceMemType
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: sources/includes/nvbufsurface.h:350
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.
GstNvDsPreProcessMemory::egl_frames
std::vector< CUeglFrame > egl_frames
Vector of CUDA eglFrames created by mapping the above cuda resources.
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:44
GstNvDsPreProcessMemory::dev_memory_ptr
void * dev_memory_ptr
Pointer to the memory allocated for the batch of frames (DGPU).
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:46
gst_nvdspreprocess_buffer_get_memory
GstNvDsPreProcessMemory * gst_nvdspreprocess_buffer_get_memory(GstBuffer *buffer)
Get GstNvDsPreProcessMemory structure associated with buffer allocated using GstNvDsPreProcessAllocat...
GstNvDsPreProcessMemory::cuda_resources
std::vector< CUgraphicsResource > cuda_resources
Vector of cuda resources created by registering the above egl images in CUDA.
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:42
GstNvDsPreProcessVideoBufferAllocatorInfo::width
guint width
video buffer width
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:66
GstNvDsPreProcessMemory::frame_memory_ptrs
std::vector< void * > frame_memory_ptrs
Vector of pointer to individual frame memories in the batch memory.
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:48
GstNvDsPreProcessMemory
This file describes the custom memory allocator for the Gstreamer TensorRT plugin.
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:37
GstNvDsPreProcessVideoBufferAllocatorInfo::height
guint height
video buffer height
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:68
GstNvDsPreProcessVideoBufferAllocatorInfo::color_format
NvBufSurfaceColorFormat color_format
color format
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:70
NvBufSurfaceColorFormat
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
Definition: sources/includes/nvbufsurface.h:105
GstBuffer
struct _GstBuffer GstBuffer
Definition: sources/includes/ds3d/common/idatatype.h:24