NVIDIA DeepStream SDK API Reference

7.0 Release
gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #ifndef __NVDSCUSTOMLIB_BASE_HPP__
14 #define __NVDSCUSTOMLIB_BASE_HPP__
15 
16 #include <gst/base/gstbasetransform.h>
17 
19 
20 /* Buffer Pool Configuration Parameters */
21 struct BufferPoolConfig {
22  gint cuda_mem_type;
23  guint gpu_id;
24  guint max_buffers;
25  gint batch_size;
26 };
27 
29 {
30 public:
31  explicit DSCustomLibraryBase(GstElement* bscope = nullptr);
32 
33  /* Set Init Parameters */
34  virtual bool SetInitParams(DSCustom_CreateParams *params);
35 
36  virtual ~DSCustomLibraryBase();
37 
38  /* Set Custom Properties of the library */
39  virtual bool SetProperty(Property &prop) = 0;
40 
41  virtual bool HandleEvent (GstEvent *event) = 0;
42  // TODO: Add getProperty as well
43 
44  virtual char* QueryProperties () = 0;
45 
46  virtual BufferResult ProcessBuffer(GstAudio2Video * base, GstBuffer * audio, GstVideoFrame * video) = 0;
47 
48 public:
49  /* Gstreamer dsexaple2 plugin's base class reference */
50  GstElement *m_element;
51 
53 };
54 
55 
56 DSCustomLibraryBase::DSCustomLibraryBase(GstElement* bscope) : m_element(bscope) {
57 }
58 
60  m_element = params->m_element;
61 
62  return true;
63 }
64 
66 }
67 
68 #endif
DSCustomLibraryBase::ProcessBuffer
virtual BufferResult ProcessBuffer(GstBuffer *inbuf)=0
DSCustom_CreateParams
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:29
BufferPoolConfig::batch_size
gint batch_size
Definition: nvdscustomlib_base.h:37
BufferResult
BufferResult
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:22
DSCustomLibraryBase::m_element
GstBaseTransform * m_element
Definition: nvdscustomlib_base.h:66
DSCustom_CreateParams::m_element
GstElement * m_element
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:30
DSCustomLibraryBase::SetProperty
virtual bool SetProperty(Property &prop)=0
DSCustomLibraryBase::QueryProperties
virtual char * QueryProperties()=0
DSCustomLibraryBase::m_element
GstElement * m_element
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp:50
IDSCustomLibrary
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:43
BufferPoolConfig
Definition: nvdscustomlib_base.h:33
DSCustomLibraryBase::~DSCustomLibraryBase
virtual ~DSCustomLibraryBase()
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp:65
Property
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:33
DSCustomLibraryBase::DSCustomLibraryBase
DSCustomLibraryBase(GstBaseTransform *btrans=nullptr)
Definition: gst-nvdsvideotemplate/includes/nvdscustomlib_base.hpp:97
BufferPoolConfig::max_buffers
guint max_buffers
Definition: nvdscustomlib_base.h:36
BufferPoolConfig::cuda_mem_type
gint cuda_mem_type
Definition: nvdscustomlib_base.h:34
BufferPoolConfig::gpu_id
guint gpu_id
Definition: nvdscustomlib_base.h:35
DSCustomLibraryBase::HandleEvent
virtual bool HandleEvent(GstEvent *event)=0
GstBuffer
struct _GstBuffer GstBuffer
Definition: idatatype.h:19
DSCustomLibraryBase::SetInitParams
virtual bool SetInitParams(DSCustom_CreateParams *params)
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp:59
nvdscustomlib_interface.hpp
_GstAudio2Video
Definition: gstaudio2video.h:33
DSCustomLibraryBase
Definition: nvdscustomlib_base.h:40