NVIDIA DeepStream SDK API Reference

9.2 Release
9.2/sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-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_NVOF_VISUAL_H__
19 #define __GST_NVOF_VISUAL_H__
20 
21 #include <gst/base/gstbasetransform.h>
22 #include <gst/video/video.h>
23 
24 #include <cuda.h>
25 #include <cuda_runtime.h>
26 
27 /* Package and library details required for plugin_init */
28 #define PACKAGE "nvofvisual"
29 #define VERSION "1.0"
30 #define LICENSE "Proprietary"
31 #define DESCRIPTION "NVIDIA opticalflow visualization plugin for integration with DeepStream on DGPU"
32 #define BINARY_PACKAGE "NVIDIA DeepStream Optical Flow Visualization Plugin"
33 #define URL "http://nvidia.com/"
34 
35 
36 G_BEGIN_DECLS
37 /* Standard boilerplate stuff */
40 
41 /* Standard boilerplate stuff */
42 #define GST_TYPE_NV_OF_VISUAL (gst_nvof_visual_get_type())
43 #define GST_NV_OF_VISUAL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NV_OF_VISUAL,GstNvOFVisual))
44 #define GST_NV_OF_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NV_OF_VISUAL,GstNvOFVisualClass))
45 #define GST_NV_OF_VISUAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_NV_OF_VISUAL, GstNvOFVisualClass))
46 #define GST_IS_NV_OF_VISUAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NV_OF_VISUAL))
47 #define GST_IS_NV_OF_VISUAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NV_OF_VISUAL))
48 #define GST_NV_OF_VISUAL_CAST(obj) ((GstNvOFVisual *)(obj))
49 
50 struct _GstNvOFVisual
51 {
52  GstBaseTransform base_trans;
53 
54  // Unique ID of the element. The labels generated by the element will be
55  // updated at index `unique_id` of attr_info array in NvDsObjectParams.
56  guint unique_id;
57 
58  // Frame number of the current input buffer
59  guint64 frame_num;
60 
61  // Input video info (resolution, color format, framerate, etc)
62  GstVideoInfo video_info;
63 
64  // Resolution at which frames/objects should be processed
65  gint output_width;
66  gint output_height;
67 
68  // GPU ID on which we expect to execute the task
69  guint gpu_id;
70 
71  // Buffer pool size used for optical flow output
72  guint pool_size;
73 
74  // Size of the grid in the picture that shares the same optical flow vector
75  gint block_size_x;
76  gint block_size_y;
77 
78  guint max_buffers;
79  gint batch_size;
80  guint num_batch_buffers;
81 
82  gint input_feature;
83  gint output_feature;
84  gint cuda_mem_type;
85  GstVideoFormat input_fmt;
86  GstVideoFormat output_fmt;
87 
88  GstVideoInfo in_info;
89  GstVideoInfo out_info;
90 
91  GstCaps *sinkcaps;
92  GstCaps *srccaps;
93 
94  GstBufferPool *pool;
95 
97  //void *streams_array;
98 };
99 
100 // Boiler plate stuff
101 struct _GstNvOFVisualClass
102 {
103  GstBaseTransformClass parent_class;
104 };
105 
106 GType gst_nvof_visual_get_type (void);
107 
108 G_END_DECLS
109 #endif /* __GST_NVOF_VISUAL_H__ */
_GstNvOFVisual::block_size_x
gint block_size_x
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:75
_GstNvOFVisual::block_size_y
gint block_size_y
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:76
GstNvOFVisual
typedefG_BEGIN_DECLS struct _GstNvOFVisual GstNvOFVisual
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:38
_GstNvOFVisual::pool_size
guint pool_size
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:72
_GstNvOFVisual::output_height
gint output_height
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:66
_GstNvOFVisual::num_batch_buffers
guint num_batch_buffers
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:80
_GstNvOFVisual::srccaps
GstCaps * srccaps
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:92
_GstNvOFVisual::pool
GstBufferPool * pool
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:94
_GstNvOFVisual::streams_array
cudaStream_t * streams_array
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:96
_GstNvOFVisual::max_buffers
guint max_buffers
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:78
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: includes/nvbufsurftransform.h:40
_GstNvOFVisual::video_info
GstVideoInfo video_info
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:62
_GstNvOFVisual::base_trans
GstBaseTransform base_trans
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:52
_GstNvOFVisual::output_fmt
GstVideoFormat output_fmt
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:86
_GstNvOFVisual
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:50
_GstNvOFVisualClass::parent_class
GstBaseTransformClass parent_class
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:103
_GstNvOFVisual::input_feature
gint input_feature
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:82
_GstNvOFVisual::out_info
GstVideoInfo out_info
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:89
_GstNvOFVisual::in_info
GstVideoInfo in_info
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:88
_GstNvOFVisual::output_width
gint output_width
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:65
_GstNvOFVisual::gpu_id
guint gpu_id
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:69
_GstNvOFVisual::output_feature
gint output_feature
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:83
_GstNvOFVisual::batch_size
gint batch_size
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:79
_GstNvOFVisualClass
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:101
gst_nvof_visual_get_type
GType gst_nvof_visual_get_type(void)
_GstNvOFVisual::sinkcaps
GstCaps * sinkcaps
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:91
_GstNvOFVisual::input_fmt
GstVideoFormat input_fmt
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:85
_GstNvOFVisual::cuda_mem_type
gint cuda_mem_type
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:84
_GstNvOFVisual::frame_num
guint64 frame_num
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:59
_GstNvOFVisual::unique_id
guint unique_id
Definition: sources/gst-plugins/gst-nvofvisual/gstnvofvisual.h:56