NVIDIA DeepStream SDK API Reference

8.0 Release
gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2023-2024 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  /* By default, return Query_Not_Handled to allow handling by parent elemtn */
45  virtual QueryResult HandleQuery(GstQuery *query, GstStructure *query_metadata) override {
47 
48  virtual char* QueryProperties () = 0;
49 
50  virtual BufferResult ProcessBuffer(GstAudio2Video * base, GstBuffer * audio, GstVideoFrame * video) = 0;
51 
52 public:
53  /* Gstreamer dsexaple2 plugin's base class reference */
54  GstElement *m_element;
55 
57 };
58 
59 
60 DSCustomLibraryBase::DSCustomLibraryBase(GstElement* bscope) : m_element(bscope) {
61 }
62 
64  m_element = params->m_element;
65 
66  return true;
67 }
68 
70 }
71 
72 #endif
DSCustomLibraryBase::ProcessBuffer
virtual BufferResult ProcessBuffer(GstBuffer *inbuf)=0
DSCustom_CreateParams
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:35
DSCustomLibraryBase::HandleQuery
virtual QueryResult HandleQuery(GstQuery *query, GstStructure *query_metadata) override
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp:45
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:36
DSCustomLibraryBase::SetProperty
virtual bool SetProperty(Property &prop)=0
DSCustomLibraryBase::QueryProperties
virtual char * QueryProperties()=0
QueryResult::Query_Not_Handled
@ Query_Not_Handled
DSCustomLibraryBase::m_element
GstElement * m_element
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp:54
IDSCustomLibrary
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:49
BufferPoolConfig
Definition: nvdscustomlib_base.h:33
DSCustomLibraryBase::~DSCustomLibraryBase
virtual ~DSCustomLibraryBase()
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_base.hpp:69
Property
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:39
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
QueryResult
QueryResult
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:29
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:63
nvdscustomlib_interface.hpp
_GstAudio2Video
Definition: gstaudio2video.h:33
DSCustomLibraryBase
Definition: nvdscustomlib_base.h:40