Agora RTC Objective-C API Reference Refactor

NGIAgoraExtensionProvider.h
Go to the documentation of this file.
1 //
2 // Agora SDK
3 //
4 // Copyright (c) 2021 Agora.io. All rights reserved.
5 //
6
7 #pragma once
8
9 #include "AgoraRefPtr.h"
10 #include "AgoraExtensions.h"
11 #include "AgoraExtensionVersion.h"
12
13 namespace agora {
14 namespace rtc {
15 class IExtensionControl;
16
35 class IExtensionProvider : public RefCountInterface {
36 public:
37 enum EXTENSION_TYPE {
41 AUDIO_FILTER,
45 VIDEO_PRE_PROCESSING_FILTER,
46 VIDEO_POST_PROCESSING_FILTER,
47 AUDIO_SINK,
48 VIDEO_SINK,
49 /*
50 * Used to modify locally captured audio data to play, such as ear monitoring.
51 */
52 AUDIO_RECORDING_LOCAL_PLAYBACK_FILTER = 10000,
53 /*
54 * Used to modify audio data after the local APM (3A).
55 */
56 AUDIO_POST_PROCESSING_FILTER = 10001,
57 /*
58 * Used to modify received and decoded remote user audio data.
59 */
60 AUDIO_REMOTE_USER_PLAYBACK_FILTER = 10002,
61 /*
62 * note: It is used internally by agora and does not support users other than agora.
63 *
64 * Used to modify the audio data of the sender's PCM source to take effect for sending and local playback.
65 */
66 AUDIO_PCM_SOURCE_FILTER = 10003,
67 /*
68 * note: It is used internally by agora and does not support users other than agora.
69 *
70 * Used to Modifying the audio data of the sender's PCM source is only effect for the sending.
71 */
72 AUDIO_PCM_SOURCE_SENDING_FILTER = 10004,
73 /*
74 * note: It is used internally by agora and does not support users other than agora.
75 *
76 * Used to Modifying the audio data of the sender's PCM source is only effect for the local playback.
77 */
78 AUDIO_PCM_SOURCE_LOCAL_PLAYBACK_FILTER = 10005,
79 /*
80 * note: It is used internally by agora and does not support users other than agora.
81 *
82 * Used to modify local playback audio data after the remote audio mixed.
83 */
84 AUDIO_REMOTE_MIXED_PLAYBACK_FILTER = 10006,
85 /*
86 * Used to modify video data betweent capturer and post-capture observer
87 */
88 VIDEO_POST_CAPTURE_FILTER = 20001,
89 /*
90 * Used to modify video data betweent post-capture observer and preview
91 */
92 VIDEO_PRE_PREVIEW_FILTER = 20002,
93 /*
94 * Used to modify video data betweent adapter and encoder
95 */
96 VIDEO_PRE_ENCODER_FILTER = 20003,
97 /*
98 * Used to encode video data
99 */
100 VIDEO_ENCODER = 20004,
101 /*
102 * Used to decode video encoded image
103 */
104 VIDEO_DECODER = 20005,
105 UNKNOWN = 0xFFFF,
106 };
107
108 struct ExtensionMetaInfo {
109 EXTENSION_TYPE type;
110 const char* extension_name;
111 };
112
113 virtual void setExtensionControl(IExtensionControl* control) {}
114
115 virtual void enumerateExtensions(ExtensionMetaInfo* extension_list,
116 int& extension_count) {
117 (void) extension_list;
118 extension_count = 0;
119 }
120
121 virtual agora_refptr<IAudioFilter> createAudioFilter(const char* name) {
122 return NULL;
123 }
124
125 virtual agora_refptr<IExtensionVideoFilter> createVideoFilter(const char* name) {
126 return NULL;
127 }
128
129 virtual agora_refptr<IExtensionVideoSink> createVideoSink(const char* name) {
130 return NULL;
131 }
132
133 virtual void setProperty(const char* key, const char* value) {}
134
135 protected:
136 virtual ~IExtensionProvider() {}
137 };
138
139 class IExtensionProviderV2 : public IExtensionProvider {
140 public:
141 virtual void getExtensionVersion(const char* extension_name, ExtensionVersion& version) = 0;
142 };
143
144 class IExtensionVideoCodecProvider : public IExtensionProvider {
145 public:
146 struct ExtensionVideoCodecInfo {
147 VIDEO_CODEC_TYPE codec_type;
148 bool is_hw_accelerated;
149 };
150
151 ExtensionVideoCodecInfo video_codec_info;
152 };
153
154 class IExtensionVideoEncoderProvider : public IExtensionVideoCodecProvider {
155 public:
156 virtual agora_refptr<IExtensionVideoEncoder> createVideoEncoder(const char* name) {
157 return NULL;
158 }
159 };
160
161 class IExtensionVideoDecoderProvider : public IExtensionVideoCodecProvider {
162 public:
163 virtual agora_refptr<IExtensionVideoDecoder> createVideoDecoder(const char* name) {
164 return NULL;
165 }
166 };
167
168 } // namespace rtc
169 } // namespace agora
agora::rtc::IExtensionProvider::AUDIO_PCM_SOURCE_FILTER
@ AUDIO_PCM_SOURCE_FILTER
Definition: NGIAgoraExtensionProvider.h:66
agora::rtc::IExtensionProvider::ExtensionMetaInfo::type
EXTENSION_TYPE type
Definition: NGIAgoraExtensionProvider.h:109
agora::rtc::IExtensionProvider::ExtensionMetaInfo::extension_name
const char * extension_name
Definition: NGIAgoraExtensionProvider.h:110
agora::rtc::IExtensionProvider::VIDEO_PRE_ENCODER_FILTER
@ VIDEO_PRE_ENCODER_FILTER
Definition: NGIAgoraExtensionProvider.h:96
agora::rtc::IExtensionProvider::ExtensionMetaInfo
Definition: NGIAgoraExtensionProvider.h:108
agora::rtc::ExtensionVersion
Definition: AgoraExtensionVersion.h:14
agora::agora_refptr
Definition: AgoraRefPtr.h:44
agora::rtc::IExtensionProvider::VIDEO_PRE_PREVIEW_FILTER
@ VIDEO_PRE_PREVIEW_FILTER
Definition: NGIAgoraExtensionProvider.h:92
AgoraExtensionVersion.h
agora::rtc::IExtensionProvider::VIDEO_SINK
@ VIDEO_SINK
Definition: NGIAgoraExtensionProvider.h:48
agora::rtc::IExtensionProviderV2::getExtensionVersion
virtual void getExtensionVersion(const char *extension_name, ExtensionVersion &version)=0
agora::rtc::IExtensionProvider::AUDIO_REMOTE_MIXED_PLAYBACK_FILTER
@ AUDIO_REMOTE_MIXED_PLAYBACK_FILTER
Definition: NGIAgoraExtensionProvider.h:84
agora::rtc::IExtensionProvider::~IExtensionProvider
virtual ~IExtensionProvider()
Definition: NGIAgoraExtensionProvider.h:136
agora::rtc::IExtensionProviderV2
Definition: NGIAgoraExtensionProvider.h:139
agora::rtc::IExtensionVideoCodecProvider::ExtensionVideoCodecInfo::codec_type
VIDEO_CODEC_TYPE codec_type
Definition: NGIAgoraExtensionProvider.h:147
agora::rtc::IExtensionProvider::createVideoSink
virtual agora_refptr< IExtensionVideoSink > createVideoSink(const char *name)
Definition: NGIAgoraExtensionProvider.h:129
agora
Definition: AgoraAtomicOps.h:21
agora::rtc::IExtensionProvider::EXTENSION_TYPE
EXTENSION_TYPE
Definition: NGIAgoraExtensionProvider.h:37
agora::rtc::IExtensionProvider::AUDIO_POST_PROCESSING_FILTER
@ AUDIO_POST_PROCESSING_FILTER
Definition: NGIAgoraExtensionProvider.h:56
agora::rtc::IExtensionVideoCodecProvider
Definition: NGIAgoraExtensionProvider.h:144
agora::rtc::IExtensionVideoDecoderProvider::createVideoDecoder
virtual agora_refptr< IExtensionVideoDecoder > createVideoDecoder(const char *name)
Definition: NGIAgoraExtensionProvider.h:163
agora::rtc::IExtensionProvider::AUDIO_PCM_SOURCE_SENDING_FILTER
@ AUDIO_PCM_SOURCE_SENDING_FILTER
Definition: NGIAgoraExtensionProvider.h:72
agora::rtc::IExtensionProvider::VIDEO_PRE_PROCESSING_FILTER
@ VIDEO_PRE_PROCESSING_FILTER
Definition: NGIAgoraExtensionProvider.h:45
agora::rtc::IExtensionVideoEncoderProvider
Definition: NGIAgoraExtensionProvider.h:154
agora::rtc::IExtensionProvider::AUDIO_SINK
@ AUDIO_SINK
Definition: NGIAgoraExtensionProvider.h:47
agora::rtc::IExtensionVideoDecoderProvider
Definition: NGIAgoraExtensionProvider.h:161
agora::rtc::IExtensionProvider::UNKNOWN
@ UNKNOWN
Definition: NGIAgoraExtensionProvider.h:105
AgoraExtensions.h
agora::rtc::IExtensionProvider::setProperty
virtual void setProperty(const char *key, const char *value)
Definition: NGIAgoraExtensionProvider.h:133
agora::rtc::VIDEO_CODEC_TYPE
VIDEO_CODEC_TYPE
Video codec types.
Definition: AgoraBase.h:1256
agora::rtc::IExtensionProvider::AUDIO_PCM_SOURCE_LOCAL_PLAYBACK_FILTER
@ AUDIO_PCM_SOURCE_LOCAL_PLAYBACK_FILTER
Definition: NGIAgoraExtensionProvider.h:78
agora::rtc::IExtensionProvider::VIDEO_POST_CAPTURE_FILTER
@ VIDEO_POST_CAPTURE_FILTER
Definition: NGIAgoraExtensionProvider.h:88
agora::rtc::IExtensionProvider
Definition: NGIAgoraExtensionProvider.h:35
agora::rtc::IExtensionVideoCodecProvider::ExtensionVideoCodecInfo::is_hw_accelerated
bool is_hw_accelerated
Definition: NGIAgoraExtensionProvider.h:148
agora::rtc::IExtensionProvider::VIDEO_POST_PROCESSING_FILTER
@ VIDEO_POST_PROCESSING_FILTER
Definition: NGIAgoraExtensionProvider.h:46
agora::rtc::IExtensionProvider::AUDIO_FILTER
@ AUDIO_FILTER
Definition: NGIAgoraExtensionProvider.h:41
AgoraRefPtr.h
agora::rtc::IExtensionProvider::setExtensionControl
virtual void setExtensionControl(IExtensionControl *control)
Definition: NGIAgoraExtensionProvider.h:113
agora::rtc::IExtensionProvider::AUDIO_RECORDING_LOCAL_PLAYBACK_FILTER
@ AUDIO_RECORDING_LOCAL_PLAYBACK_FILTER
Definition: NGIAgoraExtensionProvider.h:52
agora::rtc::IExtensionProvider::VIDEO_ENCODER
@ VIDEO_ENCODER
Definition: NGIAgoraExtensionProvider.h:100
agora::RefCountInterface
Definition: AgoraRefPtr.h:31
agora::rtc::IExtensionProvider::createVideoFilter
virtual agora_refptr< IExtensionVideoFilter > createVideoFilter(const char *name)
Definition: NGIAgoraExtensionProvider.h:125
agora::rtc::IExtensionProvider::enumerateExtensions
virtual void enumerateExtensions(ExtensionMetaInfo *extension_list, int &extension_count)
Definition: NGIAgoraExtensionProvider.h:115
agora::rtc::IExtensionProvider::createAudioFilter
virtual agora_refptr< IAudioFilter > createAudioFilter(const char *name)
Definition: NGIAgoraExtensionProvider.h:121
agora::rtc::IExtensionVideoCodecProvider::ExtensionVideoCodecInfo
Definition: NGIAgoraExtensionProvider.h:146
agora::rtc::IExtensionProvider::AUDIO_REMOTE_USER_PLAYBACK_FILTER
@ AUDIO_REMOTE_USER_PLAYBACK_FILTER
Definition: NGIAgoraExtensionProvider.h:60
agora::rtc::IExtensionProvider::VIDEO_DECODER
@ VIDEO_DECODER
Definition: NGIAgoraExtensionProvider.h:104
agora::rtc::IExtensionControl
Definition: NGIAgoraExtensionControl.h:22
agora::rtc::IExtensionVideoCodecProvider::video_codec_info
ExtensionVideoCodecInfo video_codec_info
Definition: NGIAgoraExtensionProvider.h:151
agora::rtc::IExtensionVideoEncoderProvider::createVideoEncoder
virtual agora_refptr< IExtensionVideoEncoder > createVideoEncoder(const char *name)
Definition: NGIAgoraExtensionProvider.h:156