NVIDIA DeepStream SDK API Reference

9.1 Release
sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-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 __NVDSCUSTOMLIB_INTERFACE_HPP__
19 #define __NVDSCUSTOMLIB_INTERFACE_HPP__
20 
21 #include <string>
22 #include <gst/gstbuffer.h>
23 
24 enum class BufferResult {
25  Buffer_Ok, // Push the buffer from submit_input function
26  Buffer_Drop, // Drop the buffer inside submit_input function
27  Buffer_Async, // Return from submit_input function, custom lib to push the buffer
28  Buffer_Error // Error occured
29 };
30 
32  GstBaseTransform *m_element;
33  GstCaps *m_inCaps;
34  GstCaps *m_outCaps;
35  guint m_gpuId;
39 };
40 
41 struct Property
42 {
43  Property(std::string arg_key, std::string arg_value) : key(arg_key), value(arg_value)
44  {
45  }
46 
47  std::string key;
48  std::string value;
49 };
50 
52 {
53 public:
54  virtual bool SetInitParams (DSCustom_CreateParams *params) = 0;
55  virtual bool SetProperty (Property &prop) = 0;
56  virtual bool HandleEvent (GstEvent *event) = 0;
57  virtual char* QueryProperties () = 0;
58  virtual GstCaps* GetCompatibleCaps (GstPadDirection direction, GstCaps* in_caps, GstCaps* othercaps) = 0;
59  virtual BufferResult ProcessBuffer (GstBuffer *inbuf) = 0;
60  virtual ~IDSCustomLibrary() {};
61 };
62 
63 #endif
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: sources/includes/nvbufsurftransform.h:35
DSCustom_CreateParams
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:31
Property::key
std::string key
Definition: sources/gst-plugins/gst-nvdspostprocess/includes/nvdspostprocesslib_interface.hpp:44
IDSCustomLibrary::SetInitParams
virtual bool SetInitParams(DSCustom_CreateParams *params)=0
DSCustom_CreateParams::m_cudaStream
cudaStream_t m_cudaStream
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:36
Property::value
std::string value
Definition: sources/gst-plugins/gst-nvdspostprocess/includes/nvdspostprocesslib_interface.hpp:45
BufferResult::Buffer_Ok
@ Buffer_Ok
DSCustom_CreateParams::m_element
GstBaseTransform * m_element
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:32
IDSCustomLibrary
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:51
IDSCustomLibrary::SetProperty
virtual bool SetProperty(Property &prop)=0
DSCustom_CreateParams::m_inCaps
GstCaps * m_inCaps
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:33
Property
Definition: sources/gst-plugins/gst-nvdspostprocess/includes/nvdspostprocesslib_interface.hpp:38
DSCustom_CreateParams::m_outCaps
GstCaps * m_outCaps
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:34
DSCustom_CreateParams::m_gpuId
guint m_gpuId
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:35
IDSCustomLibrary::ProcessBuffer
virtual BufferResult ProcessBuffer(GstBuffer *inbuf)=0
IDSCustomLibrary::HandleEvent
virtual bool HandleEvent(GstEvent *event)=0
Property::Property
Property(std::string arg_key, std::string arg_value)
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:43
IDSCustomLibrary::~IDSCustomLibrary
virtual ~IDSCustomLibrary()
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:60
DSCustom_CreateParams::m_fillDummyBatchMeta
gboolean m_fillDummyBatchMeta
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:38
BufferResult::Buffer_Error
@ Buffer_Error
BufferResult::Buffer_Async
@ Buffer_Async
IDSCustomLibrary::GetCompatibleCaps
virtual GstCaps * GetCompatibleCaps(GstPadDirection direction, GstCaps *in_caps, GstCaps *othercaps)=0
BufferResult::Buffer_Drop
@ Buffer_Drop
IDSCustomLibrary::QueryProperties
virtual char * QueryProperties()=0
DSCustom_CreateParams::m_dummyMetaInsert
gboolean m_dummyMetaInsert
Definition: sources/gst-plugins/gst-nvdsvideotemplate/includes/nvdscustomlib_interface.hpp:37
GstBuffer
struct _GstBuffer GstBuffer
Definition: sources/includes/ds3d/common/idatatype.h:24
BufferResult
BufferResult
Definition: sources/gst-plugins/gst-nvdspostprocess/includes/nvdspostprocesslib_interface.hpp:24