NVIDIA DeepStream SDK API Reference

7.1 Release
gstnvdsaudiotemplate.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21  * DEALINGS IN THE SOFTWARE.
22  */
23 
24 #ifndef __GST_NVDSAUDIOTEMPLATE_H__
25 #define __GST_NVDSAUDIOTEMPLATE_H__
26 
27 #include <gst/base/gstbasetransform.h>
28 #include <gst/audio/audio.h>
29 #include <glib-object.h>
30 #include <vector>
31 
32 #include <cuda_runtime.h>
33 #include "gstnvdsmeta.h"
34 #include "nvtx3/nvToolsExt.h"
35 
36 #include "nvdscustomlib_factory.hpp"
37 #include "nvdscustomlib_interface.hpp"
38 
39 /* Package and library details required for plugin_init */
40 #define PACKAGE "nvdsaudiotemplate"
41 #define VERSION "1.0"
42 #define LICENSE "Proprietary"
43 #define DESCRIPTION "NVIDIA example Template Plugin for integration with DeepStream on DGPU/Jetson"
44 #define BINARY_PACKAGE "NVIDIA DeepStream Template Plugin"
45 #define URL "http://nvidia.com/"
46 
47 G_BEGIN_DECLS
48 /* Standard boilerplate stuff */
51 
52 /* Standard boilerplate stuff */
53 #define GST_TYPE_NVDSAUDIOTEMPLATE (gst_nvdsaudiotemplate_get_type())
54 #define GST_NVDSAUDIOTEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVDSAUDIOTEMPLATE,GstNvDsAudioTemplate))
55 #define GST_NVDSAUDIOTEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVDSAUDIOTEMPLATE,GstNvDsAudioTemplateClass))
56 #define GST_NVDSAUDIOTEMPLATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_NVDSAUDIOTEMPLATE, GstNvDsAudioTemplateClass))
57 #define GST_IS_NVDSAUDIOTEMPLATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVDSAUDIOTEMPLATE))
58 #define GST_IS_NVDSAUDIOTEMPLATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVDSAUDIOTEMPLATE))
59 #define GST_NVDSAUDIOTEMPLATE_CAST(obj) ((GstNvDsAudioTemplate *)(obj))
60 
62 {
63  GstBaseTransform base_trans;
64 
68 
71 
72  /* Store custom lib property values */
73  std::vector<Property> *vecProp;
75 
77  gboolean stop;
78 
80  GstAudioInfo in_audio_info;
81  GstAudioInfo out_audio_info;
82 
84  guint gpu_id;
85 
87  nvtxDomainHandle_t nvtx_domain;
88 
89  GstCaps *sinkcaps;
90  GstCaps *srccaps;
91 
92  guint frame_number;
94 };
95 
98 {
99  GstBaseTransformClass parent_class;
100 };
101 
102 GType gst_nvdsaudiotemplate_get_type (void);
103 
104 G_END_DECLS
105 #endif /* __GST_NVDSAUDIOTEMPLATE_H__ */
_GstNvDsAudioTemplate::stop
gboolean stop
Boolean to signal output thread to stop.
Definition: gstnvdsaudiotemplate.h:77
_GstNvDsAudioTemplate::num_batch_buffers
guint num_batch_buffers
Definition: gstnvdsaudiotemplate.h:93
_GstNvDsAudioTemplate::sinkcaps
GstCaps * sinkcaps
Definition: gstnvdsaudiotemplate.h:89
DSCustomLibrary_Factory
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_factory.hpp:29
_GstNvDsAudioTemplate::custom_prop_string
gchar * custom_prop_string
Definition: gstnvdsaudiotemplate.h:74
_GstNvDsAudioTemplate::base_trans
GstBaseTransform base_trans
Definition: gstnvdsaudiotemplate.h:63
_GstNvDsAudioTemplate::frame_number
guint frame_number
Definition: gstnvdsaudiotemplate.h:92
_GstNvDsAudioTemplate::out_audio_info
GstAudioInfo out_audio_info
Definition: gstnvdsaudiotemplate.h:81
IDSCustomLibrary
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:43
_GstNvDsAudioTemplate
Definition: gstnvdsaudiotemplate.h:61
gst_nvdsaudiotemplate_get_type
GType gst_nvdsaudiotemplate_get_type(void)
_GstNvDsAudioTemplateClass::parent_class
GstBaseTransformClass parent_class
Definition: gstnvdsaudiotemplate.h:99
gstnvdsmeta.h
GstNvDsAudioTemplate
typedefG_BEGIN_DECLS struct _GstNvDsAudioTemplate GstNvDsAudioTemplate
Definition: gstnvdsaudiotemplate.h:49
_GstNvDsAudioTemplate::custom_lib_name
gchar * custom_lib_name
Custom Library Name and output caps string.
Definition: gstnvdsaudiotemplate.h:70
_GstNvDsAudioTemplate::vecProp
std::vector< Property > * vecProp
Definition: gstnvdsaudiotemplate.h:73
_GstNvDsAudioTemplateClass
Boiler plate stuff.
Definition: gstnvdsaudiotemplate.h:97
_GstNvDsAudioTemplate::algo_ctx
IDSCustomLibrary * algo_ctx
Definition: gstnvdsaudiotemplate.h:67
_GstNvDsAudioTemplate::srccaps
GstCaps * srccaps
Definition: gstnvdsaudiotemplate.h:90
_GstNvDsAudioTemplate::in_audio_info
GstAudioInfo in_audio_info
Input and Output audio info (resolution, color format, framerate, etc)
Definition: gstnvdsaudiotemplate.h:80
_GstNvDsAudioTemplate::nvtx_domain
nvtxDomainHandle_t nvtx_domain
NVTX Domain.
Definition: gstnvdsaudiotemplate.h:87
_GstNvDsAudioTemplate::algo_factory
DSCustomLibrary_Factory * algo_factory
Custom Library Factory and Interface.
Definition: gstnvdsaudiotemplate.h:66
_GstNvDsAudioTemplate::gpu_id
guint gpu_id
GPU ID on which we expect to execute the task.
Definition: gstnvdsaudiotemplate.h:84