NVIDIA DeepStream SDK API Reference

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