NVIDIA DeepStream SDK API Reference

9.2 Release
sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.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 __GST_NVDSXFER_H__
19 #define __GST_NVDSXFER_H__
20 
21 #include <gst/base/gstbasetransform.h>
22 #include <gst/video/video.h>
23 #include <glib-object.h>
24 #include <cuda.h>
25 #include <cuda_runtime.h>
26 
27 #include "gstnvdsmeta.h"
28 #include "nvbufsurftransform.h"
29 
30 #include "nvtx3/nvToolsExt.h"
31 
32 /* Package and library details required for plugin_init */
33 #define PACKAGE "nvxfer"
34 #define LICENSE "Proprietary"
35 #define DESCRIPTION "NVIDIA NVDSXFER plugin"
36 #define BINARY_PACKAGE "NVIDIA DeepStream NVDSXFER Plugin"
37 #define URL "http://nvidia.com/"
38 
39 G_BEGIN_DECLS
40 /* Standard boilerplate stuff */
41 typedef struct _GstNvXfer GstNvXfer;
43 
44 /* Standard boilerplate stuff */
45 #define GST_TYPE_NVDSXFER (gst_nvdsxfer_get_type())
46 #define GST_NVXFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVDSXFER,GstNvXfer))
47 #define GST_NVXFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVDSXFER,GstNvXferClass))
48 #define GST_NVXFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_NVDSXFER, GstNvXferClass))
49 #define GST_IS_NVXFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVDSXFER))
50 #define GST_IS_NVXFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVDSXFER))
51 #define GST_NVXFER_CAST(obj) ((GstNvXfer *)(obj))
52 
53 struct _GstNvXfer
54 {
55  GstBaseTransform base_trans;
56 
58  gboolean stop;
59 
61  GstVideoInfo in_video_info;
62  GstVideoInfo out_video_info;
63 
65  guint gpu_id;
66 
69  gint p2p_gpu_id;
71 
73  GstBufferPool *pool;
75 
77  nvtxDomainHandle_t nvtx_domain;
78 
79  GstCaps *sinkcaps;
80  GstCaps *srccaps;
81 
83  guint batch_size;
84 
86  guint frame_num;
87 
90 
93 };
94 
97 {
98  GstBaseTransformClass parent_class;
99 };
100 
101 GType gst_nvdsxfer_get_type (void);
102 
103 G_END_DECLS
104 #endif /* __GST_NVDSXFER_H__ */
_GstNvXfer::pool
GstBufferPool * pool
Output Buffer Pool.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:73
_GstNvXferClass::parent_class
GstBaseTransformClass parent_class
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:98
_GstNvXfer::base_trans
GstBaseTransform base_trans
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:55
_GstNvXfer::nvtx_domain
nvtxDomainHandle_t nvtx_domain
NVTX Domain.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:77
GstNvXfer
typedefG_BEGIN_DECLS struct _GstNvXfer GstNvXfer
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:41
_GstNvXfer::sinkcaps
GstCaps * sinkcaps
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:79
_GstNvXfer::p2p_gpu_id
gint p2p_gpu_id
Enable P2P (Peer to Peer) access between devices i.e.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:69
_GstNvXfer::srccaps
GstCaps * srccaps
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:80
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: includes/nvbufsurftransform.h:40
_GstNvXfer::can_peer_access
gint can_peer_access
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:70
_GstNvXfer::buffer_pool_size
guint buffer_pool_size
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:74
_GstNvXfer
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:53
_GstNvXfer::gpu_id
guint gpu_id
GPU ID on which we expect to execute the task.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:65
_GstNvXfer::cuda_xfer_stream
cudaStream_t cuda_xfer_stream
Cuda Stream used while copying data.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:92
_GstNvXfer::nvbuf_mem_type
gint nvbuf_mem_type
Type of NvBufSurface Memory to be allocated for output buffers.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:89
_GstNvXfer::stop
gboolean stop
Boolean to signal output thread to stop.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:58
_GstNvXfer::frame_num
guint frame_num
Frame number of the buffer, only used for debugging.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:86
_GstNvXfer::batch_size
guint batch_size
Maximum batch size.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:83
_GstNvXfer::in_video_info
GstVideoInfo in_video_info
Input and Output video info (resolution, color format, framerate, etc)
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:61
_GstNvXferClass
GStreamer boilerplate.
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:96
_GstNvXfer::out_video_info
GstVideoInfo out_video_info
Definition: sources/gst-plugins/gst-nvdsxfer/gstnvdsxfer.h:62
gst_nvdsxfer_get_type
GType gst_nvdsxfer_get_type(void)