NVIDIA DeepStream SDK API Reference

8.0 Release
gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.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_INTERFACE_HPP__
14 #define __NVDSCUSTOMLIB_INTERFACE_HPP__
15 
16 #include <string>
17 #include <gst/gstbuffer.h>
18 #include <cuda_runtime.h>
19 #include "../gstaudio2video.h"
20 #include <gst/video/video.h>
21 
22 enum class BufferResult {
23  Buffer_Ok, // Push the buffer from submit_input function
24  Buffer_Drop, // Drop the buffer inside submit_input function
25  Buffer_Async, // Return from submit_input function, custom lib to push the buffer
26  Buffer_Error // Error occured
27 };
28 
29 enum class QueryResult {
30  Query_Ok, // Query is handled by custom lib Successfully.
31  Query_Not_Handled, // Query is not handled by custom lib and expect to get it handled by parent element
32  Query_Error // Query is handled by custom lib with Error.
33 };
34 
36  GstElement *m_element;
37 };
38 
39 struct Property
40 {
41  Property(std::string arg_key, std::string arg_value) : key(arg_key), value(arg_value)
42  {
43  }
44 
45  std::string key;
46  std::string value;
47 };
48 
50 {
51 public:
52  virtual bool SetInitParams (DSCustom_CreateParams *params) = 0;
53  virtual bool SetProperty (Property &prop) = 0;
54  virtual bool HandleEvent (GstEvent *event) = 0;
55  virtual QueryResult HandleQuery(GstQuery *query, GstStructure *query_metadata) = 0;
56  virtual BufferResult ProcessBuffer(GstAudio2Video * base, GstBuffer * audio, GstVideoFrame * video) = 0;
57  virtual char* QueryProperties () = 0;
58  virtual ~IDSCustomLibrary() {};
59 };
60 
61 #endif
DSCustom_CreateParams
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:35
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:45
IDSCustomLibrary::SetInitParams
virtual bool SetInitParams(DSCustom_CreateParams *params)=0
BufferResult
BufferResult
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:22
Property::value
std::string value
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:46
DSCustom_CreateParams::m_element
GstElement * m_element
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:36
QueryResult::Query_Not_Handled
@ Query_Not_Handled
IDSCustomLibrary
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:49
IDSCustomLibrary::SetProperty
virtual bool SetProperty(Property &prop)=0
Property
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:39
IDSCustomLibrary::HandleQuery
virtual QueryResult HandleQuery(GstQuery *query, GstStructure *query_metadata)=0
QueryResult::Query_Error
@ Query_Error
IDSCustomLibrary::HandleEvent
virtual bool HandleEvent(GstEvent *event)=0
Property::Property
Property(std::string arg_key, std::string arg_value)
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:41
IDSCustomLibrary::~IDSCustomLibrary
virtual ~IDSCustomLibrary()
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:58
QueryResult
QueryResult
Definition: gst-nvdsA2Vtemplate/includes/nvdscustomlib_interface.hpp:29
QueryResult::Query_Ok
@ Query_Ok
GstBuffer
struct _GstBuffer GstBuffer
Definition: idatatype.h:19
BufferResult::Buffer_Error
@ Buffer_Error
BufferResult::Buffer_Ok
@ Buffer_Ok
IDSCustomLibrary::QueryProperties
virtual char * QueryProperties()=0
_GstAudio2Video
Definition: gstaudio2video.h:33