@volcengine/react-native-live-push 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/android/build.gradle +92 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +16 -0
  6. package/android/src/main/AndroidManifestNew.xml +16 -0
  7. package/android/src/main/java/com/volcengine/velive/rn/push/ExternalSourceHelper.java +58 -0
  8. package/android/src/main/java/com/volcengine/velive/rn/push/NativeVariableManager.java +19 -0
  9. package/android/src/main/java/com/volcengine/velive/rn/push/ScreenCaptureHelper.java +73 -0
  10. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushModule.java +182 -0
  11. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushModuleSpec.java +16 -0
  12. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushPackage.java +27 -0
  13. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushView.java +45 -0
  14. package/android/src/main/java/com/volcengine/velive/rn/push/VeLivePushViewManager.java +87 -0
  15. package/ios/VeLivePushSDK.h +24 -0
  16. package/ios/VeLivePushSDK.m +109 -0
  17. package/ios/VeLivePushView.h +24 -0
  18. package/ios/VeLivePushView.m +74 -0
  19. package/ios/VeLivePushViewManager.m +59 -0
  20. package/lib/commonjs/index.js +24238 -0
  21. package/lib/module/index.js +24186 -0
  22. package/lib/typescript/android/index.d.ts +44 -0
  23. package/lib/typescript/codegen/android/api.d.ts +1408 -0
  24. package/lib/typescript/codegen/android/callback.d.ts +265 -0
  25. package/lib/typescript/codegen/android/errorcode.d.ts +50 -0
  26. package/lib/typescript/codegen/android/index.d.ts +5 -0
  27. package/lib/typescript/codegen/android/keytype.d.ts +1069 -0
  28. package/lib/typescript/codegen/android/types.d.ts +32 -0
  29. package/lib/typescript/codegen/ios/api.d.ts +1133 -0
  30. package/lib/typescript/codegen/ios/callback.d.ts +251 -0
  31. package/lib/typescript/codegen/ios/errorcode.d.ts +104 -0
  32. package/lib/typescript/codegen/ios/index.d.ts +5 -0
  33. package/lib/typescript/codegen/ios/keytype.d.ts +934 -0
  34. package/lib/typescript/codegen/ios/types.d.ts +35 -0
  35. package/lib/typescript/codegen/pack/api.d.ts +1923 -0
  36. package/lib/typescript/codegen/pack/callback.d.ts +545 -0
  37. package/lib/typescript/codegen/pack/errorcode.d.ts +174 -0
  38. package/lib/typescript/codegen/pack/index.d.ts +5 -0
  39. package/lib/typescript/codegen/pack/keytype.d.ts +1953 -0
  40. package/lib/typescript/codegen/pack/types.d.ts +1 -0
  41. package/lib/typescript/codegen/type-shim.d.ts +6 -0
  42. package/lib/typescript/component.d.ts +8 -0
  43. package/lib/typescript/core/api.d.ts +2 -0
  44. package/lib/typescript/core/callback.d.ts +2 -0
  45. package/lib/typescript/core/env.d.ts +29 -0
  46. package/lib/typescript/core/errorcode.d.ts +2 -0
  47. package/lib/typescript/core/index.d.ts +6 -0
  48. package/lib/typescript/core/keytype.d.ts +7 -0
  49. package/lib/typescript/core/pusher.d.ts +16 -0
  50. package/lib/typescript/index.d.ts +2 -0
  51. package/lib/typescript/ios/extends.d.ts +41 -0
  52. package/lib/typescript/runtime.d.ts +1 -0
  53. package/package.json +31 -0
  54. package/react-native-velive-push.podspec +45 -0
@@ -0,0 +1,1133 @@
1
+ import { NSString, BOOL, int, float, CGPoint, NSDictionary, id, UIView, long, NSArray, UIImage, EAGLContext } from './types';
2
+ import { VeLiveFileRecorderConfiguration, VeLiveAudioMixType, VeLiveVideoFrame, VeLiveAudioFrame, VeLiveStreamMixDescription, VeLivePusherConfiguration, VeLivePusherRenderMode, VeLiveVideoMirrorType, VeLiveVideoCaptureType, VeLiveAudioCaptureType, VeLiveVideoEncoderConfiguration, VeLiveAudioEncoderConfiguration, UIInterfaceOrientation, VeLiveVideoEncodeFrame, VeLivePusherLogConfig, VeLivePusherLogLevel, VeLiveVideoEffectLicenseConfiguration } from './keytype';
3
+ import { VeLiveMediaPlayerListener, VeLiveMediaPlayerFrameListener, VeLivePusherObserver, VeLivePusherStatisticsObserver, VeLiveVideoFrameListener, VeLiveAudioFrameListener, VeLiveScreenCaptureStatusObserver, VeLiveFileRecordingListener, VeLiveVideoFrameFilter, VeLiveAudioFrameFilter, VeLiveSnapshotListener } from './callback';
4
+ export declare class VeLiveFileRecorderManager {
5
+ init(): this;
6
+ /** {zh}
7
+ * @detail api
8
+ * @brief 开始直播录制。
9
+ * @notes <br>
10
+ * - 请在调用 [startPush:](155318#VeLivePusher-startpush) 推流成功之后,调用该方法,直播过程中的音视频数据将保存到本地;
11
+ * - 本方法为异步操作;
12
+ * - 开始录制后,会触发 [onFileRecordingStarted](155319#VeLiveFileRecordingListener-onfilerecordingstarted) 回调消息;
13
+ * - 录制出现错误,会触发 [onFileRecordingError:message:](155319#VeLiveFileRecordingListener-onfilerecordingerror-message) 回调消息。
14
+ * @param path 录制文件保存路径,不能为空。
15
+ * @param config 直播录制配置。详情请参见 [VeLiveFileRecorderConfiguration](155321#VeLiveFileRecorderConfiguration)。
16
+ */
17
+ startRecord(path: NSString, config: VeLiveFileRecorderConfiguration): void;
18
+ /** {zh}
19
+ * @detail api
20
+ * @brief 停止本地直播录制。
21
+ * @notes <br>
22
+ * - 请在调用 [startRecord:config:](#VeLiveFileRecorderManager-startrecord-config) 成功开始录制之后,调用该方法;
23
+ * - 本方法为异步操作;
24
+ * - 停止录制,会触发 [onFileRecordingStoped](155319#VeLiveFileRecordingListener-onfilerecordingstopped) 回调消息;
25
+ * - 录制出现错误,会触发 [onFileRecordingError:message:](155319#VeLiveFileRecordingListener-onfilerecordingerror-message) 回调消息。
26
+ */
27
+ stopRecord(): void;
28
+ }
29
+ export declare class VeLiveCameraDevice {
30
+ init(): this;
31
+ /** {zh}
32
+ * @detail api
33
+ * @brief 是否支持闪光灯。
34
+ * @return <br>
35
+ * - YES:支持;
36
+ * - NO:不支持。
37
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
38
+ * @order 49
39
+ */
40
+ isTorchSupported(): BOOL;
41
+ /** {zh}
42
+ * @detail api
43
+ * @brief 开启/关闭闪光灯。
44
+ * @return <br>
45
+ * - =0:开启/关闭成功;
46
+ * - ≠0:开启/关闭失败。
47
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
48
+ * @order 51
49
+ * @param enable 是否开启闪光灯。默认为 NO。 <br>
50
+ * - YES:开启;
51
+ * - NO:关闭。
52
+ */
53
+ enableTorch(enable: BOOL): int;
54
+ /** {zh}
55
+ * @detail api
56
+ * @brief 设置摄像头的缩放倍数。
57
+ * @return <br>
58
+ * - =0:缩放成功;
59
+ * - ≠0:缩放失败。
60
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
61
+ * @order 52
62
+ * @param ratio 缩放倍数。默认为原尺寸,缩放倍数的取值范围为 [[getMinZoomRatio,getMaxZoomRatio](155318#VeLiveCameraDevice-getmaxzoomratio)]。
63
+ */
64
+ setZoomRatio(ratio: float): int;
65
+ /** {zh}
66
+ * @detail api
67
+ * @brief 获取摄像头当前的缩放倍数。
68
+ * @return <br>
69
+ * - ≤0:表示不支持缩放;
70
+ * - \\>0:支持缩放,数值表示当前缩放倍数。
71
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
72
+ * @order 53
73
+ */
74
+ getCurrentZoomRatio(): float;
75
+ /** {zh}
76
+ * @detail api
77
+ * @brief 获取摄像头的最大缩放倍数。
78
+ * @return <br>
79
+ * - ≤0:表示不支持缩放;
80
+ * - \\>0:支持缩放,数值表示最大缩放倍数。
81
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
82
+ * @order 54
83
+ */
84
+ getMaxZoomRatio(): float;
85
+ /** {zh}
86
+ * @detail api
87
+ * @brief 获取摄像头的最小缩放倍数。
88
+ * @return <br>
89
+ * - ≤0:表示不支持缩放;
90
+ * - \\>0:支持缩放,数值表示最小缩放倍数。
91
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
92
+ * @order 55
93
+ */
94
+ getMinZoomRatio(): float;
95
+ /** {zh}
96
+ * @detail api
97
+ * @brief 是否支持自动对焦。
98
+ * @return <br>
99
+ * - YES:支持;
100
+ * - NO:不支持。
101
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
102
+ * @order 56
103
+ */
104
+ isAutoFocusEnabled(): BOOL;
105
+ /** {zh}
106
+ * @detail api
107
+ * @brief 开启/关闭自动对焦功能。
108
+ * @return <br>
109
+ * - =0:开启/关闭成功;
110
+ * - ≠0:开启/关闭失败。
111
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
112
+ * @order 57
113
+ * @param enable 是否开启自动对焦,默认为 YES。
114
+ * - YES:开启;
115
+ * - NO:关闭。
116
+ */
117
+ enableAutoFocus(enable: BOOL): int;
118
+ /** {zh}
119
+ * @detail api
120
+ * @brief 设置摄像头的对焦位置。
121
+ * @return <br>
122
+ * - =0:设置成功;
123
+ * - ≠0:设置失败。
124
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
125
+ * @order 58
126
+ * @param position 以左上角为原点,对焦点距当前视图的坐标值。
127
+ */
128
+ setFocusPosition(position: CGPoint): int;
129
+ /** {zh}
130
+ * @detail api
131
+ * @brief 检查当前使用的摄像头是否支持手动设置曝光点。
132
+ * @return <br>
133
+ * - YES: 支持。 <br>
134
+ * - NO: 不支持。
135
+ * @notes 必须已调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 使用 SDK 内部采集模块进行视频采集时,才能检查曝光点设置能力。
136
+ * @order 59
137
+ */
138
+ isExposurePositionSupported(): BOOL;
139
+ /** {zh}
140
+ * @detail api
141
+ * @brief 设置当前使用的摄像头的曝光点。
142
+ * @param position 曝光点坐标。以本地预览画布的左上为坐标原点,`position`的`x`字段为曝光点水平方向归一化坐标,`y`字段为曝光点垂直方向归一化坐标,取值范围为 [0, 1]。
143
+ * @return <br>
144
+ * - =0: 成功。
145
+ * - ≠0: 失败。
146
+ * @notes <br>
147
+ * - 必须已调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 使用 SDK 内部采集模块进行视频采集,并且使用 SDK 内部渲染时,才能设置曝光点。 <br>
148
+ * - 曝光点设置为画布中央(即`x`和`y`均取 0.5)时,恢复系统默认值。 <br>
149
+ * - 调用 {@link #VeLivePusher#stopVideoCapture stopVideoCapture:} 关闭内部采集后,设置的曝光点失效。
150
+ * @order 60
151
+ */
152
+ setExposurePosition(position: CGPoint): int;
153
+ /** {zh}
154
+ * @detail api
155
+ * @brief 设置当前使用的摄像头的曝光补偿。
156
+ * @return <br>
157
+ * - =0:设置成功;
158
+ * - ≠0:设置失败。
159
+ * @notes <br>
160
+ * - 必须已调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 使用 SDK 内部采集模块进行视频采集时,才能设置曝光补偿。
161
+ * - 调用 {@link #VeLivePusher#stopVideoCapture stopVideoCapture:} 关闭内部采集后,设置的曝光补偿失效。
162
+ * @order 61
163
+ * @param value 曝光补偿值,取值范围 [[getMinExposureCompensation](155318#VeLiveCameraDevice-getminexposurecompensation), [getMaxExposureCompensation](155318#VeLiveCameraDevice-getmaxexposurecompensation)],0 为系统默认值表示没有曝光补偿。
164
+ */
165
+ setExposureCompensation(value: float): int;
166
+ /** {zh}
167
+ * @detail api
168
+ * @brief 获取摄像头的最小曝光补偿。
169
+ * @return <br>
170
+ * - ≤0:表示不支持曝光补偿;
171
+ * - >0:支持曝光补偿,数值表示最小曝光补偿。
172
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
173
+ * @order 62
174
+ */
175
+ getMinExposureCompensation(): float;
176
+ /** {zh}
177
+ * @detail api
178
+ * @brief 获取摄像头的最大曝光补偿。
179
+ * @return <br>
180
+ * - ≤0:表示不支持曝光补偿;
181
+ * - >0:支持曝光补偿,数值表示最大曝光补偿。
182
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
183
+ * @order 63
184
+ */
185
+ getMaxExposureCompensation(): float;
186
+ /** {zh}
187
+ * @detail api
188
+ * @brief 设置相机参数。
189
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
190
+ * @order 64
191
+ * @param parameter 相机参数字典,包含要设置的参数名称(键)和对应的值
192
+ */
193
+ setParameter(parameter: NSDictionary): void;
194
+ /** {zh}
195
+ * @detail api
196
+ * @brief 获取相机参数。
197
+ * @return <br>
198
+ * 相机参数的值,具体类型需要根据参数名称确定。
199
+ * @notes <br>需要在调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 启动相机采集后,调用本方法。
200
+ * @order 65
201
+ * @param key 需要获取的相机参数的名称。
202
+ */
203
+ getParameter(key: NSString): id;
204
+ }
205
+ export declare class VeLiveMediaPlayer {
206
+ init(): this;
207
+ /** {zh}
208
+ * @detail api
209
+ * @brief 设置文件路径。支持的文件格式包括 MP3、AAC、M4A、WAV。
210
+ * @return <br>
211
+ * - 0:成功;
212
+ * - ≠0:失败。
213
+ * @order 87
214
+ * @param url 文件路径。
215
+ */
216
+ prepare(url: NSString): int;
217
+ /** {zh}
218
+ * @detail api
219
+ * @brief 销毁播放器实例。
220
+ * @order 88
221
+ */
222
+ destroy(): void;
223
+ /** {zh}
224
+ * @detail api
225
+ * @brief 设置播放状态的监听。
226
+ * @notes <br>
227
+ * 重复调用本方法,仅最后一次调用生效。
228
+ * @order 89
229
+ * @param listener 播放状态监听。详情请参见 [VeLiveMediaPlayerListener](155319#VeLiveMediaPlayerListener)。
230
+ */
231
+ setListener(listener: id<VeLiveMediaPlayerListener>): void;
232
+ /** {zh}
233
+ * @detail api
234
+ * @brief 设置音视频帧回调的监听。
235
+ * @notes <br>
236
+ * 重复调用本方法,仅最后一次调用生效。
237
+ * @order 90
238
+ * @param listener 音视频帧回调监听。详情请参见 [VeLiveMediaPlayerFrameListener](155319#VeLiveMediaPlayerFrameListener)。
239
+ */
240
+ setFrameListener(listener: id<VeLiveMediaPlayerFrameListener>): void;
241
+ /** {zh}
242
+ * @detail api
243
+ * @brief 开启/关闭音频是否混音到直播流。
244
+ * @param enable 开启/关闭,默认为 NO。 <br>
245
+ * - YES:开启;
246
+ * - NO:关闭。
247
+ * @order 91
248
+ */
249
+ enableMixer(enable: BOOL): void;
250
+ /** {zh}
251
+ * @detail api
252
+ * @brief 开启/关闭自动音量均衡。
253
+ * @order 92
254
+ * @param sourceLufs 源响度。
255
+ * @param targetLufs 目标响度。
256
+ */
257
+ enableAutoEq(sourceLufs: float, targetLufs: float): void;
258
+ /** {zh}
259
+ * @detail api
260
+ * @brief 支持 MP4 格式的视频渲染。
261
+ * @param view 渲染视图。
262
+ * @order 93
263
+ */
264
+ setRenderView(view: UIView): void;
265
+ /** {zh}
266
+ * @detail api
267
+ * @brief 设置是否循环播放。
268
+ * @param enable 是否循环播放。默认为 NO。<br>
269
+ * - YES:循环播放;
270
+ * - NO:不循环播放。
271
+ * @order 95
272
+ */
273
+ enableBGMLoop(enable: BOOL): void;
274
+ /** {zh}
275
+ * @detail api
276
+ * @brief 开始播放。
277
+ * @return <br>
278
+ * - 0:成功;
279
+ * - ≠0:失败。
280
+ * @notes <br>
281
+ * - 需要在调用 {@link #VeLiveMediaPlayer#prepare prepare:} 设置文件路径后,调用本方法;
282
+ * - 此方法为异步操作。当 SDK 收到开始播放 {@link #VeLiveMediaPlayerListener#onStart onStart} 的回调后,开始播放。
283
+ * @order 94
284
+ */
285
+ start(): Promise<int>;
286
+ /** {zh}
287
+ * @detail api
288
+ * @brief 停止播放。
289
+ * @return <br>
290
+ * - 0:成功;
291
+ * - ≠0:失败。
292
+ * @notes <br>
293
+ * 需要在调用 {@link #start start} 开始播放后,调用本方法。
294
+ * @order 97
295
+ */
296
+ stop(): Promise<int>;
297
+ /** {zh}
298
+ * @detail api
299
+ * @brief 暂停播放。
300
+ * @notes <br>
301
+ * 需要在调用 {@link #start start} 开始播放后,调用本方法。
302
+ * @order 98
303
+ */
304
+ pause(): Promise<void>;
305
+ /** {zh}
306
+ * @detail api
307
+ * @brief 恢复播放。
308
+ * @notes <br>
309
+ * 需要在调用 {@link #pause pause} 暂停播放后,调用本方法。
310
+ * @order 99
311
+ */
312
+ resume(): Promise<void>;
313
+ /** {zh}
314
+ * @detail api
315
+ * @brief 设置播放进度。
316
+ * @return <br>
317
+ * - 0:成功;
318
+ * - ≠0:失败。
319
+ * @order 100
320
+ * @param pos 播放时间,单位为 ms。
321
+ */
322
+ seek(pos: long): int;
323
+ /** {zh}
324
+ * @detail api
325
+ * @brief 获取文件的总时长,单位为 ms。
326
+ * @return <br>
327
+ * - >0:成功,音频文件时长;
328
+ * - ≤0:失败。
329
+ * @notes <br>
330
+ * 需要在调用 {@link #start start} 开始播放后,调用本方法。
331
+ * @order 101
332
+ */
333
+ getDuration(): long;
334
+ /** {zh}
335
+ * @detail api
336
+ * @brief 设置播放音频的音量。
337
+ * @order 102
338
+ * @param volume 播放音频音量,取值范围为 [0.0,4.0]。
339
+ */
340
+ setBGMVolume(volume: float): void;
341
+ /** {zh}
342
+ * @detail api
343
+ * @brief 设置音频采集音量。
344
+ * @notes <br>
345
+ * 需要在调用 {@link #start start} 开始播放背景音乐后,调用本方法。
346
+ * @order 103
347
+ * @param volume 音频采集音量,取值范围为 [0.0,4.0]。
348
+ */
349
+ setVoiceVolume(volume: float): void;
350
+ }
351
+ export declare class VeLiveAudioDevice {
352
+ init(): this;
353
+ /** {zh}
354
+ * @detail api
355
+ * @brief 设置音量响度。
356
+ * @order 60
357
+ * @param level 音量响度等级,取值范围为 [0.0,4.0]。
358
+ */
359
+ setVoiceLoudness(level: float): void;
360
+ /** {zh}
361
+ * @detail api
362
+ * @brief 获取当前音量响度。
363
+ * @return <br>
364
+ * 当前音量响度等级。
365
+ * @order 61
366
+ */
367
+ getVoiceLoudness(): float;
368
+ /** {zh}
369
+ * @detail api
370
+ * @brief 查询是否支持硬件耳返。
371
+ * @return <br>
372
+ * - YES:支持;
373
+ * - NO:不支持。
374
+ * @order 62
375
+ */
376
+ isSupportHardwareEcho(): BOOL;
377
+ /** {zh}
378
+ * @detail api
379
+ * @brief 是否开启耳返功能。
380
+ * @param enable 耳返功能开关。默认值为 NO。<br>
381
+ * - YES:开启;
382
+ * - NO:关闭。
383
+ * @notes <br>
384
+ * 需要在调用 {@link #VeLivePusher#startAudioCapture startAudioCapture:} 启动音频采集后,调用本方法。
385
+ * @order 64
386
+ */
387
+ enableEcho(enable: BOOL): void;
388
+ /** {zh}
389
+ * @detail api
390
+ * @brief 获取当前耳返开启状态。
391
+ * @return <br>
392
+ * - YES:开启;
393
+ * - NO:关闭。
394
+ * @notes <br>
395
+ * 需要在调用 {@link #VeLivePusher#startAudioCapture startAudioCapture:} 启动音频采集后,调用本方法。
396
+ * @order 65
397
+ */
398
+ isEnableEcho(): BOOL;
399
+ }
400
+ export declare class VeLiveMixerManager {
401
+ init(): this;
402
+ /** {zh}
403
+ * @detail api
404
+ * @brief 添加一路需要混流的视频流到混流器中。
405
+ * @return <br>
406
+ * 视频流 ID。
407
+ * @order 65
408
+ */
409
+ addVideoStream(): int;
410
+ /** {zh}
411
+ * @detail api
412
+ * @brief 从混流器中移除一路非主路的视频流。
413
+ * @order 66
414
+ * @param streamId 需要移除的非主路视频流 ID。
415
+ */
416
+ removeVideoStream(streamId: int): void;
417
+ /** {zh}
418
+ * @detail api
419
+ * @brief 添加一路音频流到混流器中。
420
+ * @return <br>
421
+ * 音频流 ID。
422
+ * @order 67
423
+ */
424
+ addAudioStream(): int;
425
+ /** {zh}
426
+ * @detail api
427
+ * @brief 添加一路音频流到混流器中,并指定混流类型。
428
+ * @param type 混流类型,详情请参见 {@link #VeLiveAudioMixType VeLiveAudioMixType}
429
+ * @return <br>
430
+ * 音频流 ID。
431
+ * @order 68
432
+ */
433
+ addAudioStream_type(type: VeLiveAudioMixType): int;
434
+ /** {zh}
435
+ * @detail api
436
+ * @brief 从混流器中移除一路非主路的音频流。
437
+ * @order 69
438
+ * @param streamId 需要移除的非主路音频流 ID。
439
+ */
440
+ removeAudioStream(streamId: int): void;
441
+ /** {zh}
442
+ * @detail api
443
+ * @brief 设置指定混流音频的音量。当你将 {@link #VeLiveAudioMixType VeLiveAudioMixType} 设置为 `VeLiveAudioMixPlayAndPush` 时,该方法同时控制该路音频在拉流端和本地的播放音量。
444
+ * @order 70
445
+ * @param streamId 非主路音频流 ID。
446
+ * @param volume 音量大小,范围为 [0.0,4.0]。
447
+ */
448
+ setAudioStream(streamId: int, volume: float): void;
449
+ /** {zh}
450
+ * @detail api
451
+ * @brief 获取主路视频流 ID。
452
+ * @order 71
453
+ */
454
+ getOriginVideoStream(): int;
455
+ /** {zh}
456
+ * @detail api
457
+ * @brief 获取主路音频流 ID。
458
+ * @order 72
459
+ */
460
+ getOriginAudioStream(): int;
461
+ /** {zh}
462
+ * @detail api
463
+ * @brief 获取屏幕推流App音频流 ID。
464
+ */
465
+ getAppAudioStream(): int;
466
+ /** {zh}
467
+ * @detail api
468
+ * @order 73
469
+ * @brief 发送指定混流 ID 的自定义视频帧数据。
470
+ * @param frame 自定义的视频帧,详情请参见 [VeLiveVideoFrame](155321#VeLiveVideoFrame)。
471
+ * @param streamId 需要混流的视频流 ID。
472
+ */
473
+ sendCustomVideoFrame(frame: VeLiveVideoFrame, streamId: int): void;
474
+ /** {zh}
475
+ * @detail api
476
+ * @order 74
477
+ * @brief 发送指定混流 ID 的自定义音频帧数据。
478
+ * @param frame 自定义的音频帧,详情请参见 [VeLiveAudioFrame](155321#VeLiveAudioFrame)。
479
+ * @param streamId 混流的音频流 ID。
480
+ */
481
+ sendCustomAudioFrame(frame: VeLiveAudioFrame, streamId: int): void;
482
+ /** {zh}
483
+ * @detail api
484
+ * @brief 更新音视频混流的布局。
485
+ * @order 75
486
+ * @param mixDescription 新的音视频混流布局,详情请参见 [VeLiveStreamMixDescription](155321#VeLiveStreamMixDescription)。
487
+ */
488
+ updateStreamMixDescription(mixDescription: VeLiveStreamMixDescription): void;
489
+ }
490
+ export declare class VeLivePusher {
491
+ /** {zh}
492
+ * @detail api
493
+ * @hidden
494
+ * @brief 获取当前 SDK 版本号。
495
+ * @return <br>
496
+ * 当前 SDK 版本号。
497
+ * @order 47
498
+ */
499
+ static getVersion(): NSString;
500
+ /** {zh}
501
+ * @hidden
502
+ * @detail api
503
+ * @brief 设置打印日志的级别。
504
+ * @param logConfig 日志级别,默认值为 `VeLivePusherLogLevelInfo`。详情请参见 [VeLivePusherLogLevel](155321#VeLivePusherLogLevel)。
505
+ */
506
+ static setLogConfig(logConfig: VeLivePusherLogConfig): BOOL;
507
+ /** {zh}
508
+ * @detail api
509
+ * @brief 设置输出到控制台的日志等级。
510
+ * @order 48
511
+ * @param level 输出的日志级别,默认值为 `VeLivePusherLogLevelNone`,表示关闭日志。级别详情请参见 [VeLivePusherLogLevel](155321#VeLivePusherLogLevel)。
512
+ */
513
+ static setLogLevel(level: VeLivePusherLogLevel): void;
514
+ /** {zh}
515
+ * @detail api
516
+ * @param applicationGroupIdentifier iOS app group 标识符。
517
+ * @brief 开启屏幕采集。
518
+ */
519
+ startScreenCapture(applicationGroupIdentifier: NSString): void;
520
+ /** {zh}
521
+ * @detail api
522
+ * @brief 关闭屏幕采集。
523
+ */
524
+ stopScreenCapture(): void;
525
+ /** {zh}
526
+ * @detail api
527
+ * @brief 初始化推流器。
528
+ * @order 0
529
+ * @param config 推流配置类。详细信息请参见 [VeLivePusherConfiguration](155321#VeLivePusherConfiguration)。
530
+ */
531
+ initWithConfig(config: VeLivePusherConfiguration): this;
532
+ /** {zh}
533
+ * @detail api
534
+ * @brief 停止采集和推流,并销毁推流器。通常在调用 {@link #VeLivePusher#stopPush stopPush} 结束推流后调用此方法进行清理。
535
+ * @order 2
536
+ */
537
+ destroy(): void;
538
+ /** {zh}
539
+ * @detail api
540
+ * @brief 设置推流器回调,通过设置回调,监听推流器的推流错误、状态、网络质量、设备、首帧等回调事件。
541
+ * @notes <br>
542
+ * - 需要在创建推流引擎后,调用本方法;
543
+ * - 重复调用本方法,仅最后一次调用生效。
544
+ * @order 2
545
+ * @param observer 推流器回调对象,详细信息请参见 [VeLivePusherObserver](155319#VeLivePusherObserver)。
546
+ */
547
+ setObserver(observer: id<VeLivePusherObserver>): void;
548
+ /** {zh}
549
+ * @detail api
550
+ * @brief 设置推流器周期性回调,用于定期获取推流状态信息。
551
+ * @notes <br>
552
+ * - 需要在创建推流引擎后,调用本方法;
553
+ * - 重复调用本方法,仅最后一次调用生效。
554
+ * @order 3
555
+ * @param observer 推流器周期性回调对象,详细信息请参见 [VeLivePusherStatisticsObserver](155319#VeLivePusherStatisticsObserver)。
556
+ * @param interval 周期性回调的时间间隔,单位为 s,默认值为 5。
557
+ */
558
+ setStatisticsObserver(observer: id<VeLivePusherStatisticsObserver>, interval: int): void;
559
+ /** {zh}
560
+ * @detail api
561
+ * @brief 添加视频帧的监听回调,用于获取推流器输出的视频帧。
562
+ * @return <br>
563
+ * - 0:成功;
564
+ * - ≠0:失败。
565
+ * @order 4
566
+ * @param listener 视频帧的监听回调,详细信息请参见 [VeLiveVideoFrameListener](155319#VeLiveVideoFrameListener)。
567
+ */
568
+ addVideoFrameListener(listener: id<VeLiveVideoFrameListener>): int;
569
+ /** {zh}
570
+ * @detail api
571
+ * @brief 移除已添加的视频帧监听回调。
572
+ * @return <br>
573
+ * - 0:成功;
574
+ * - <0:失败。
575
+ * @notes <br>
576
+ * 如果没有添加过此监听回调或者监听回调已被移除,调用此方法将返回失败。
577
+ * @order 5
578
+ * @param listener 视频帧的监听回调,详细信息请参见 [VeLiveVideoFrameListener](155319#VeLiveVideoFrameListener)。
579
+ */
580
+ removeVideoFrameListener(listener: id<VeLiveVideoFrameListener>): int;
581
+ /** {zh}
582
+ * @detail api
583
+ * @brief 添加音频帧的监听回调,用于获取推流器输出的音频帧。
584
+ * @return <br>
585
+ * - 0:成功;
586
+ * - <0:失败。
587
+ * @order 6
588
+ * @param listener 音频帧监听回调,详细信息请参见 [VeLiveAudioFrameListener](155319#VeLiveAudioFrameListener)。
589
+ */
590
+ addAudioFrameListener(listener: id<VeLiveAudioFrameListener>): int;
591
+ /** {zh}
592
+ * @detail api
593
+ * @brief 移除已添加的音频帧监听回调。
594
+ * @return <br>
595
+ * - 0:成功;
596
+ * - <0:失败。
597
+ * @notes <br>
598
+ * 如果没有添加过此监听回调或者监听回调已被移除,调用此方法将返回失败。
599
+ * @order 7
600
+ * @param listener 音频帧的监听回调,详细信息请参见 [VeLiveAudioFrameListener](155319#VeLiveAudioFrameListener)。
601
+ */
602
+ removeAudioFrameListener(listener: id<VeLiveAudioFrameListener>): int;
603
+ /** {zh}
604
+ * @detail api
605
+ * @brief 添加屏幕采集的监听。
606
+ * @return <br>
607
+ * - 0:成功;
608
+ * - <0:失败。
609
+ * @notes <br>
610
+ * 如果没有添加过此监听回调或者监听回调已被移除,调用此方法将返回失败。
611
+ * @param listener 屏幕采集事件监听回调,详细信息请参见 {@link #VeLiveScreenCaptureStatusObserver VeLiveScreenCaptureStatusObserver}
612
+ * @param observer 录屏推流事件监听器。详情见 [VeLiveScreenCaptureStatusObserver](155319#VeLiveScreenCaptureStatusObserver)。
613
+ */
614
+ setScreenCaptureObserver(observer: id<VeLiveScreenCaptureStatusObserver>): int;
615
+ /** {zh}
616
+ * @detail api
617
+ * @brief 设置本地预览视图。如您对采集到的画面进行了美颜等处理,View 中显示的是美颜后的画面。
618
+ * @order 8
619
+ * @param view 本地预览视图。
620
+ */
621
+ setRenderView(view: UIView): Promise<void>;
622
+ /** {zh}
623
+ * @detail api
624
+ * @order 94
625
+ * @brief 设置本地预览填充模式。
626
+ * @param fillMode 本地预览填充模式,默认值为 VeLivePusherRenderModeFill,即视频帧自适应画布的填充模式,详细信息请参见 [VeLivePusherRenderMode](155321#VeLivePusherRenderMode)。
627
+ */
628
+ setRenderFillMode(fillMode: VeLivePusherRenderMode): void;
629
+ /** {zh}
630
+ * @detail api
631
+ * @brief 开启/关闭镜像。
632
+ * @notes <br>
633
+ * 该方法可用于配置预览和推流画面是否镜像。
634
+ * @order 9
635
+ * @param type 镜像类型,详细信息请参见 [VeLiveVideoMirrorType](155321#VeLiveVideoMirrorType)。
636
+ * @param enable 是否开启镜像。<br>
637
+ * - YES:开启;
638
+ * - NO:关闭。
639
+ */
640
+ setVideoMirror(type: VeLiveVideoMirrorType, enable: BOOL): void;
641
+ /** {zh}
642
+ * @detail api
643
+ * @brief 开始推流。
644
+ * @order 10
645
+ * @param url 推流地址,用于将直播流推送到目标服务器。
646
+ */
647
+ startPush(url: NSString): void;
648
+ /** {zh}
649
+ * @detail api
650
+ * @brief 开始推流,支持备用推流地址。
651
+ * @notes <br>
652
+ * 当数组中第一个推流地址不可用时,会自动切换到后面的备用推流地址继续推流。
653
+ * @order 11
654
+ * @param urls 推流地址列表,包含一个或多个推流地址。
655
+ */
656
+ startPushWithUrls(urls: NSArray<NSString>): void;
657
+ /** {zh}
658
+ * @detail api
659
+ * @brief 停止推流。
660
+ * @notes <br>
661
+ * 停止推流后,可以通过调用 {@link #VeLivePusher#startPush startPush:} 或 {@link #VeLivePusher#startPushWithUrls startPushWithUrls:} 方法重新开始推流。
662
+ * @order 15
663
+ */
664
+ stopPush(): void;
665
+ /** {zh}
666
+ * @detail api
667
+ * @brief 当前是否正在推流中,可用来查询推流器的当前状态。
668
+ * @return <br>
669
+ * 是否正在推流。<br>
670
+ * - YES:正在推流中;
671
+ * - NO:已经停止推流。
672
+ * @order 13
673
+ */
674
+ isPushing(): BOOL;
675
+ /** {zh}
676
+ * @detail api
677
+ * @brief 开始视频采集。
678
+ * @notes <br>
679
+ * 调用该接口后,可以通过调用接口 {@link #VeLivePusher#stopVideoCapture stopVideoCapture} 停止视频采集。
680
+ * @order 17
681
+ * @param type 视频采集类型,详细信息请参见 [VeLiveVideoCaptureType](155321#VeLiveVideoCaptureType)。
682
+ */
683
+ startVideoCapture(type: VeLiveVideoCaptureType): void;
684
+ /** {zh}
685
+ * @detail api
686
+ * @brief 停止视频采集。
687
+ * @notes <br>调用该接口后,可以通过调用接口 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 开始视频采集。
688
+ * @order 18
689
+ */
690
+ stopVideoCapture(): void;
691
+ /** {zh}
692
+ * @detail api
693
+ * @brief 切换视频采集类型。
694
+ * @notes <br>该接口必须在调用接口 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 后调用才能生效。
695
+ * @order 19
696
+ * @param type 视频采集类型,详细信息请参见 [VeLiveVideoCaptureType](155321#VeLiveVideoCaptureType)。
697
+ */
698
+ switchVideoCapture(type: VeLiveVideoCaptureType): void;
699
+ /** {zh}
700
+ * @detail api
701
+ * @brief 开始音频采集。
702
+ * @notes <br>
703
+ * 调用该接口后,可以通过调用接口 {@link #VeLivePusher#stopAudioCapture stopAudioCapture} 停止音频采集。
704
+ * @order 20
705
+ * @param type 音频采集类型,详细信息请参见 [VeLiveAudioCaptureType](155321#VeLiveAudioCaptureType)。
706
+ */
707
+ startAudioCapture(type: VeLiveAudioCaptureType): void;
708
+ /** {zh}
709
+ * @detail api
710
+ * @brief 停止音频采集。
711
+ * @notes <br>
712
+ * 调用该接口后,可以通过调用接口 {@link #VeLivePusher#startAudioCapture startAudioCapture:} 开始音频采集。
713
+ * @order 21
714
+ */
715
+ stopAudioCapture(): void;
716
+ /** {zh}
717
+ * @detail api
718
+ * @brief 切换音频采集类型。
719
+ * @notes <br>
720
+ * 该接口必须在调用接口 {@link #VeLivePusher#startAudioCapture startAudioCapture:} 后调用才能生效。
721
+ * @order 22
722
+ * @param type 音频采集类型,详细信息请参见 [VeLiveAudioCaptureType](155321#VeLiveAudioCaptureType)。
723
+ */
724
+ switchAudioCapture(type: VeLiveAudioCaptureType): void;
725
+ /** {zh}
726
+ * @detail api
727
+ * @brief 获取当前视频采集类型。
728
+ * @return <br>
729
+ * 视频采集类型,详细信息请参见 {@link #VeLiveVideoCaptureType VeLiveVideoCaptureType}。
730
+ * @order 20
731
+ */
732
+ getCurrentVideoCaptureType(): VeLiveVideoCaptureType;
733
+ /** {zh}
734
+ * @detail api
735
+ * @brief 获取当前音频采集类型。
736
+ * @return <br>
737
+ * 音频采集类型,详细信息请参见 {@link #VeLiveAudioCaptureType VeLiveAudioCaptureType}。
738
+ * @order 21
739
+ */
740
+ getCurrentAudioCaptureType(): VeLiveAudioCaptureType;
741
+ /** {zh}
742
+ * @detail api
743
+ * @brief 自定义静态图,适用于静态图推流采集类型。
744
+ * @notes <br>使用该接口时,需要将视频采集类型设置为 VeLiveVideoCaptureCustomImage,您可调用 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 方法,将 [VeLiveVideoCaptureType](155321#VeLiveVideoCaptureType) 设置为 VeLiveVideoCaptureCustomImage。
745
+ * @order 25
746
+ * @param image 静态图片,用于在静态图推流采集类型下设置静态图。
747
+ */
748
+ updateCustomImage(image: UIImage): Promise<void>;
749
+ /** {zh}
750
+ * @detail api
751
+ * @brief 设置静音。
752
+ * @param mute 是否设置为静音。默认为 NO。<br>
753
+ * - YES:静音推流;
754
+ * - NO:正常推流。
755
+ * @order 23
756
+ */
757
+ setMute(mute: BOOL): void;
758
+ /** {zh}
759
+ * @detail api
760
+ * @brief 当前是否是静音状态。
761
+ * @return <br>
762
+ * - YES:当前是静音状态;
763
+ * - NO:当前非静音状态。
764
+ * @order 24
765
+ */
766
+ isMute(): BOOL;
767
+ /** {zh}
768
+ * @detail api
769
+ * @brief 设置推流视频编码参数。
770
+ * @notes <br>
771
+ * 该接口可在推流开始前或开始后调用。
772
+ * @order 25
773
+ * @param config 推流视频参数,支持设置推流视频分辨率、编码格式、目标码率和视频 GOP 大小等信息。详情请参见 [VeLiveVideoEncoderConfiguration](155321#VeLiveVideoEncoderConfiguration)。
774
+ */
775
+ setVideoEncoderConfiguration(config: VeLiveVideoEncoderConfiguration): void;
776
+ /** {zh}
777
+ * @detail api
778
+ * @brief 设置推流音频编码参数。
779
+ * @notes <br>
780
+ * 该接口需要在 {@link #VeLivePusher#startPush startPush:} 或 {@link #VeLivePusher#startPushWithUrls startPushWithUrls:} 方法之前调用。
781
+ * @order 29
782
+ * @param config 推流音频编码参数,详情请参见 [VeLiveAudioEncoderConfiguration](155321#VeLiveAudioEncoderConfiguration)。
783
+ */
784
+ setAudioEncoderConfiguration(config: VeLiveAudioEncoderConfiguration): void;
785
+ /** {zh}
786
+ * @detail api
787
+ * @brief 开始本地文件录制。
788
+ * @order 27
789
+ * @param path 录制文件保存路径,不能为空。
790
+ * @param config 文件录制设置,详情请参见 [VeLiveFileRecorderConfiguration](155321#VeLiveFileRecorderConfiguration)。
791
+ * @param listener 本地文件录制的监听,详情请参见 [VeLiveFileRecordingListener](155319#VeLiveFileRecordingListener)。
792
+ */
793
+ startFileRecording(path: NSString, config: VeLiveFileRecorderConfiguration, listener: id<VeLiveFileRecordingListener>): void;
794
+ /** {zh}
795
+ * @detail api
796
+ * @brief 停止本地文件录制。
797
+ * @notes <br>该接口需要在 [startFileRecording](#VeLivePusher-startfilerecording-config-listener) 方法之后调用。
798
+ * @order 28
799
+ */
800
+ stopFileRecording(): void;
801
+ /** {zh}
802
+ * @detail api
803
+ * @brief 获取相机设备管理对象 `VeLiveCameraDevice`。通过设备管理,您可以使用以下功能。
804
+ * - 控制闪光灯开关
805
+ * - 设置摄像头缩放比例
806
+ * - 设置自动对焦
807
+ * @return <br>
808
+ * 相机设备管理对象 {@link #VeLiveCameraDevice VeLiveCameraDevice}。
809
+ * @notes <br>该接口需要在 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 方法中设置 [VeLiveVideoCaptureType](155321#VeLiveVideoCaptureType) 为 VeLiveVideoCaptureFrontCamera 或 VeLiveVideoCaptureBackCamera。
810
+ * @order 32
811
+ */
812
+ getCameraDevice(): VeLiveCameraDevice;
813
+ /** {zh}
814
+ * @detail api
815
+ * @brief 获取音频模块管理对象。
816
+ * @return <br>
817
+ * 音频模块管理对象 {@link #VeLiveAudioDevice VeLiveAudioDevice}。
818
+ * @notes <br>
819
+ * 该接口需要在 {@link #VeLivePusher#startAudioCapture startAudioCapture:} 方法中设置 {@link #VeLiveAudioCaptureType VeLiveAudioCaptureType} 为 VeLiveAudioCaptureMicrophone。
820
+ * @order 33
821
+ */
822
+ getAudioDevice(): VeLiveAudioDevice;
823
+ /** {zh}
824
+ * @detail api
825
+ * @brief 获取混流管理对象。
826
+ * @return <br>
827
+ * 混流管理对象 {@link #VeLiveMixerManager VeLiveMixerManager}。
828
+ * @order 31
829
+ */
830
+ getMixerManager(): VeLiveMixerManager;
831
+ /** {zh}
832
+ * @detail api
833
+ * @brief 获取视频特效管理对象 `VeLiveVideoEffectManager`。通过视频特效管理,您可以使用以下功能。
834
+ * - 设置美颜
835
+ * - 设置特效
836
+ * - 设置素材
837
+ * - 设置贴纸
838
+ * - 设置滤镜
839
+ * @return <br>
840
+ * 视频特效管理对象 {@link #VeLiveVideoEffectManager VeLiveVideoEffectManager}。
841
+ * @notes <br>
842
+ * 该接口需要集成美颜特效 CV SDK 后才能使用。
843
+ * @order 32
844
+ */
845
+ getVideoEffectManager(): VeLiveVideoEffectManager;
846
+ /** {zh}
847
+ * @detail api
848
+ * @brief 创建播放器。
849
+ * @return <br>
850
+ * 播放器管理对象 {@link #VeLiveMediaPlayer VeLiveMediaPlayer}。
851
+ * @order 33
852
+ */
853
+ createPlayer(): VeLiveMediaPlayer;
854
+ /** {zh}
855
+ * @detail api
856
+ * @brief 自定义视频处理。
857
+ * @param filter 视频帧滤镜对象 {@link #VeLiveVideoFrameFilter VeLiveVideoFrameFilter}。
858
+ * @order 34
859
+ */
860
+ setVideoFrameFilter(filter: id<VeLiveVideoFrameFilter>): void;
861
+ /** {zh}
862
+ * @detail api
863
+ * @brief 自定义音频处理。
864
+ * @param filter 音频帧滤镜对象 {@link #VeLiveAudioFrameFilter VeLiveAudioFrameFilter}。
865
+ * @order 35
866
+ */
867
+ setAudioFrameFilter(filter: id<VeLiveAudioFrameFilter>): void;
868
+ /** {zh}
869
+ * @detail api
870
+ * @brief 设置推流视频帧朝向。默认为竖屏推流。
871
+ * @param orientation 视频帧朝向。
872
+ */
873
+ setOrientation(orientation: UIInterfaceOrientation): void;
874
+ /** {zh}
875
+ * @detail api
876
+ * @brief 设置推流水印。
877
+ * @return <br>
878
+ * - 0:水印设置成功;
879
+ * - <0:水印设置失败。
880
+ * @order 37
881
+ * @param image 水印图片。取值为 null 时,表示禁用水印。
882
+ * @param x 水印的水平偏移量,即水印图片相对视频流左上角的横向偏移与视频流宽度的比值,取值范围为 [0.0,1.0]。
883
+ * @param y 水印的垂直偏移量,即水印图片相对视频流左上角的纵向偏移与视频流高度的比值,取值范围为 [0.0,1.0]。
884
+ * @param scale 水印图片的缩放比例,取值范围为 [0.0,1.0]。
885
+ */
886
+ setWatermark(image: UIImage, x: float, y: float, scale: float): Promise<int>;
887
+ /** {zh}
888
+ * @detail api
889
+ * @brief 视频截图。
890
+ * @order 38
891
+ * @param listener 截图监听对象,详情请参见 [VeLiveSnapshotListener](155319#VeLiveSnapshotListener)。
892
+ */
893
+ snapshot(listener: id<VeLiveSnapshotListener>): void;
894
+ /** {zh}
895
+ * @detail api
896
+ * @brief 通过视频帧发送 SEI 消息。
897
+ * @return <br>
898
+ * - 0:成功;
899
+ * - <0:失败。
900
+ * @notes <br>
901
+ * 该接口需要在调用 {@link #VeLivePusher#startPush startPush:} 或 {@link #VeLivePusher#startPushWithUrls startPushWithUrls:} 方法之后调用。
902
+ * @order 42
903
+ * @param key SEI 消息为 JSON 格式的字符串。此参数为 JSON 结构中的 Key。
904
+ * @param value SEI 消息为 JSON 格式的字符串。此参数为 JSON 结构中的 Value。
905
+ * @param repeat 消息发送重复的次数。例如,`repeat` 取值为 20,`isKeyFrame` 取值为 YES,则会在调用该方法后连续 20 个关键帧中添加 SEI 消息。
906
+ * @param isKeyFrame 是否仅在关键帧中包含 SEI 消息。<br>
907
+ * - YES:仅在关键帧中包含;
908
+ * - NO:所有帧中均包含。
909
+ * @param allowsCovered 是否允许覆盖。<br>
910
+ * - YES:允许;
911
+ * - NO:不允许。
912
+ */
913
+ sendSeiMessage(key: NSString, value: id, repeat: int, isKeyFrame: BOOL, allowsCovered: BOOL): int;
914
+ /** {zh}
915
+ * @detail api
916
+ * @brief 推送外部视频帧数据。
917
+ * @return <br>
918
+ * - 0:成功;
919
+ * - <0:失败。
920
+ * @notes <br>该接口需要在 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 方法中设置 [VeLiveVideoCaptureType](155321#VeLiveVideoCaptureType) 为 VeLiveVideoCaptureExternal。
921
+ * @order 43
922
+ * @param frame 视频帧的数据信息,详情请参见 [VeLiveVideoFrame](155321#VeLiveVideoFrame)。
923
+ */
924
+ pushExternalVideoFrame(frame: VeLiveVideoFrame): int;
925
+ /** {zh}
926
+ * @detail api
927
+ * @brief 推送外部视频编码数据。
928
+ * @return <br>
929
+ * - 0:成功;
930
+ * - <0:失败。
931
+ * @notes <br>该接口需要在 {@link #VeLivePusher#startVideoCapture startVideoCapture:} 方法中设置 [VeLiveVideoCaptureType](155321#VeLiveVideoCaptureType) 为 VeLiveVideoCaptureFrontCamera 或 VeLiveVideoCaptureExternal。
932
+ * @order 44
933
+ * @param encodeFrame 视频编码帧的数据信息,详情请参见 [VeLiveVideoEncodeFrame](155321#VeLiveVideoEncodeFrame)。
934
+ */
935
+ pushExternalVideoEncodeFrame(encodeFrame: VeLiveVideoEncodeFrame): int;
936
+ /** {zh}
937
+ * @detail api
938
+ * @brief 推送外部音频帧数据。
939
+ * @return <br>
940
+ * - 0:成功;
941
+ * - <0:失败。
942
+ * @notes <br>
943
+ * 该接口需要在 {@link #VeLivePusher#startAudioCapture startAudioCapture:} 方法中设置 {@link #VeLiveAudioCaptureType VeLiveAudioCaptureType} 为 VeLiveAudioCaptureExternal。
944
+ * @order 45
945
+ * @param frame 外部音频数据。详情请参见 [VeLiveAudioFrame](155321#VeLiveAudioFrame)。
946
+ */
947
+ pushExternalAudioFrame(frame: VeLiveAudioFrame): int;
948
+ /** {zh}
949
+ * @detail api
950
+ * @brief 高级配置。
951
+ * @return <br>
952
+ * - 0:成功;
953
+ * - -1:失败,参数错误。
954
+ * @order 43
955
+ * @param key 推流高级配置为 JSON 格式的字符串,此参数为 JSON 结构中的 Key。您可通过提交工单联系[技术支持](https://console.volcengine.com/workorder/create?step=3&SubProductID=P00000076&FlowKey=iNcpuNlwBHbovcjeWlKP),了解配置方法。
956
+ * @param value 推流高级配置为 JSON 格式的字符串,此参数为 JSON 结构中的 Value。建议传入 NSDictionary 或者 NSString 对象。您可通过提交工单联系[技术支持](https://console.volcengine.com/workorder/create?step=3&SubProductID=P00000076&FlowKey=iNcpuNlwBHbovcjeWlKP),了解配置方法。
957
+ */
958
+ setProperty(key: NSString, value: id): int;
959
+ /** {zh}
960
+ * @detail api
961
+ * @brief 强制请求 IDR 帧,发起请求以编码一个新的 IDR 帧。
962
+ * @notes <br>
963
+ * 该接口需要在调用 {@link #VeLivePusher#startPush startPush:} 或 {@link #VeLivePusher#startPushWithUrls startPushWithUrls:} 方法之后调用。
964
+ * @order 47
965
+ */
966
+ requestIDRFrame(): void;
967
+ /** {zh}
968
+ * @detail api
969
+ * @brief 设置 opengl 的版本号,默认值为 `3`。
970
+ * @param version opengl 版本号,支持的取值包括 `2` 和 `3`,分别对应 OpenGL 2.0 和 3.0 版本。
971
+ * @order 45
972
+ */
973
+ setEGLVersion(version: int): void;
974
+ /** {zh}
975
+ * @detail api
976
+ * @brief 获取 EAGL 的上下文,这是在多线程环境下用于共享的上下文。
977
+ * @return <br>
978
+ * EAGL 的上下文。
979
+ * @order 46
980
+ */
981
+ getEGLContext(): EAGLContext;
982
+ }
983
+ export declare class VeLiveVideoEffectManager {
984
+ init(): this;
985
+ /** {zh}
986
+ * @detail api
987
+ * @brief 视频特效许可证配置,用于初始化视频特效管理对象。
988
+ * @return <br>
989
+ * - 0:调用成功;
990
+ * - -1:调用失败。
991
+ * @order 76
992
+ * @param config 特效初始化配置,详情请参见 [VeLiveVideoEffectLicenseConfiguration](155321#VeLiveVideoEffectLicenseConfiguration)。
993
+ */
994
+ setupWithConfig(config: VeLiveVideoEffectLicenseConfiguration): int;
995
+ /** {zh}
996
+ * @detail api
997
+ * @brief 更新在线 License。本方法仅对在线 License 有效。
998
+ * @notes <br>
999
+ * - 需要通过调用 {@link #VeLiveVideoEffectManager#setupWithConfig setupWithConfig:} 设置视频特效许可证后调用;
1000
+ * - 如果您使用在线 License 认证方式,在许可证过期后,可调用该方法更新 License;
1001
+ * - 本方法为异步操作。
1002
+ * @order 76
1003
+ * @param completion 结果回调信息。
1004
+ */
1005
+ updateLicense(completion: (result: number, message: string) => void): void;
1006
+ /** {zh}
1007
+ * @detail api
1008
+ * @brief 设置特效算法模型包的路径。
1009
+ * @return <br>
1010
+ * - 0:调用成功;
1011
+ * - -1:调用失败。
1012
+ * @notes <br>
1013
+ * 需要通过调用 {@link #VeLiveVideoEffectManager#setupWithConfig setupWithConfig:} 设置视频特效许可证后调用。
1014
+ * @order 77
1015
+ * @param path 特效算法模型包的路径。
1016
+ */
1017
+ setAlgoModelPath(path: NSString): int;
1018
+ /** {zh}
1019
+ * @detail api
1020
+ * @brief 创建/销毁特效引擎。
1021
+ * @return <br>
1022
+ * - 0:调用成功;
1023
+ * - -1:调用失败。
1024
+ * @notes <br>
1025
+ * - 该方法需要在调用 {@link #VeLiveVideoEffectManager#setupWithConfig setupWithConfig:} 和 {@link #VeLiveVideoEffectManager#setAlgoModelPath setAlgoModelPath:} 后调用;
1026
+ * - 该方法不直接开启/关闭视频特效,您需要在调用该方法后,调用 {@link #VeLiveVideoEffectManager#setComposeNodes setComposeNodes:} 开启视频特效;
1027
+ * - 通用场景下,特效引擎会随 EffectManager 销毁而销毁。如果您对性能有较高要求,也可以在不使用特效相关功能时,调用该方法销毁特效引擎;
1028
+ * - 如果重复创建/销毁特效引擎,会产生时间消耗。
1029
+ * @order 78
1030
+ * @param enable 是否创建特效引擎。默认为 NO。 <br>
1031
+ * - YES:创建;
1032
+ * - NO:销毁。
1033
+ */
1034
+ setEnable(enable: BOOL): int;
1035
+ /** {zh}
1036
+ * @detail api
1037
+ * @brief 设置视频特效组合。支持设置 ComposeMakeup.bundle 中的功能,包括美颜、美形、美体、美妆等。
1038
+ * @return <br>
1039
+ * - 0:调用成功;
1040
+ * - -1:调用失败。
1041
+ * @notes <br>
1042
+ * - 需要在调用 {@link #VeLiveVideoEffectManager#setEnable setEnable:} 创建特效引擎后,调用本方法;
1043
+ * - 重复调用本方法,仅最后一次调用生效;
1044
+ * - 如果需要在当前的视频特效组合中叠加特效,可调用 {@link #VeLiveVideoEffectManager#appendComposeNodes appendComposeNodes:} 方法。
1045
+ * @order 79
1046
+ * @param nodes 视频特效素材包路径数组。
1047
+ */
1048
+ setComposeNodes(nodes: NSArray<NSString>): int;
1049
+ /** {zh}
1050
+ * @detail api
1051
+ * @brief 在已有的视频特效组合上,叠加视频特效素材包。
1052
+ * @return <br>
1053
+ * - 0:调用成功;
1054
+ * - -1:调用失败。
1055
+ * @notes <br>
1056
+ * - 需要在调用 {@link #VeLiveVideoEffectManager#setEnable setEnable:} 创建特效引擎后,调用本方法。
1057
+ * - 调用本方法,会在 {@link #VeLiveVideoEffectManager#setComposeNodes setComposeNodes:} 设置的视频特效组合的基础上叠加特效。
1058
+ * @order 80
1059
+ * @param nodes 视频特效素材包路径数组。
1060
+ */
1061
+ appendComposeNodes(nodes: NSArray<NSString>): int;
1062
+ /** {zh}
1063
+ * @detail api
1064
+ * @brief 移除指定的视频特效资源。
1065
+ * @return <br>
1066
+ * - 0:调用成功;
1067
+ * - -1:调用失败。
1068
+ * @notes <br>
1069
+ * - 需要在调用 {@link #VeLiveVideoEffectManager#setEnable setEnable:} 创建特效引擎后,调用本方法。
1070
+ * - 调用本方法,可移除调用 {@link #VeLiveVideoEffectManager#setComposeNodes setComposeNodes:} 和 {@link #VeLiveVideoEffectManager#appendComposeNodes appendComposeNodes:} 设置的视频特效资源。
1071
+ * @order 81
1072
+ * @param nodes 视频特效素材包路径数组。
1073
+ */
1074
+ removeComposeNodes(nodes: NSArray<NSString>): int;
1075
+ /** {zh}
1076
+ * @detail api
1077
+ * @brief 设置视频特效强度。
1078
+ * @return <br>
1079
+ * - 0:调用成功;
1080
+ * - -1:调用失败。
1081
+ * @notes <br>
1082
+ * - 需要在调用 {@link #VeLiveVideoEffectManager#setComposeNodes setComposeNodes:} 设置视频特效组合或调用 {@link #VeLiveVideoEffectManager#appendComposeNodes appendComposeNodes:} 叠加视频特效素材包后,调用本方法;
1083
+ * - 该方法仅适用于同时含有上述三个参数的特效资源,对于没有强度参数的特效(如贴纸),该方法无效。
1084
+ * @order 82
1085
+ * @param node 视频特效素材包路径。
1086
+ * @param key 需要设置的素材 key 名称
1087
+ * @param intensity 需要设置的强度值。取值范围为 [0.0,1.0]。
1088
+ */
1089
+ updateComposerNodeIntensity(node: NSString, key: NSString, intensity: float): int;
1090
+ /** {zh}
1091
+ * @detail api
1092
+ * @brief 设置颜色滤镜。
1093
+ * @return <br>
1094
+ * - 0:调用成功;
1095
+ * - -1:调用失败。
1096
+ * @notes <br>请在调用 {@link #VeLiveVideoEffectManager#setEnable setEnable:} 开启视频特效后,调用该方法。
1097
+ * @order 83
1098
+ * @param path 滤镜资源包绝对路径。
1099
+ */
1100
+ setFilter(path: NSString): int;
1101
+ /** {zh}
1102
+ * @detail api
1103
+ * @brief 设置已启用的颜色滤镜强度。
1104
+ * @return <br>
1105
+ * - 0:调用成功;
1106
+ * - -1:调用失败。
1107
+ * @notes <br>
1108
+ * 请在调用 {@link #VeLiveVideoEffectManager#setFilter setFilter:} 设置颜色滤镜后调用。
1109
+ * @order 84
1110
+ * @param intensity 滤镜强度,取值范围为 [0.0,1.0]。
1111
+ */
1112
+ updateFilterIntensity(intensity: float): int;
1113
+ /** {zh}
1114
+ * @detail api
1115
+ * @brief 设置贴纸特效。
1116
+ * @return <br>
1117
+ * - 0:调用成功;
1118
+ * - -1:调用失败。
1119
+ * @notes <br>请在调用 {@link #VeLiveVideoEffectManager#setEnable setEnable:} 开启视频特效后,调用该方法。
1120
+ * @order 85
1121
+ * @param path 贴纸素材包的绝对路径。
1122
+ */
1123
+ setSticker(path: NSString): int;
1124
+ /** {zh}
1125
+ * @detail api
1126
+ * @brief 智能美化特效(简称 CV)高级接口。
1127
+ * @notes <br>请在调用 [setEnable:](155318#VeLiveVideoEffectManager-setenable) 开启视频特效后,调用该方法,不要在主线程中频繁执行同步操作。
1128
+ * @param callback 回调 CV 的 handle。
1129
+ * @param isGLThread 是否在 GL 线程回调 callback。
1130
+ * @param isAsync 是否同步执行 callback。
1131
+ */
1132
+ setAdvancedFeature(callback: (handle: void) => void, isGLThread: BOOL, isAsync: BOOL): void;
1133
+ }