NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/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 {
40  NvBufSurface *surf;
42  std::vector<CUgraphicsResource> cuda_resources;
44  std::vector<CUeglFrame> egl_frames;
46  void *dev_memory_ptr;
48  std::vector<void *> frame_memory_ptrs;
50 
60 
64 typedef struct {
66  guint width;
68  guint height;
70  NvBufSurfaceColorFormat color_format;
72  guint batch_size;
74  NvBufSurfaceMemType memory_type;
76 
87 GstAllocator *gst_nvdspreprocess_allocator_new (GstNvDsPreProcessVideoBufferAllocatorInfo *info, size_t raw_buf_size,
88  guint gpu_id, gboolean debug_tensor);
89 
90 #endif
gst_nvdspreprocess_buffer_get_memory
GstNvDsPreProcessMemory * gst_nvdspreprocess_buffer_get_memory(GstBuffer *buffer)
Get GstNvDsPreProcessMemory structure associated with buffer allocated using GstNvDsPreProcessAllocat...
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
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.
NvBufSurfaceMemType
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: sources/includes/nvbufsurface.h:350
GstNvDsPreProcessMemory
This file describes the custom memory allocator for the Gstreamer TensorRT plugin.
Definition: sources/gst-plugins/gst-nvdspreprocess/gstnvdspreprocess_allocator.h:37
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