NVIDIA DeepStream SDK API Reference
8.0 Release
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2021 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 __NVDSCUSTOMLIB_BASE_HPP__
25
#define __NVDSCUSTOMLIB_BASE_HPP__
26
27
#include <gst/audio/audio.h>
28
#include <gst/base/gstbasetransform.h>
29
30
#include "
nvdscustomlib_interface.hpp
"
31
32
/* Buffer Pool Configuration Parameters */
33
struct
BufferPoolConfig
{
34
gint
cuda_mem_type
;
35
guint
gpu_id
;
36
guint
max_buffers
;
37
gint
batch_size
;
38
};
39
40
class
DSCustomLibraryBase
:
public
IDSCustomLibrary
{
41
public
:
42
explicit
DSCustomLibraryBase
(GstBaseTransform* btrans =
nullptr
);
43
44
/* Set Init Parameters */
45
virtual
bool
SetInitParams
(
DSCustom_CreateParams
*params);
46
47
virtual
~DSCustomLibraryBase
();
48
49
virtual
bool
HandleEvent
(GstEvent *event) = 0;
50
51
virtual
char
*
QueryProperties
() = 0;
52
53
/* Set Custom Properties of the library */
54
virtual
bool
SetProperty
(
Property
&prop) = 0;
55
// TODO: Add getProperty as well
56
57
/* Get GetCompatibleOutputCaps */
58
virtual
GstCaps *
GetCompatibleCaps
(GstPadDirection direction,
59
GstCaps *in_caps, GstCaps *othercaps);
60
61
/* Process Incoming Buffer */
62
virtual
BufferResult
ProcessBuffer
(
GstBuffer
*inbuf) = 0;
63
64
public
:
65
/* Gstreamer dsexaple2 plugin's base class reference */
66
GstBaseTransform *
m_element
;
67
69
guint
m_gpuId
;
70
71
/* Audio Information */
72
GstAudioInfo
m_inAudioInfo
;
73
GstAudioInfo
m_outAudioInfo
;
74
75
/* Audio Format Information */
76
GstAudioFormat
m_inAudioFmt
;
77
GstAudioFormat
m_outAudioFmt
;
78
79
/* Gst Caps Information */
80
GstCaps *
m_inCaps
;
81
GstCaps *
m_outCaps
;
82
};
83
84
#endif
DSCustomLibraryBase::ProcessBuffer
virtual BufferResult ProcessBuffer(GstBuffer *inbuf)=0
DSCustom_CreateParams
Definition:
sources/gst-plugins/gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:35
DSCustomLibraryBase::m_inAudioFmt
GstAudioFormat m_inAudioFmt
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:76
DSCustomLibraryBase::m_outCaps
GstCaps * m_outCaps
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:81
DSCustomLibraryBase::m_outAudioFmt
GstAudioFormat m_outAudioFmt
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:77
BufferPoolConfig::batch_size
gint batch_size
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:37
DSCustomLibraryBase::m_outAudioInfo
GstAudioInfo m_outAudioInfo
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:73
DSCustomLibraryBase::m_element
GstBaseTransform * m_element
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:66
DSCustomLibraryBase::SetProperty
virtual bool SetProperty(Property &prop)=0
DSCustomLibraryBase::QueryProperties
virtual char * QueryProperties()=0
DSCustomLibraryBase::m_inCaps
GstCaps * m_inCaps
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:80
IDSCustomLibrary
Definition:
sources/gst-plugins/gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:49
BufferResult
BufferResult
Definition:
sources/gst-plugins/gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:22
BufferPoolConfig
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:33
DSCustomLibraryBase::~DSCustomLibraryBase
virtual ~DSCustomLibraryBase()
Definition:
sources/gst-plugins/gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp:69
DSCustomLibraryBase::GetCompatibleCaps
virtual GstCaps * GetCompatibleCaps(GstPadDirection direction, GstCaps *in_caps, GstCaps *othercaps)
Definition:
sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_base.hpp:126
Property
Definition:
sources/gst-plugins/gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:39
DSCustomLibraryBase::DSCustomLibraryBase
DSCustomLibraryBase(GstBaseTransform *btrans=nullptr)
Definition:
sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_base.hpp:97
BufferPoolConfig::max_buffers
guint max_buffers
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:36
BufferPoolConfig::cuda_mem_type
gint cuda_mem_type
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:34
BufferPoolConfig::gpu_id
guint gpu_id
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:35
DSCustomLibraryBase::HandleEvent
virtual bool HandleEvent(GstEvent *event)=0
DSCustomLibraryBase::m_gpuId
guint m_gpuId
GPU ID on which we expect to execute the algorithm.
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:69
nvdscustomlib_interface.hpp
DSCustomLibraryBase::m_inAudioInfo
GstAudioInfo m_inAudioInfo
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:72
DSCustomLibraryBase::SetInitParams
virtual bool SetInitParams(DSCustom_CreateParams *params)
Definition:
sources/gst-plugins/gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp:63
DSCustomLibraryBase
Definition:
sources/gst-plugins/gst-nvdsaudiotemplate/common/nvdscustomlib_base.h:40
GstBuffer
struct _GstBuffer GstBuffer
Definition:
sources/includes/ds3d/common/idatatype.h:19
Privacy Policy
|
Manage My Privacy
|
Do Not Sell or Share My Data
|
Terms of Service
|
Accessibility
|
Corporate Policies
|
Product Security
|
Contact
© 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
NVIDIA Confidential | Subject to Change | For test and development only.
Tue Mar 17 2026 09:30:36 | PR-09318-R32