NVIDIA DeepStream SDK API Reference

7.1 Release
gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021 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 __NVDS_TTS_CUSTOMLIB_INTERFACE_HPP__
14 #define __NVDS_TTS_CUSTOMLIB_INTERFACE_HPP__
15 
16 #include <gst/base/gstbasetransform.h>
17 #include <gst/gstbuffer.h>
18 #include <string>
19 
20 #define NVDS_CONFIG_FILE_PROPERTY "config-file"
21 
22 namespace nvdstts {
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
28  // buffer
29  Buffer_Error // Error occured
30 };
31 
33  GstBaseTransform* m_element;
34  GstCaps* m_inCaps;
35  GstCaps* m_outCaps;
36 };
37 
38 struct Property {
39  Property(std::string arg_key, std::string arg_value)
40  : key(arg_key), value(arg_value)
41  {
42  }
43 
44  std::string key;
45  std::string value;
46 };
47 
48 enum class CapsType : int {
49  kNone = 0,
50  kAudio,
51  kText,
52 };
53 
55 public:
56  virtual bool SetProperty(const Property& prop) = 0;
57  virtual bool Initialize() = 0;
58  virtual GstCaps* GetCompatibleCaps(
59  GstPadDirection direction, GstCaps* in_caps, GstCaps* othercaps) = 0;
60  virtual bool StartWithParams(DSCustom_CreateParams* params) = 0;
61  virtual bool HandleEvent(GstEvent* event) = 0;
62  virtual BufferResult ProcessBuffer(GstBuffer* inbuf) = 0;
63  virtual ~IDSCustomLibrary(){};
64 };
65 
66 } // namespace nvdstts
67 
68 #endif
nvdstts::IDSCustomLibrary
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:54
nvdstts::CapsType::kAudio
@ kAudio
nvdstts::DSCustom_CreateParams::m_inCaps
GstCaps * m_inCaps
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:34
nvdstts::IDSCustomLibrary::Initialize
virtual bool Initialize()=0
nvdstts::IDSCustomLibrary::SetProperty
virtual bool SetProperty(const Property &prop)=0
nvdstts::BufferResult::Buffer_Drop
@ Buffer_Drop
nvdstts::Property
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:38
nvdstts::DSCustom_CreateParams::m_outCaps
GstCaps * m_outCaps
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:35
nvdstts::CapsType
CapsType
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:48
nvdstts::BufferResult::Buffer_Ok
@ Buffer_Ok
nvdstts::Property::value
std::string value
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:45
nvdstts::CapsType::kNone
@ kNone
nvdstts::BufferResult
BufferResult
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:24
nvdstts::DSCustom_CreateParams::m_element
GstBaseTransform * m_element
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:33
nvdstts::BufferResult::Buffer_Error
@ Buffer_Error
nvdstts::IDSCustomLibrary::HandleEvent
virtual bool HandleEvent(GstEvent *event)=0
nvdstts::CapsType::kText
@ kText
nvdstts
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_factory.h:24
nvdstts::IDSCustomLibrary::GetCompatibleCaps
virtual GstCaps * GetCompatibleCaps(GstPadDirection direction, GstCaps *in_caps, GstCaps *othercaps)=0
nvdstts::IDSCustomLibrary::~IDSCustomLibrary
virtual ~IDSCustomLibrary()
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:63
nvdstts::IDSCustomLibrary::StartWithParams
virtual bool StartWithParams(DSCustom_CreateParams *params)=0
GstBuffer
struct _GstBuffer GstBuffer
Definition: idatatype.h:19
nvdstts::IDSCustomLibrary::ProcessBuffer
virtual BufferResult ProcessBuffer(GstBuffer *inbuf)=0
nvdstts::Property::key
std::string key
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:44
nvdstts::Property::Property
Property(std::string arg_key, std::string arg_value)
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:39
nvdstts::BufferResult::Buffer_Async
@ Buffer_Async
nvdstts::DSCustom_CreateParams
Definition: gst-nvdstexttospeech/includes/nvdscustomlib_interface.hpp:32