agora-electron-sdk 0.0.0-dev.1

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 (369) hide show
  1. package/CHANGELOG.md +315 -0
  2. package/LICENSE +21 -0
  3. package/README.md +143 -0
  4. package/gulpfile.js +52 -0
  5. package/js/AgoraSdk.js +64 -0
  6. package/js/Decoder/gpu-utils.js +74 -0
  7. package/js/Decoder/index.js +172 -0
  8. package/js/Private/AgoraBase.js +3985 -0
  9. package/js/Private/AgoraMediaBase.js +1014 -0
  10. package/js/Private/AgoraMediaPlayerTypes.js +316 -0
  11. package/js/Private/IAgoraH265Transcoder.js +36 -0
  12. package/js/Private/IAgoraLog.js +78 -0
  13. package/js/Private/IAgoraMediaEngine.js +32 -0
  14. package/js/Private/IAgoraMediaPlayer.js +16 -0
  15. package/js/Private/IAgoraMediaPlayerSource.js +3 -0
  16. package/js/Private/IAgoraMediaRecorder.js +10 -0
  17. package/js/Private/IAgoraMediaStreamingSource.js +74 -0
  18. package/js/Private/IAgoraMusicContentCenter.js +157 -0
  19. package/js/Private/IAgoraRhythmPlayer.js +62 -0
  20. package/js/Private/IAgoraRtcEngine.js +982 -0
  21. package/js/Private/IAgoraRtcEngineEx.js +19 -0
  22. package/js/Private/IAgoraSpatialAudio.js +24 -0
  23. package/js/Private/IAudioDeviceManager.js +20 -0
  24. package/js/Private/extension/AgoraBaseExtension.js +3 -0
  25. package/js/Private/extension/AgoraMediaBaseExtension.js +2 -0
  26. package/js/Private/extension/AgoraMediaPlayerTypesExtension.js +2 -0
  27. package/js/Private/extension/IAgoraH265TranscoderExtension.js +2 -0
  28. package/js/Private/extension/IAgoraLogExtension.js +2 -0
  29. package/js/Private/extension/IAgoraMediaEngineExtension.js +2 -0
  30. package/js/Private/extension/IAgoraMediaPlayerExtension.js +2 -0
  31. package/js/Private/extension/IAgoraMediaPlayerSourceExtension.js +2 -0
  32. package/js/Private/extension/IAgoraMediaRecorderExtension.js +2 -0
  33. package/js/Private/extension/IAgoraMusicContentCenterExtension.js +2 -0
  34. package/js/Private/extension/IAgoraRhythmPlayerExtension.js +2 -0
  35. package/js/Private/extension/IAgoraRtcEngineExExtension.js +2 -0
  36. package/js/Private/extension/IAgoraRtcEngineExtension.js +2 -0
  37. package/js/Private/extension/IAgoraSpatialAudioExtension.js +2 -0
  38. package/js/Private/extension/IAudioDeviceManagerExtension.js +2 -0
  39. package/js/Private/impl/AgoraBaseImpl.js +23 -0
  40. package/js/Private/impl/AgoraMediaBaseImpl.js +149 -0
  41. package/js/Private/impl/IAgoraH265TranscoderImpl.js +116 -0
  42. package/js/Private/impl/IAgoraMediaEngineImpl.js +337 -0
  43. package/js/Private/impl/IAgoraMediaPlayerImpl.js +950 -0
  44. package/js/Private/impl/IAgoraMediaPlayerSourceImpl.js +73 -0
  45. package/js/Private/impl/IAgoraMediaRecorderImpl.js +47 -0
  46. package/js/Private/impl/IAgoraMusicContentCenterImpl.js +422 -0
  47. package/js/Private/impl/IAgoraRtcEngineExImpl.js +1042 -0
  48. package/js/Private/impl/IAgoraRtcEngineImpl.js +5167 -0
  49. package/js/Private/impl/IAgoraSpatialAudioImpl.js +358 -0
  50. package/js/Private/impl/IAudioDeviceManagerImpl.js +375 -0
  51. package/js/Private/internal/AgoraH265TranscoderInternal.js +62 -0
  52. package/js/Private/internal/AgoraMediaBaseInternal.js +15 -0
  53. package/js/Private/internal/AudioDeviceManagerInternal.js +44 -0
  54. package/js/Private/internal/IrisApiEngine.js +424 -0
  55. package/js/Private/internal/LocalSpatialAudioEngineInternal.js +7 -0
  56. package/js/Private/internal/MediaEngineInternal.js +122 -0
  57. package/js/Private/internal/MediaPlayerInternal.js +194 -0
  58. package/js/Private/internal/MediaRecorderInternal.js +70 -0
  59. package/js/Private/internal/MusicContentCenterInternal.js +139 -0
  60. package/js/Private/internal/RtcEngineExInternal.js +430 -0
  61. package/js/Private/ipc/main.js +21 -0
  62. package/js/Private/ipc/renderer.js +21 -0
  63. package/js/Private/ti/AgoraBase-ti.js +40 -0
  64. package/js/Private/ti/AgoraMediaBase-ti.js +75 -0
  65. package/js/Private/ti/AgoraMediaPlayerTypes-ti.js +5 -0
  66. package/js/Private/ti/IAgoraH265Transcoder-ti.js +40 -0
  67. package/js/Private/ti/IAgoraLog-ti.js +5 -0
  68. package/js/Private/ti/IAgoraMediaEngine-ti.js +5 -0
  69. package/js/Private/ti/IAgoraMediaPlayer-ti.js +38 -0
  70. package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +50 -0
  71. package/js/Private/ti/IAgoraMediaRecorder-ti.js +5 -0
  72. package/js/Private/ti/IAgoraMediaStreamingSource-ti.js +5 -0
  73. package/js/Private/ti/IAgoraMusicContentCenter-ti.js +42 -0
  74. package/js/Private/ti/IAgoraRhythmPlayer-ti.js +5 -0
  75. package/js/Private/ti/IAgoraRtcEngine-ti.js +141 -0
  76. package/js/Private/ti/IAgoraRtcEngineEx-ti.js +5 -0
  77. package/js/Private/ti/IAgoraSpatialAudio-ti.js +5 -0
  78. package/js/Private/ti/IAudioDeviceManager-ti.js +5 -0
  79. package/js/Renderer/AgoraView.js +161 -0
  80. package/js/Renderer/CapabilityManager.js +99 -0
  81. package/js/Renderer/IRenderer.js +136 -0
  82. package/js/Renderer/IRendererCache.js +75 -0
  83. package/js/Renderer/RendererCache.js +100 -0
  84. package/js/Renderer/RendererManager.js +301 -0
  85. package/js/Renderer/WebCodecsRenderer/index.js +109 -0
  86. package/js/Renderer/WebCodecsRendererCache.js +115 -0
  87. package/js/Renderer/WebGLRenderer/index.js +314 -0
  88. package/js/Renderer/WebGLRenderer/webgl-utils.js +1337 -0
  89. package/js/Renderer/YUVCanvasRenderer/index.js +46 -0
  90. package/js/Renderer/index.js +17 -0
  91. package/js/Types.js +67 -0
  92. package/js/Utils.js +187 -0
  93. package/package.json +167 -0
  94. package/scripts/bootstrap.js +29 -0
  95. package/scripts/build.js +37 -0
  96. package/scripts/buildJS.js +14 -0
  97. package/scripts/checkElectron.js +43 -0
  98. package/scripts/clean.js +16 -0
  99. package/scripts/download.js +105 -0
  100. package/scripts/downloadPrebuild.js +199 -0
  101. package/scripts/getConfig.js +73 -0
  102. package/scripts/logger.js +32 -0
  103. package/scripts/synclib.js +69 -0
  104. package/scripts/util.js +47 -0
  105. package/scripts/zipBuild.js +40 -0
  106. package/ts/AgoraSdk.ts +54 -0
  107. package/ts/Decoder/gpu-utils.ts +92 -0
  108. package/ts/Decoder/index.ts +206 -0
  109. package/ts/Private/AgoraBase.ts +5511 -0
  110. package/ts/Private/AgoraMediaBase.ts +1764 -0
  111. package/ts/Private/AgoraMediaPlayerTypes.ts +464 -0
  112. package/ts/Private/IAgoraH265Transcoder.ts +73 -0
  113. package/ts/Private/IAgoraLog.ts +91 -0
  114. package/ts/Private/IAgoraMediaEngine.ts +316 -0
  115. package/ts/Private/IAgoraMediaPlayer.ts +744 -0
  116. package/ts/Private/IAgoraMediaPlayerSource.ts +137 -0
  117. package/ts/Private/IAgoraMediaRecorder.ts +25 -0
  118. package/ts/Private/IAgoraMediaStreamingSource.ts +81 -0
  119. package/ts/Private/IAgoraMusicContentCenter.ts +455 -0
  120. package/ts/Private/IAgoraRhythmPlayer.ts +67 -0
  121. package/ts/Private/IAgoraRtcEngine.ts +7306 -0
  122. package/ts/Private/IAgoraRtcEngineEx.ts +992 -0
  123. package/ts/Private/IAgoraSpatialAudio.ts +250 -0
  124. package/ts/Private/IAudioDeviceManager.ts +342 -0
  125. package/ts/Private/extension/AgoraBaseExtension.ts +14 -0
  126. package/ts/Private/extension/AgoraMediaBaseExtension.ts +1 -0
  127. package/ts/Private/extension/AgoraMediaPlayerTypesExtension.ts +1 -0
  128. package/ts/Private/extension/IAgoraH265TranscoderExtension.ts +39 -0
  129. package/ts/Private/extension/IAgoraLogExtension.ts +1 -0
  130. package/ts/Private/extension/IAgoraMediaEngineExtension.ts +62 -0
  131. package/ts/Private/extension/IAgoraMediaPlayerExtension.ts +64 -0
  132. package/ts/Private/extension/IAgoraMediaPlayerSourceExtension.ts +1 -0
  133. package/ts/Private/extension/IAgoraMediaRecorderExtension.ts +59 -0
  134. package/ts/Private/extension/IAgoraMusicContentCenterExtension.ts +34 -0
  135. package/ts/Private/extension/IAgoraRhythmPlayerExtension.ts +1 -0
  136. package/ts/Private/extension/IAgoraRtcEngineExExtension.ts +1 -0
  137. package/ts/Private/extension/IAgoraRtcEngineExtension.ts +64 -0
  138. package/ts/Private/extension/IAgoraSpatialAudioExtension.ts +1 -0
  139. package/ts/Private/extension/IAudioDeviceManagerExtension.ts +1 -0
  140. package/ts/Private/impl/AgoraBaseImpl.ts +39 -0
  141. package/ts/Private/impl/AgoraMediaBaseImpl.ts +237 -0
  142. package/ts/Private/impl/IAgoraH265TranscoderImpl.ts +152 -0
  143. package/ts/Private/impl/IAgoraMediaEngineImpl.ts +491 -0
  144. package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +1169 -0
  145. package/ts/Private/impl/IAgoraMediaPlayerSourceImpl.ts +94 -0
  146. package/ts/Private/impl/IAgoraMediaRecorderImpl.ts +59 -0
  147. package/ts/Private/impl/IAgoraMusicContentCenterImpl.ts +562 -0
  148. package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +1672 -0
  149. package/ts/Private/impl/IAgoraRtcEngineImpl.ts +7352 -0
  150. package/ts/Private/impl/IAgoraSpatialAudioImpl.ts +495 -0
  151. package/ts/Private/impl/IAudioDeviceManagerImpl.ts +443 -0
  152. package/ts/Private/internal/AgoraH265TranscoderInternal.ts +97 -0
  153. package/ts/Private/internal/AgoraMediaBaseInternal.ts +15 -0
  154. package/ts/Private/internal/AudioDeviceManagerInternal.ts +46 -0
  155. package/ts/Private/internal/IrisApiEngine.ts +598 -0
  156. package/ts/Private/internal/LocalSpatialAudioEngineInternal.ts +3 -0
  157. package/ts/Private/internal/MediaEngineInternal.ts +190 -0
  158. package/ts/Private/internal/MediaPlayerInternal.ts +311 -0
  159. package/ts/Private/internal/MediaRecorderInternal.ts +100 -0
  160. package/ts/Private/internal/MusicContentCenterInternal.ts +208 -0
  161. package/ts/Private/internal/RtcEngineExInternal.ts +647 -0
  162. package/ts/Private/ipc/main.ts +22 -0
  163. package/ts/Private/ipc/renderer.ts +21 -0
  164. package/ts/Private/ti/AgoraBase-ti.ts +16 -0
  165. package/ts/Private/ti/AgoraMediaBase-ti.ts +58 -0
  166. package/ts/Private/ti/AgoraMediaPlayerTypes-ti.ts +11 -0
  167. package/ts/Private/ti/IAgoraH265Transcoder-ti.ts +16 -0
  168. package/ts/Private/ti/IAgoraLog-ti.ts +11 -0
  169. package/ts/Private/ti/IAgoraMediaEngine-ti.ts +11 -0
  170. package/ts/Private/ti/IAgoraMediaPlayer-ti.ts +14 -0
  171. package/ts/Private/ti/IAgoraMediaPlayerSource-ti.ts +26 -0
  172. package/ts/Private/ti/IAgoraMediaRecorder-ti.ts +11 -0
  173. package/ts/Private/ti/IAgoraMediaStreamingSource-ti.ts +11 -0
  174. package/ts/Private/ti/IAgoraMusicContentCenter-ti.ts +18 -0
  175. package/ts/Private/ti/IAgoraRhythmPlayer-ti.ts +11 -0
  176. package/ts/Private/ti/IAgoraRtcEngine-ti.ts +119 -0
  177. package/ts/Private/ti/IAgoraRtcEngineEx-ti.ts +11 -0
  178. package/ts/Private/ti/IAgoraSpatialAudio-ti.ts +11 -0
  179. package/ts/Private/ti/IAudioDeviceManager-ti.ts +11 -0
  180. package/ts/Renderer/AgoraView.ts +235 -0
  181. package/ts/Renderer/CapabilityManager.ts +126 -0
  182. package/ts/Renderer/IRenderer.ts +158 -0
  183. package/ts/Renderer/IRendererCache.ts +96 -0
  184. package/ts/Renderer/RendererCache.ts +124 -0
  185. package/ts/Renderer/RendererManager.ts +400 -0
  186. package/ts/Renderer/WebCodecsRenderer/index.ts +145 -0
  187. package/ts/Renderer/WebCodecsRendererCache.ts +137 -0
  188. package/ts/Renderer/WebGLRenderer/index.ts +489 -0
  189. package/ts/Renderer/WebGLRenderer/webgl-utils.js +1510 -0
  190. package/ts/Renderer/YUVCanvasRenderer/index.ts +67 -0
  191. package/ts/Renderer/index.ts +1 -0
  192. package/ts/Types.ts +249 -0
  193. package/ts/Utils.ts +197 -0
  194. package/types/AgoraSdk.d.ts +40 -0
  195. package/types/AgoraSdk.d.ts.map +1 -0
  196. package/types/Decoder/gpu-utils.d.ts +21 -0
  197. package/types/Decoder/gpu-utils.d.ts.map +1 -0
  198. package/types/Decoder/index.d.ts +26 -0
  199. package/types/Decoder/index.d.ts.map +1 -0
  200. package/types/Private/AgoraBase.d.ts +5310 -0
  201. package/types/Private/AgoraBase.d.ts.map +1 -0
  202. package/types/Private/AgoraMediaBase.d.ts +1668 -0
  203. package/types/Private/AgoraMediaBase.d.ts.map +1 -0
  204. package/types/Private/AgoraMediaPlayerTypes.d.ts +453 -0
  205. package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -0
  206. package/types/Private/IAgoraH265Transcoder.d.ts +28 -0
  207. package/types/Private/IAgoraH265Transcoder.d.ts.map +1 -0
  208. package/types/Private/IAgoraLog.d.ts +89 -0
  209. package/types/Private/IAgoraLog.d.ts.map +1 -0
  210. package/types/Private/IAgoraMediaEngine.d.ts +250 -0
  211. package/types/Private/IAgoraMediaEngine.d.ts.map +1 -0
  212. package/types/Private/IAgoraMediaPlayer.d.ts +648 -0
  213. package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -0
  214. package/types/Private/IAgoraMediaPlayerSource.d.ts +109 -0
  215. package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -0
  216. package/types/Private/IAgoraMediaRecorder.d.ts +20 -0
  217. package/types/Private/IAgoraMediaRecorder.d.ts.map +1 -0
  218. package/types/Private/IAgoraMediaStreamingSource.d.ts +42 -0
  219. package/types/Private/IAgoraMediaStreamingSource.d.ts.map +1 -0
  220. package/types/Private/IAgoraMusicContentCenter.d.ts +381 -0
  221. package/types/Private/IAgoraMusicContentCenter.d.ts.map +1 -0
  222. package/types/Private/IAgoraRhythmPlayer.d.ts +65 -0
  223. package/types/Private/IAgoraRhythmPlayer.d.ts.map +1 -0
  224. package/types/Private/IAgoraRtcEngine.d.ts +6103 -0
  225. package/types/Private/IAgoraRtcEngine.d.ts.map +1 -0
  226. package/types/Private/IAgoraRtcEngineEx.d.ts +741 -0
  227. package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -0
  228. package/types/Private/IAgoraSpatialAudio.d.ts +196 -0
  229. package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -0
  230. package/types/Private/IAudioDeviceManager.d.ts +312 -0
  231. package/types/Private/IAudioDeviceManager.d.ts.map +1 -0
  232. package/types/Private/extension/AgoraBaseExtension.d.ts +14 -0
  233. package/types/Private/extension/AgoraBaseExtension.d.ts.map +1 -0
  234. package/types/Private/extension/AgoraMediaBaseExtension.d.ts +2 -0
  235. package/types/Private/extension/AgoraMediaBaseExtension.d.ts.map +1 -0
  236. package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts +2 -0
  237. package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts.map +1 -0
  238. package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts +24 -0
  239. package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts.map +1 -0
  240. package/types/Private/extension/IAgoraLogExtension.d.ts +2 -0
  241. package/types/Private/extension/IAgoraLogExtension.d.ts.map +1 -0
  242. package/types/Private/extension/IAgoraMediaEngineExtension.d.ts +40 -0
  243. package/types/Private/extension/IAgoraMediaEngineExtension.d.ts.map +1 -0
  244. package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts +46 -0
  245. package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts.map +1 -0
  246. package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts +2 -0
  247. package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts.map +1 -0
  248. package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts +44 -0
  249. package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts.map +1 -0
  250. package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts +20 -0
  251. package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts.map +1 -0
  252. package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts +2 -0
  253. package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts.map +1 -0
  254. package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts +2 -0
  255. package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts.map +1 -0
  256. package/types/Private/extension/IAgoraRtcEngineExtension.d.ts +42 -0
  257. package/types/Private/extension/IAgoraRtcEngineExtension.d.ts.map +1 -0
  258. package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts +2 -0
  259. package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts.map +1 -0
  260. package/types/Private/extension/IAudioDeviceManagerExtension.d.ts +2 -0
  261. package/types/Private/extension/IAudioDeviceManagerExtension.d.ts.map +1 -0
  262. package/types/Private/impl/AgoraBaseImpl.d.ts +3 -0
  263. package/types/Private/impl/AgoraBaseImpl.d.ts.map +1 -0
  264. package/types/Private/impl/AgoraMediaBaseImpl.d.ts +14 -0
  265. package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -0
  266. package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts +15 -0
  267. package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts.map +1 -0
  268. package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +46 -0
  269. package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -0
  270. package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts +143 -0
  271. package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts.map +1 -0
  272. package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts +3 -0
  273. package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts.map +1 -0
  274. package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts +11 -0
  275. package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts.map +1 -0
  276. package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts +67 -0
  277. package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts.map +1 -0
  278. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +116 -0
  279. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -0
  280. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +628 -0
  281. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -0
  282. package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts +47 -0
  283. package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts.map +1 -0
  284. package/types/Private/impl/IAudioDeviceManagerImpl.d.ts +65 -0
  285. package/types/Private/impl/IAudioDeviceManagerImpl.d.ts.map +1 -0
  286. package/types/Private/internal/AgoraH265TranscoderInternal.d.ts +14 -0
  287. package/types/Private/internal/AgoraH265TranscoderInternal.d.ts.map +1 -0
  288. package/types/Private/internal/AgoraMediaBaseInternal.d.ts +8 -0
  289. package/types/Private/internal/AgoraMediaBaseInternal.d.ts.map +1 -0
  290. package/types/Private/internal/AudioDeviceManagerInternal.d.ts +9 -0
  291. package/types/Private/internal/AudioDeviceManagerInternal.d.ts.map +1 -0
  292. package/types/Private/internal/IrisApiEngine.d.ts +69 -0
  293. package/types/Private/internal/IrisApiEngine.d.ts.map +1 -0
  294. package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts +4 -0
  295. package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts.map +1 -0
  296. package/types/Private/internal/MediaEngineInternal.d.ts +23 -0
  297. package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -0
  298. package/types/Private/internal/MediaPlayerInternal.d.ts +30 -0
  299. package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -0
  300. package/types/Private/internal/MediaRecorderInternal.d.ts +16 -0
  301. package/types/Private/internal/MediaRecorderInternal.d.ts.map +1 -0
  302. package/types/Private/internal/MusicContentCenterInternal.d.ts +31 -0
  303. package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -0
  304. package/types/Private/internal/RtcEngineExInternal.d.ts +73 -0
  305. package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -0
  306. package/types/Private/ipc/main.d.ts +2 -0
  307. package/types/Private/ipc/main.d.ts.map +1 -0
  308. package/types/Private/ipc/renderer.d.ts +3 -0
  309. package/types/Private/ipc/renderer.d.ts.map +1 -0
  310. package/types/Private/ti/AgoraBase-ti.d.ts +8 -0
  311. package/types/Private/ti/AgoraBase-ti.d.ts.map +1 -0
  312. package/types/Private/ti/AgoraMediaBase-ti.d.ts +15 -0
  313. package/types/Private/ti/AgoraMediaBase-ti.d.ts.map +1 -0
  314. package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts +7 -0
  315. package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts.map +1 -0
  316. package/types/Private/ti/IAgoraH265Transcoder-ti.d.ts +8 -0
  317. package/types/Private/ti/IAgoraH265Transcoder-ti.d.ts.map +1 -0
  318. package/types/Private/ti/IAgoraLog-ti.d.ts +7 -0
  319. package/types/Private/ti/IAgoraLog-ti.d.ts.map +1 -0
  320. package/types/Private/ti/IAgoraMediaEngine-ti.d.ts +7 -0
  321. package/types/Private/ti/IAgoraMediaEngine-ti.d.ts.map +1 -0
  322. package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts +8 -0
  323. package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts.map +1 -0
  324. package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts +8 -0
  325. package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts.map +1 -0
  326. package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts +7 -0
  327. package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts.map +1 -0
  328. package/types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts +7 -0
  329. package/types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts.map +1 -0
  330. package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts +8 -0
  331. package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts.map +1 -0
  332. package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts +7 -0
  333. package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts.map +1 -0
  334. package/types/Private/ti/IAgoraRtcEngine-ti.d.ts +10 -0
  335. package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -0
  336. package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts +7 -0
  337. package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts.map +1 -0
  338. package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts +7 -0
  339. package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts.map +1 -0
  340. package/types/Private/ti/IAudioDeviceManager-ti.d.ts +7 -0
  341. package/types/Private/ti/IAudioDeviceManager-ti.d.ts.map +1 -0
  342. package/types/Renderer/AgoraView.d.ts +76 -0
  343. package/types/Renderer/AgoraView.d.ts.map +1 -0
  344. package/types/Renderer/CapabilityManager.d.ts +20 -0
  345. package/types/Renderer/CapabilityManager.d.ts.map +1 -0
  346. package/types/Renderer/IRenderer.d.ts +20 -0
  347. package/types/Renderer/IRenderer.d.ts.map +1 -0
  348. package/types/Renderer/IRendererCache.d.ts +26 -0
  349. package/types/Renderer/IRendererCache.d.ts.map +1 -0
  350. package/types/Renderer/RendererCache.d.ts +24 -0
  351. package/types/Renderer/RendererCache.d.ts.map +1 -0
  352. package/types/Renderer/RendererManager.d.ts +66 -0
  353. package/types/Renderer/RendererManager.d.ts.map +1 -0
  354. package/types/Renderer/WebCodecsRenderer/index.d.ts +14 -0
  355. package/types/Renderer/WebCodecsRenderer/index.d.ts.map +1 -0
  356. package/types/Renderer/WebCodecsRendererCache.d.ts +15 -0
  357. package/types/Renderer/WebCodecsRendererCache.d.ts.map +1 -0
  358. package/types/Renderer/WebGLRenderer/index.d.ts +27 -0
  359. package/types/Renderer/WebGLRenderer/index.d.ts.map +1 -0
  360. package/types/Renderer/WebGLRenderer/webgl-utils.d.ts +1 -0
  361. package/types/Renderer/WebGLRenderer/webgl-utils.d.ts.map +1 -0
  362. package/types/Renderer/YUVCanvasRenderer/index.d.ts +9 -0
  363. package/types/Renderer/YUVCanvasRenderer/index.d.ts.map +1 -0
  364. package/types/Renderer/index.d.ts +2 -0
  365. package/types/Renderer/index.d.ts.map +1 -0
  366. package/types/Types.d.ts +177 -0
  367. package/types/Types.d.ts.map +1 -0
  368. package/types/Utils.d.ts +50 -0
  369. package/types/Utils.d.ts.map +1 -0
@@ -0,0 +1,1764 @@
1
+ import './extension/AgoraMediaBaseExtension';
2
+ import { EncodedVideoFrameInfo } from './AgoraBase';
3
+
4
+ /**
5
+ * The context information of the extension.
6
+ */
7
+ export class ExtensionContext {
8
+ /**
9
+ * Whether the uid in ExtensionContext is valid: true : The uid is valid. false : The uid is invalid.
10
+ */
11
+ isValid?: boolean;
12
+ /**
13
+ * The user ID. 0 represents a local user, while greater than 0 represents a remote user.
14
+ */
15
+ uid?: number;
16
+ /**
17
+ * The name of the extension provider.
18
+ */
19
+ providerName?: string;
20
+ /**
21
+ * The name of the extension.
22
+ */
23
+ extensionName?: string;
24
+ }
25
+
26
+ /**
27
+ * The type of the video source.
28
+ */
29
+ export enum VideoSourceType {
30
+ /**
31
+ * 0: (Default) The primary camera.
32
+ */
33
+ VideoSourceCameraPrimary = 0,
34
+ /**
35
+ * 0: (Default) The primary camera.
36
+ */
37
+ VideoSourceCamera = 0,
38
+ /**
39
+ * 1: The secondary camera.
40
+ */
41
+ VideoSourceCameraSecondary = 1,
42
+ /**
43
+ * 2: The primary screen.
44
+ */
45
+ VideoSourceScreenPrimary = 2,
46
+ /**
47
+ * 2: The primary screen.
48
+ */
49
+ VideoSourceScreen = 2,
50
+ /**
51
+ * 3: The secondary screen.
52
+ */
53
+ VideoSourceScreenSecondary = 3,
54
+ /**
55
+ * 4: A custom video source.
56
+ */
57
+ VideoSourceCustom = 4,
58
+ /**
59
+ * 5: The media player.
60
+ */
61
+ VideoSourceMediaPlayer = 5,
62
+ /**
63
+ * 6: One PNG image.
64
+ */
65
+ VideoSourceRtcImagePng = 6,
66
+ /**
67
+ * 7: One JPEG image.
68
+ */
69
+ VideoSourceRtcImageJpeg = 7,
70
+ /**
71
+ * 8: One GIF image.
72
+ */
73
+ VideoSourceRtcImageGif = 8,
74
+ /**
75
+ * 9: One remote video acquired by the network.
76
+ */
77
+ VideoSourceRemote = 9,
78
+ /**
79
+ * 10: One transcoded video source.
80
+ */
81
+ VideoSourceTranscoded = 10,
82
+ /**
83
+ * 11: The third camera.
84
+ */
85
+ VideoSourceCameraThird = 11,
86
+ /**
87
+ * 12: The fourth camera.
88
+ */
89
+ VideoSourceCameraFourth = 12,
90
+ /**
91
+ * 13: The third screen.
92
+ */
93
+ VideoSourceScreenThird = 13,
94
+ /**
95
+ * 14: The fourth screen.
96
+ */
97
+ VideoSourceScreenFourth = 14,
98
+ /**
99
+ * @ignore
100
+ */
101
+ VideoSourceSpeechDriven = 15,
102
+ /**
103
+ * 100: An unknown video source.
104
+ */
105
+ VideoSourceUnknown = 100,
106
+ }
107
+
108
+ /**
109
+ * The audio source type.
110
+ */
111
+ export enum AudioSourceType {
112
+ /**
113
+ * 0: (Default) Microphone.
114
+ */
115
+ AudioSourceMicrophone = 0,
116
+ /**
117
+ * 1: Custom audio stream.
118
+ */
119
+ AudioSourceCustom = 1,
120
+ /**
121
+ * 2: Media player.
122
+ */
123
+ AudioSourceMediaPlayer = 2,
124
+ /**
125
+ * 3: System audio stream captured during screen sharing.
126
+ */
127
+ AudioSourceLoopbackRecording = 3,
128
+ /**
129
+ * @ignore
130
+ */
131
+ AudioSourceMixedStream = 4,
132
+ /**
133
+ * 5: Audio stream from a specified remote user.
134
+ */
135
+ AudioSourceRemoteUser = 5,
136
+ /**
137
+ * 6: Mixed audio streams from all users in the current channel.
138
+ */
139
+ AudioSourceRemoteChannel = 6,
140
+ /**
141
+ * 100: An unknown audio source.
142
+ */
143
+ AudioSourceUnknown = 100,
144
+ }
145
+
146
+ /**
147
+ * The type of the audio route.
148
+ */
149
+ export enum AudioRoute {
150
+ /**
151
+ * -1: The default audio route.
152
+ */
153
+ RouteDefault = -1,
154
+ /**
155
+ * 0: Audio output routing is a headset with microphone.
156
+ */
157
+ RouteHeadset = 0,
158
+ /**
159
+ * 1: The audio route is an earpiece.
160
+ */
161
+ RouteEarpiece = 1,
162
+ /**
163
+ * 2: The audio route is a headset without a microphone.
164
+ */
165
+ RouteHeadsetnomic = 2,
166
+ /**
167
+ * 3: The audio route is the speaker that comes with the device.
168
+ */
169
+ RouteSpeakerphone = 3,
170
+ /**
171
+ * 4: The audio route is an external speaker. (macOS only)
172
+ */
173
+ RouteLoudspeaker = 4,
174
+ /**
175
+ * 5: The audio route is a Bluetooth device using the HFP protocol.
176
+ */
177
+ RouteBluetoothDeviceHfp = 5,
178
+ /**
179
+ * 6: The audio route is a USB peripheral device. (For macOS only)
180
+ */
181
+ RouteUsb = 6,
182
+ /**
183
+ * 7: The audio route is an HDMI peripheral device. (For macOS only)
184
+ */
185
+ RouteHdmi = 7,
186
+ /**
187
+ * 8: The audio route is a DisplayPort peripheral device. (For macOS only)
188
+ */
189
+ RouteDisplayport = 8,
190
+ /**
191
+ * 9: The audio route is Apple AirPlay. (For macOS only)
192
+ */
193
+ RouteAirplay = 9,
194
+ /**
195
+ * 10: The audio route is a Bluetooth device using the A2DP protocol.
196
+ */
197
+ RouteBluetoothDeviceA2dp = 10,
198
+ }
199
+
200
+ /**
201
+ * @ignore
202
+ */
203
+ export enum BytesPerSample {
204
+ /**
205
+ * @ignore
206
+ */
207
+ TwoBytesPerSample = 2,
208
+ }
209
+
210
+ /**
211
+ * @ignore
212
+ */
213
+ export class AudioParameters {
214
+ /**
215
+ * @ignore
216
+ */
217
+ sample_rate?: number;
218
+ /**
219
+ * @ignore
220
+ */
221
+ channels?: number;
222
+ /**
223
+ * @ignore
224
+ */
225
+ frames_per_buffer?: number;
226
+ }
227
+
228
+ /**
229
+ * The use mode of the audio data.
230
+ */
231
+ export enum RawAudioFrameOpModeType {
232
+ /**
233
+ * 0: Read-only mode, Users only read the data returned by the SDK without modifying anything. For example, when users acquire the data with the Agora SDK, then start the media push.
234
+ */
235
+ RawAudioFrameOpModeReadOnly = 0,
236
+ /**
237
+ * 2: Read and write mode, Users read the data returned by the SDK, modify it, and then play it. For example, when users have their own audio-effect processing module and perform some voice preprocessing, such as a voice change.
238
+ */
239
+ RawAudioFrameOpModeReadWrite = 2,
240
+ }
241
+
242
+ /**
243
+ * Media source type.
244
+ */
245
+ export enum MediaSourceType {
246
+ /**
247
+ * 0: Audio playback device.
248
+ */
249
+ AudioPlayoutSource = 0,
250
+ /**
251
+ * 1: Audio capturing device.
252
+ */
253
+ AudioRecordingSource = 1,
254
+ /**
255
+ * 2: The primary camera.
256
+ */
257
+ PrimaryCameraSource = 2,
258
+ /**
259
+ * 3: A secondary camera.
260
+ */
261
+ SecondaryCameraSource = 3,
262
+ /**
263
+ * @ignore
264
+ */
265
+ PrimaryScreenSource = 4,
266
+ /**
267
+ * @ignore
268
+ */
269
+ SecondaryScreenSource = 5,
270
+ /**
271
+ * 6: Custom video source.
272
+ */
273
+ CustomVideoSource = 6,
274
+ /**
275
+ * @ignore
276
+ */
277
+ MediaPlayerSource = 7,
278
+ /**
279
+ * @ignore
280
+ */
281
+ RtcImagePngSource = 8,
282
+ /**
283
+ * @ignore
284
+ */
285
+ RtcImageJpegSource = 9,
286
+ /**
287
+ * @ignore
288
+ */
289
+ RtcImageGifSource = 10,
290
+ /**
291
+ * @ignore
292
+ */
293
+ RemoteVideoSource = 11,
294
+ /**
295
+ * @ignore
296
+ */
297
+ TranscodedVideoSource = 12,
298
+ /**
299
+ * @ignore
300
+ */
301
+ SpeechDrivenVideoSource = 13,
302
+ /**
303
+ * 100: Unknown media source.
304
+ */
305
+ UnknownMediaSource = 100,
306
+ }
307
+
308
+ /**
309
+ * @ignore
310
+ */
311
+ export enum ContentInspectResult {
312
+ /**
313
+ * @ignore
314
+ */
315
+ ContentInspectNeutral = 1,
316
+ /**
317
+ * @ignore
318
+ */
319
+ ContentInspectSexy = 2,
320
+ /**
321
+ * @ignore
322
+ */
323
+ ContentInspectPorn = 3,
324
+ }
325
+
326
+ /**
327
+ * The type of video content moderation module.
328
+ */
329
+ export enum ContentInspectType {
330
+ /**
331
+ * 0: (Default) This module has no actual function. Do not set type to this value.
332
+ */
333
+ ContentInspectInvalid = 0,
334
+ /**
335
+ * @ignore
336
+ */
337
+ ContentInspectModeration = 1,
338
+ /**
339
+ * 2: Video screenshot and upload via Agora self-developed extension. SDK takes screenshots of the video stream in the channel and uploads them.
340
+ */
341
+ ContentInspectSupervision = 2,
342
+ /**
343
+ * 3: Video screenshot and upload via extensions from Agora Extensions Marketplace. SDK uses video moderation extensions from Agora Extensions Marketplace to take screenshots of the video stream in the channel and uploads them.
344
+ */
345
+ ContentInspectImageModeration = 3,
346
+ }
347
+
348
+ /**
349
+ * ContentInspectModule A structure used to configure the frequency of video screenshot and upload.
350
+ */
351
+ export class ContentInspectModule {
352
+ /**
353
+ * Types of functional module. See ContentInspectType.
354
+ */
355
+ type?: ContentInspectType;
356
+ /**
357
+ * The frequency (s) of video screenshot and upload. The value should be set as larger than 0. The default value is 0, the SDK does not take screenshots. Agora recommends that you set the value as 10; you can also adjust it according to your business needs.
358
+ */
359
+ interval?: number;
360
+ }
361
+
362
+ /**
363
+ * Screenshot and upload configuration.
364
+ */
365
+ export class ContentInspectConfig {
366
+ /**
367
+ * Additional information on the video content (maximum length: 1024 Bytes). The SDK sends the screenshots and additional information on the video content to the Agora server. Once the video screenshot and upload process is completed, the Agora server sends the additional information and the callback notification to your server.
368
+ */
369
+ extraInfo?: string;
370
+ /**
371
+ * @ignore
372
+ */
373
+ serverConfig?: string;
374
+ /**
375
+ * Functional module. See ContentInspectModule. A maximum of 32 ContentInspectModule instances can be configured, and the value range of MAX_CONTENT_INSPECT_MODULE_COUNT is an integer in [1,32]. A function module can only be configured with one instance at most. Currently only the video screenshot and upload function is supported.
376
+ */
377
+ modules?: ContentInspectModule[];
378
+ /**
379
+ * The number of functional modules, that is,the number of configured ContentInspectModule instances, must be the same as the number of instances configured in modules. The maximum number is 32.
380
+ */
381
+ moduleCount?: number;
382
+ }
383
+
384
+ /**
385
+ * @ignore
386
+ */
387
+ export class PacketOptions {
388
+ /**
389
+ * @ignore
390
+ */
391
+ timestamp?: number;
392
+ /**
393
+ * @ignore
394
+ */
395
+ audioLevelIndication?: number;
396
+ }
397
+
398
+ /**
399
+ * @ignore
400
+ */
401
+ export class AudioEncodedFrameInfo {
402
+ /**
403
+ * @ignore
404
+ */
405
+ sendTs?: number;
406
+ /**
407
+ * @ignore
408
+ */
409
+ codec?: number;
410
+ }
411
+
412
+ /**
413
+ * The parameters of the audio frame in PCM format.
414
+ */
415
+ export class AudioPcmFrame {
416
+ /**
417
+ * The timestamp (ms) of the audio frame.
418
+ */
419
+ capture_timestamp?: number;
420
+ /**
421
+ * The number of samples per channel in the audio frame.
422
+ */
423
+ samples_per_channel_?: number;
424
+ /**
425
+ * Audio sample rate (Hz).
426
+ */
427
+ sample_rate_hz_?: number;
428
+ /**
429
+ * The number of audio channels.
430
+ */
431
+ num_channels_?: number;
432
+ /**
433
+ * The number of bytes per sample.
434
+ */
435
+ bytes_per_sample?: BytesPerSample;
436
+ /**
437
+ * The audio frame.
438
+ */
439
+ data_?: number[];
440
+ /**
441
+ * @ignore
442
+ */
443
+ is_stereo_?: boolean;
444
+ }
445
+
446
+ /**
447
+ * The channel mode.
448
+ */
449
+ export enum AudioDualMonoMode {
450
+ /**
451
+ * 0: Original mode.
452
+ */
453
+ AudioDualMonoStereo = 0,
454
+ /**
455
+ * 1: Left channel mode. This mode replaces the audio of the right channel with the audio of the left channel, which means the user can only hear the audio of the left channel.
456
+ */
457
+ AudioDualMonoL = 1,
458
+ /**
459
+ * 2: Right channel mode. This mode replaces the audio of the left channel with the audio of the right channel, which means the user can only hear the audio of the right channel.
460
+ */
461
+ AudioDualMonoR = 2,
462
+ /**
463
+ * 3: Mixed channel mode. This mode mixes the audio of the left channel and the right channel, which means the user can hear the audio of the left channel and the right channel at the same time.
464
+ */
465
+ AudioDualMonoMix = 3,
466
+ }
467
+
468
+ /**
469
+ * The video pixel format.
470
+ */
471
+ export enum VideoPixelFormat {
472
+ /**
473
+ * 0: Raw video pixel format.
474
+ */
475
+ VideoPixelDefault = 0,
476
+ /**
477
+ * 1: The format is I420.
478
+ */
479
+ VideoPixelI420 = 1,
480
+ /**
481
+ * @ignore
482
+ */
483
+ VideoPixelBgra = 2,
484
+ /**
485
+ * @ignore
486
+ */
487
+ VideoPixelNv21 = 3,
488
+ /**
489
+ * 4: The format is RGBA.
490
+ */
491
+ VideoPixelRgba = 4,
492
+ /**
493
+ * @ignore
494
+ */
495
+ VideoPixelNv12 = 8,
496
+ /**
497
+ * @ignore
498
+ */
499
+ VideoTexture2d = 10,
500
+ /**
501
+ * @ignore
502
+ */
503
+ VideoTextureOes = 11,
504
+ /**
505
+ * @ignore
506
+ */
507
+ VideoCvpixelNv12 = 12,
508
+ /**
509
+ * @ignore
510
+ */
511
+ VideoCvpixelI420 = 13,
512
+ /**
513
+ * @ignore
514
+ */
515
+ VideoCvpixelBgra = 14,
516
+ /**
517
+ * @ignore
518
+ */
519
+ VideoCvpixelP010 = 15,
520
+ /**
521
+ * 16: The format is I422.
522
+ */
523
+ VideoPixelI422 = 16,
524
+ /**
525
+ * @ignore
526
+ */
527
+ VideoTextureId3d11texture2d = 17,
528
+ /**
529
+ * @ignore
530
+ */
531
+ VideoPixelI010 = 18,
532
+ }
533
+
534
+ /**
535
+ * Video display modes.
536
+ */
537
+ export enum RenderModeType {
538
+ /**
539
+ * 1: Hidden mode. The priority is to fill the window. Any excess video that does not match the window size will be cropped.
540
+ */
541
+ RenderModeHidden = 1,
542
+ /**
543
+ * 2: Fit mode. The priority is to ensure that all video content is displayed. Any areas of the window that are not filled due to the mismatch between video size and window size will be filled with black.
544
+ */
545
+ RenderModeFit = 2,
546
+ /**
547
+ * @ignore
548
+ */
549
+ RenderModeAdaptive = 3,
550
+ }
551
+
552
+ /**
553
+ * @ignore
554
+ */
555
+ export enum CameraVideoSourceType {
556
+ /**
557
+ * @ignore
558
+ */
559
+ CameraSourceFront = 0,
560
+ /**
561
+ * @ignore
562
+ */
563
+ CameraSourceBack = 1,
564
+ /**
565
+ * @ignore
566
+ */
567
+ VideoSourceUnspecified = 2,
568
+ }
569
+
570
+ /**
571
+ * @ignore
572
+ */
573
+ export enum MetaInfoKey {
574
+ /**
575
+ * @ignore
576
+ */
577
+ KeyFaceCapture = 0,
578
+ }
579
+
580
+ /**
581
+ * @ignore
582
+ */
583
+ export abstract class IVideoFrameMetaInfo {
584
+ /**
585
+ * @ignore
586
+ */
587
+ abstract getMetaInfoStr(key: MetaInfoKey): string;
588
+ }
589
+
590
+ /**
591
+ * @ignore
592
+ */
593
+ export enum PrimaryID {
594
+ /**
595
+ * @ignore
596
+ */
597
+ PrimaryidBt709 = 1,
598
+ /**
599
+ * @ignore
600
+ */
601
+ PrimaryidUnspecified = 2,
602
+ /**
603
+ * @ignore
604
+ */
605
+ PrimaryidBt470m = 4,
606
+ /**
607
+ * @ignore
608
+ */
609
+ PrimaryidBt470bg = 5,
610
+ /**
611
+ * @ignore
612
+ */
613
+ PrimaryidSmpte170m = 6,
614
+ /**
615
+ * @ignore
616
+ */
617
+ PrimaryidSmpte240m = 7,
618
+ /**
619
+ * @ignore
620
+ */
621
+ PrimaryidFilm = 8,
622
+ /**
623
+ * @ignore
624
+ */
625
+ PrimaryidBt2020 = 9,
626
+ /**
627
+ * @ignore
628
+ */
629
+ PrimaryidSmptest428 = 10,
630
+ /**
631
+ * @ignore
632
+ */
633
+ PrimaryidSmptest431 = 11,
634
+ /**
635
+ * @ignore
636
+ */
637
+ PrimaryidSmptest432 = 12,
638
+ /**
639
+ * @ignore
640
+ */
641
+ PrimaryidJedecp22 = 22,
642
+ }
643
+
644
+ /**
645
+ * @ignore
646
+ */
647
+ export enum RangeID {
648
+ /**
649
+ * @ignore
650
+ */
651
+ RangeidInvalid = 0,
652
+ /**
653
+ * @ignore
654
+ */
655
+ RangeidLimited = 1,
656
+ /**
657
+ * @ignore
658
+ */
659
+ RangeidFull = 2,
660
+ /**
661
+ * @ignore
662
+ */
663
+ RangeidDerived = 3,
664
+ }
665
+
666
+ /**
667
+ * @ignore
668
+ */
669
+ export enum MatrixID {
670
+ /**
671
+ * @ignore
672
+ */
673
+ MatrixidRgb = 0,
674
+ /**
675
+ * @ignore
676
+ */
677
+ MatrixidBt709 = 1,
678
+ /**
679
+ * @ignore
680
+ */
681
+ MatrixidUnspecified = 2,
682
+ /**
683
+ * @ignore
684
+ */
685
+ MatrixidFcc = 4,
686
+ /**
687
+ * @ignore
688
+ */
689
+ MatrixidBt470bg = 5,
690
+ /**
691
+ * @ignore
692
+ */
693
+ MatrixidSmpte170m = 6,
694
+ /**
695
+ * @ignore
696
+ */
697
+ MatrixidSmpte240m = 7,
698
+ /**
699
+ * @ignore
700
+ */
701
+ MatrixidYcocg = 8,
702
+ /**
703
+ * @ignore
704
+ */
705
+ MatrixidBt2020Ncl = 9,
706
+ /**
707
+ * @ignore
708
+ */
709
+ MatrixidBt2020Cl = 10,
710
+ /**
711
+ * @ignore
712
+ */
713
+ MatrixidSmpte2085 = 11,
714
+ /**
715
+ * @ignore
716
+ */
717
+ MatrixidCdncls = 12,
718
+ /**
719
+ * @ignore
720
+ */
721
+ MatrixidCdcls = 13,
722
+ /**
723
+ * @ignore
724
+ */
725
+ MatrixidBt2100Ictcp = 14,
726
+ }
727
+
728
+ /**
729
+ * @ignore
730
+ */
731
+ export enum TransferID {
732
+ /**
733
+ * @ignore
734
+ */
735
+ TransferidBt709 = 1,
736
+ /**
737
+ * @ignore
738
+ */
739
+ TransferidUnspecified = 2,
740
+ /**
741
+ * @ignore
742
+ */
743
+ TransferidGamma22 = 4,
744
+ /**
745
+ * @ignore
746
+ */
747
+ TransferidGamma28 = 5,
748
+ /**
749
+ * @ignore
750
+ */
751
+ TransferidSmpte170m = 6,
752
+ /**
753
+ * @ignore
754
+ */
755
+ TransferidSmpte240m = 7,
756
+ /**
757
+ * @ignore
758
+ */
759
+ TransferidLinear = 8,
760
+ /**
761
+ * @ignore
762
+ */
763
+ TransferidLog = 9,
764
+ /**
765
+ * @ignore
766
+ */
767
+ TransferidLogSqrt = 10,
768
+ /**
769
+ * @ignore
770
+ */
771
+ TransferidIec6196624 = 11,
772
+ /**
773
+ * @ignore
774
+ */
775
+ TransferidBt1361Ecg = 12,
776
+ /**
777
+ * @ignore
778
+ */
779
+ TransferidIec6196621 = 13,
780
+ /**
781
+ * @ignore
782
+ */
783
+ TransferidBt202010 = 14,
784
+ /**
785
+ * @ignore
786
+ */
787
+ TransferidBt202012 = 15,
788
+ /**
789
+ * @ignore
790
+ */
791
+ TransferidSmptest2084 = 16,
792
+ /**
793
+ * @ignore
794
+ */
795
+ TransferidSmptest428 = 17,
796
+ /**
797
+ * @ignore
798
+ */
799
+ TransferidAribStdB67 = 18,
800
+ }
801
+
802
+ /**
803
+ * @ignore
804
+ */
805
+ export class ColorSpace {
806
+ /**
807
+ * @ignore
808
+ */
809
+ primaries?: PrimaryID;
810
+ /**
811
+ * @ignore
812
+ */
813
+ transfer?: TransferID;
814
+ /**
815
+ * @ignore
816
+ */
817
+ matrix?: MatrixID;
818
+ /**
819
+ * @ignore
820
+ */
821
+ range?: RangeID;
822
+ }
823
+
824
+ /**
825
+ * @ignore
826
+ */
827
+ export class Hdr10MetadataInfo {
828
+ /**
829
+ * @ignore
830
+ */
831
+ redPrimaryX?: number;
832
+ /**
833
+ * @ignore
834
+ */
835
+ redPrimaryY?: number;
836
+ /**
837
+ * @ignore
838
+ */
839
+ greenPrimaryX?: number;
840
+ /**
841
+ * @ignore
842
+ */
843
+ greenPrimaryY?: number;
844
+ /**
845
+ * @ignore
846
+ */
847
+ bluePrimaryX?: number;
848
+ /**
849
+ * @ignore
850
+ */
851
+ bluePrimaryY?: number;
852
+ /**
853
+ * @ignore
854
+ */
855
+ whitePointX?: number;
856
+ /**
857
+ * @ignore
858
+ */
859
+ whitePointY?: number;
860
+ /**
861
+ * @ignore
862
+ */
863
+ maxMasteringLuminance?: number;
864
+ /**
865
+ * @ignore
866
+ */
867
+ minMasteringLuminance?: number;
868
+ /**
869
+ * @ignore
870
+ */
871
+ maxContentLightLevel?: number;
872
+ /**
873
+ * @ignore
874
+ */
875
+ maxFrameAverageLightLevel?: number;
876
+ }
877
+
878
+ /**
879
+ * The relative position of alphaBuffer and video frames.
880
+ */
881
+ export enum AlphaStitchMode {
882
+ /**
883
+ * 0: (Default) Only video frame, that is, alphaBuffer is not stitched with the video frame.
884
+ */
885
+ NoAlphaStitch = 0,
886
+ /**
887
+ * 1: alphaBuffer is above the video frame.
888
+ */
889
+ AlphaStitchUp = 1,
890
+ /**
891
+ * 2: alphaBuffer is below the video frame.
892
+ */
893
+ AlphaStitchBelow = 2,
894
+ /**
895
+ * 3: alphaBuffer is to the left of the video frame.
896
+ */
897
+ AlphaStitchLeft = 3,
898
+ /**
899
+ * 4: alphaBuffer is to the right of the video frame.
900
+ */
901
+ AlphaStitchRight = 4,
902
+ }
903
+
904
+ /**
905
+ * @ignore
906
+ */
907
+ export enum EglContextType {
908
+ /**
909
+ * @ignore
910
+ */
911
+ EglContext10 = 0,
912
+ /**
913
+ * @ignore
914
+ */
915
+ EglContext14 = 1,
916
+ }
917
+
918
+ /**
919
+ * The video buffer type.
920
+ */
921
+ export enum VideoBufferType {
922
+ /**
923
+ * 1: The video buffer in the format of raw data.
924
+ */
925
+ VideoBufferRawData = 1,
926
+ /**
927
+ * 2: The video buffer in the format of raw data.
928
+ */
929
+ VideoBufferArray = 2,
930
+ /**
931
+ * 3: The video buffer in the format of Texture.
932
+ */
933
+ VideoBufferTexture = 3,
934
+ }
935
+
936
+ /**
937
+ * The external video frame.
938
+ */
939
+ export class ExternalVideoFrame {
940
+ /**
941
+ * The video type. See VideoBufferType.
942
+ */
943
+ type?: VideoBufferType;
944
+ /**
945
+ * The pixel format. See VideoPixelFormat.
946
+ */
947
+ format?: VideoPixelFormat;
948
+ /**
949
+ * Video frame buffer.
950
+ */
951
+ buffer?: Uint8Array;
952
+ /**
953
+ * Line spacing of the incoming video frame, which must be in pixels instead of bytes. For textures, it is the width of the texture.
954
+ */
955
+ stride?: number;
956
+ /**
957
+ * Height of the incoming video frame.
958
+ */
959
+ height?: number;
960
+ /**
961
+ * Raw data related parameter. The number of pixels trimmed from the left. The default value is 0.
962
+ */
963
+ cropLeft?: number;
964
+ /**
965
+ * Raw data related parameter. The number of pixels trimmed from the top. The default value is 0.
966
+ */
967
+ cropTop?: number;
968
+ /**
969
+ * Raw data related parameter. The number of pixels trimmed from the right. The default value is 0.
970
+ */
971
+ cropRight?: number;
972
+ /**
973
+ * Raw data related parameter. The number of pixels trimmed from the bottom. The default value is 0.
974
+ */
975
+ cropBottom?: number;
976
+ /**
977
+ * Raw data related parameter. The clockwise rotation of the video frame. You can set the rotation angle as 0, 90, 180, or 270. The default value is 0.
978
+ */
979
+ rotation?: number;
980
+ /**
981
+ * Timestamp (ms) of the incoming video frame. An incorrect timestamp results in frame loss or unsynchronized audio and video.
982
+ */
983
+ timestamp?: number;
984
+ /**
985
+ * This parameter only applies to video data in Texture format. Texture ID of the video frame.
986
+ */
987
+ eglType?: EglContextType;
988
+ /**
989
+ * This parameter only applies to video data in Texture format. Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.
990
+ */
991
+ textureId?: number;
992
+ /**
993
+ * @ignore
994
+ */
995
+ fenceObject?: number;
996
+ /**
997
+ * This parameter only applies to video data in Texture format. Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.
998
+ */
999
+ matrix?: number[];
1000
+ /**
1001
+ * This parameter only applies to video data in Texture format. The MetaData buffer. The default value is NULL.
1002
+ */
1003
+ metadataBuffer?: Uint8Array;
1004
+ /**
1005
+ * This parameter only applies to video data in Texture format. The MetaData size. The default value is 0.
1006
+ */
1007
+ metadataSize?: number;
1008
+ /**
1009
+ * The alpha channel data output by using portrait segmentation algorithm. This data matches the size of the video frame, with each pixel value ranging from [0,255], where 0 represents the background and 255 represents the foreground (portrait). By setting this parameter, you can render the video background into various effects, such as transparent, solid color, image, video, etc. In custom video rendering scenarios, ensure that both the video frame and alphaBuffer are of the Full Range type; other types may cause abnormal alpha data rendering.
1010
+ */
1011
+ alphaBuffer?: Uint8Array;
1012
+ /**
1013
+ * This parameter only applies to video data in BGRA or RGBA format. Whether to extract the alpha channel data from the video frame and automatically fill it into alphaBuffer : true :Extract and fill the alpha channel data. false : (Default) Do not extract and fill the Alpha channel data. For video data in BGRA or RGBA format, you can set the Alpha channel data in either of the following ways:
1014
+ * Automatically by setting this parameter to true.
1015
+ * Manually through the alphaBuffer parameter.
1016
+ */
1017
+ fillAlphaBuffer?: boolean;
1018
+ /**
1019
+ * When the video frame contains alpha channel data, it represents the relative position of alphaBuffer and the video frame. See AlphaStitchMode.
1020
+ */
1021
+ alphaStitchMode?: AlphaStitchMode;
1022
+ /**
1023
+ * This parameter only applies to video data in Windows Texture format. It represents a pointer to an object of type ID3D11Texture2D, which is used by a video frame.
1024
+ */
1025
+ d3d11Texture2d?: any;
1026
+ /**
1027
+ * This parameter only applies to video data in Windows Texture format. It represents an index of an ID3D11Texture2D texture object used by the video frame in the ID3D11Texture2D array.
1028
+ */
1029
+ textureSliceIndex?: number;
1030
+ /**
1031
+ * @ignore
1032
+ */
1033
+ hdr10MetadataInfo?: Hdr10MetadataInfo;
1034
+ /**
1035
+ * By default, the color space properties of video frames will apply the Full Range and BT.709 standard configurations. You can configure the settings according your needs for custom video capturing and rendering.
1036
+ */
1037
+ colorSpace?: ColorSpace;
1038
+ }
1039
+
1040
+ /**
1041
+ * Configurations of the video frame.
1042
+ *
1043
+ * Note that the buffer provides a pointer to a pointer. This interface cannot modify the pointer of the buffer, but it can modify the content of the buffer.
1044
+ */
1045
+ export class VideoFrame {
1046
+ /**
1047
+ * The pixel format. See VideoPixelFormat.
1048
+ */
1049
+ type?: VideoPixelFormat;
1050
+ /**
1051
+ * The width of the video, in pixels.
1052
+ */
1053
+ width?: number;
1054
+ /**
1055
+ * The height of the video, in pixels.
1056
+ */
1057
+ height?: number;
1058
+ /**
1059
+ * For YUV data, the line span of the Y buffer; for RGBA data, the total data length. When dealing with video data, it is necessary to process the offset between each line of pixel data based on this parameter, otherwise it may result in image distortion.
1060
+ */
1061
+ yStride?: number;
1062
+ /**
1063
+ * For YUV data, the line span of the U buffer; for RGBA data, the value is 0. When dealing with video data, it is necessary to process the offset between each line of pixel data based on this parameter, otherwise it may result in image distortion.
1064
+ */
1065
+ uStride?: number;
1066
+ /**
1067
+ * For YUV data, the line span of the V buffer; for RGBA data, the value is 0. When dealing with video data, it is necessary to process the offset between each line of pixel data based on this parameter, otherwise it may result in image distortion.
1068
+ */
1069
+ vStride?: number;
1070
+ /**
1071
+ * For YUV data, the pointer to the Y buffer; for RGBA data, the data buffer.
1072
+ */
1073
+ yBuffer?: Uint8Array;
1074
+ /**
1075
+ * For YUV data, the pointer to the U buffer; for RGBA data, the value is 0.
1076
+ */
1077
+ uBuffer?: Uint8Array;
1078
+ /**
1079
+ * For YUV data, the pointer to the V buffer; for RGBA data, the value is 0.
1080
+ */
1081
+ vBuffer?: Uint8Array;
1082
+ /**
1083
+ * The clockwise rotation of the video frame before rendering. Supported values include 0, 90, 180, and 270 degrees.
1084
+ */
1085
+ rotation?: number;
1086
+ /**
1087
+ * The Unix timestamp (ms) when the video frame is rendered. This timestamp can be used to guide the rendering of the video frame. This parameter is required.
1088
+ */
1089
+ renderTimeMs?: number;
1090
+ /**
1091
+ * Reserved for future use.
1092
+ */
1093
+ avsync_type?: number;
1094
+ /**
1095
+ * This parameter only applies to video data in Texture format. The MetaData buffer. The default value is NULL.
1096
+ */
1097
+ metadata_buffer?: Uint8Array;
1098
+ /**
1099
+ * This parameter only applies to video data in Texture format. The MetaData size. The default value is 0.
1100
+ */
1101
+ metadata_size?: number;
1102
+ /**
1103
+ * This parameter only applies to video data in Texture format. Texture ID.
1104
+ */
1105
+ textureId?: number;
1106
+ /**
1107
+ * This parameter only applies to video data in Texture format. Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.
1108
+ */
1109
+ matrix?: number[];
1110
+ /**
1111
+ * The alpha channel data output by using portrait segmentation algorithm. This data matches the size of the video frame, with each pixel value ranging from [0,255], where 0 represents the background and 255 represents the foreground (portrait). By setting this parameter, you can render the video background into various effects, such as transparent, solid color, image, video, etc.
1112
+ * In custom video rendering scenarios, ensure that both the video frame and alphaBuffer are of the Full Range type; other types may cause abnormal alpha data rendering.
1113
+ * Make sure that alphaBuffer is exactly the same size as the video frame (width × height), otherwise it may cause the app to crash.
1114
+ */
1115
+ alphaBuffer?: Uint8Array;
1116
+ /**
1117
+ * When the video frame contains alpha channel data, it represents the relative position of alphaBuffer and the video frame. See AlphaStitchMode.
1118
+ */
1119
+ alphaStitchMode?: AlphaStitchMode;
1120
+ /**
1121
+ * @ignore
1122
+ */
1123
+ pixelBuffer?: Uint8Array;
1124
+ /**
1125
+ * The meta information in the video frame. To use this parameter, contact.
1126
+ */
1127
+ metaInfo?: IVideoFrameMetaInfo;
1128
+ /**
1129
+ * @ignore
1130
+ */
1131
+ hdr10MetadataInfo?: Hdr10MetadataInfo;
1132
+ /**
1133
+ * By default, the color space properties of video frames will apply the Full Range and BT.709 standard configurations. You can configure the settings according your needs for custom video capturing and rendering.
1134
+ */
1135
+ colorSpace?: ColorSpace;
1136
+ }
1137
+
1138
+ /**
1139
+ * @ignore
1140
+ */
1141
+ export enum MediaPlayerSourceType {
1142
+ /**
1143
+ * @ignore
1144
+ */
1145
+ MediaPlayerSourceDefault = 0,
1146
+ /**
1147
+ * @ignore
1148
+ */
1149
+ MediaPlayerSourceFullFeatured = 1,
1150
+ /**
1151
+ * @ignore
1152
+ */
1153
+ MediaPlayerSourceSimple = 2,
1154
+ }
1155
+
1156
+ /**
1157
+ * The frame position of the video observer.
1158
+ */
1159
+ export enum VideoModulePosition {
1160
+ /**
1161
+ * 1: The location of the locally collected video data after preprocessing corresponds to the onCaptureVideoFrame callback. The observed video here has the effect of video pre-processing, which can be verified by enabling image enhancement, virtual background, or watermark.
1162
+ */
1163
+ PositionPostCapturer = 1 << 0,
1164
+ /**
1165
+ * 2: The pre-renderer position, which corresponds to the video data in the onRenderVideoFrame callback.
1166
+ */
1167
+ PositionPreRenderer = 1 << 1,
1168
+ /**
1169
+ * 4: The pre-encoder position, which corresponds to the video data in the onPreEncodeVideoFrame callback. The observed video here has the effects of video pre-processing and encoding pre-processing.
1170
+ * To verify the pre-processing effects of the video, you can enable image enhancement, virtual background, or watermark.
1171
+ * To verify the pre-encoding processing effect, you can set a lower frame rate (for example, 5 fps).
1172
+ */
1173
+ PositionPreEncoder = 1 << 2,
1174
+ /**
1175
+ * 8: The position after local video capture and before pre-processing. The observed video here does not have pre-processing effects, which can be verified by enabling image enhancement, virtual background, or watermarks.
1176
+ */
1177
+ PositionPostCapturerOrigin = 1 << 3,
1178
+ }
1179
+
1180
+ /**
1181
+ * The snapshot configuration.
1182
+ */
1183
+ export class SnapshotConfig {
1184
+ /**
1185
+ * The local path (including filename extensions) of the snapshot. For example:
1186
+ * Windows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.jpg
1187
+ * macOS: ~/Library/Logs/example.jpg Ensure that the path you specify exists and is writable.
1188
+ */
1189
+ filePath?: string;
1190
+ /**
1191
+ * The position of the snapshot video frame in the video pipeline. See VideoModulePosition.
1192
+ */
1193
+ position?: VideoModulePosition;
1194
+ }
1195
+
1196
+ /**
1197
+ * This class is used to get raw PCM audio.
1198
+ *
1199
+ * You can inherit this class and implement the onFrame callback to get raw PCM audio.
1200
+ */
1201
+ export interface IAudioPcmFrameSink {
1202
+ /**
1203
+ * Occurs each time the player receives an audio frame.
1204
+ *
1205
+ * After registering the audio frame observer, the callback occurs every time the player receives an audio frame, reporting the detailed information of the audio frame.
1206
+ *
1207
+ * @param frame The audio frame information. See AudioPcmFrame.
1208
+ */
1209
+ onFrame?(frame: AudioPcmFrame): void;
1210
+ }
1211
+
1212
+ /**
1213
+ * Audio frame type.
1214
+ */
1215
+ export enum AudioFrameType {
1216
+ /**
1217
+ * 0: PCM 16
1218
+ */
1219
+ FrameTypePcm16 = 0,
1220
+ }
1221
+
1222
+ /**
1223
+ * Raw audio data.
1224
+ */
1225
+ export class AudioFrame {
1226
+ /**
1227
+ * The type of the audio frame. See AudioFrameType.
1228
+ */
1229
+ type?: AudioFrameType;
1230
+ /**
1231
+ * The number of samples per channel in the audio frame.
1232
+ */
1233
+ samplesPerChannel?: number;
1234
+ /**
1235
+ * The number of bytes per sample. For PCM, this parameter is generally set to 16 bits (2 bytes).
1236
+ */
1237
+ bytesPerSample?: BytesPerSample;
1238
+ /**
1239
+ * The number of audio channels (the data are interleaved if it is stereo).
1240
+ * 1: Mono.
1241
+ * 2: Stereo.
1242
+ */
1243
+ channels?: number;
1244
+ /**
1245
+ * The number of samples per channel in the audio frame.
1246
+ */
1247
+ samplesPerSec?: number;
1248
+ /**
1249
+ * The data buffer of the audio frame. When the audio frame uses a stereo channel, the data buffer is interleaved. The size of the data buffer is as follows: buffer = samples × channels × bytesPerSample.
1250
+ */
1251
+ buffer?: Uint8Array;
1252
+ /**
1253
+ * The timestamp (ms) of the external audio frame. You can use this timestamp to restore the order of the captured audio frame, and synchronize audio and video frames in video scenarios, including scenarios where external video sources are used.
1254
+ */
1255
+ renderTimeMs?: number;
1256
+ /**
1257
+ * Reserved for future use.
1258
+ */
1259
+ avsync_type?: number;
1260
+ /**
1261
+ * @ignore
1262
+ */
1263
+ presentationMs?: number;
1264
+ /**
1265
+ * @ignore
1266
+ */
1267
+ audioTrackNumber?: number;
1268
+ /**
1269
+ * @ignore
1270
+ */
1271
+ rtpTimestamp?: number;
1272
+ }
1273
+
1274
+ /**
1275
+ * @ignore
1276
+ */
1277
+ export enum AudioFramePosition {
1278
+ /**
1279
+ * @ignore
1280
+ */
1281
+ AudioFramePositionNone = 0x0000,
1282
+ /**
1283
+ * @ignore
1284
+ */
1285
+ AudioFramePositionPlayback = 0x0001,
1286
+ /**
1287
+ * @ignore
1288
+ */
1289
+ AudioFramePositionRecord = 0x0002,
1290
+ /**
1291
+ * @ignore
1292
+ */
1293
+ AudioFramePositionMixed = 0x0004,
1294
+ /**
1295
+ * @ignore
1296
+ */
1297
+ AudioFramePositionBeforeMixing = 0x0008,
1298
+ /**
1299
+ * @ignore
1300
+ */
1301
+ AudioFramePositionEarMonitoring = 0x0010,
1302
+ }
1303
+
1304
+ /**
1305
+ * Audio data format.
1306
+ *
1307
+ * The SDK sets the audio data format in the following callbacks according to AudioParams. onRecordAudioFrame onPlaybackAudioFrame onMixedAudioFrame
1308
+ * The SDK calculates the sampling interval through the samplesPerCall, sampleRate, and channel parameters in AudioParams, and triggers the onRecordAudioFrame, onPlaybackAudioFrame, onMixedAudioFrame, and onEarMonitoringAudioFrame callbacks according to the sampling interval. Sample interval (sec) = samplePerCall /(sampleRate × channel).
1309
+ * Ensure that the sample interval ≥ 0.01 (s).
1310
+ */
1311
+ export class AudioParams {
1312
+ /**
1313
+ * The audio sample rate (Hz), which can be set as one of the following values:
1314
+ * 8000.
1315
+ * (Default) 16000.
1316
+ * 32000.
1317
+ * 44100
1318
+ * 48000
1319
+ */
1320
+ sample_rate?: number;
1321
+ /**
1322
+ * The number of audio channels, which can be set as either of the following values:
1323
+ * 1: (Default) Mono.
1324
+ * 2: Stereo.
1325
+ */
1326
+ channels?: number;
1327
+ /**
1328
+ * The use mode of the audio data. See RawAudioFrameOpModeType.
1329
+ */
1330
+ mode?: RawAudioFrameOpModeType;
1331
+ /**
1332
+ * The number of samples, such as 1024 for the media push.
1333
+ */
1334
+ samples_per_call?: number;
1335
+ }
1336
+
1337
+ /**
1338
+ * The audio frame observer.
1339
+ */
1340
+ export interface IAudioFrameObserverBase {
1341
+ /**
1342
+ * Gets the captured audio frame.
1343
+ *
1344
+ * To ensure that the data format of captured audio frame is as expected, Agora recommends that you set the audio data format as follows: After calling setRecordingAudioFrameParameters to set the audio data format, call registerAudioFrameObserver to register the audio observer object, the SDK will calculate the sampling interval according to the parameters set in this method, and triggers the onRecordAudioFrame callback according to the sampling interval.
1345
+ *
1346
+ * @param channelId The channel ID.
1347
+ * @param audioFrame The raw audio data. See AudioFrame.
1348
+ */
1349
+ onRecordAudioFrame?(channelId: string, audioFrame: AudioFrame): void;
1350
+
1351
+ /**
1352
+ * Gets the raw audio frame for playback.
1353
+ *
1354
+ * To ensure that the data format of audio frame for playback is as expected, Agora recommends that you set the audio data format as follows: After calling setPlaybackAudioFrameParameters to set the audio data format and registerAudioFrameObserver to register the audio frame observer object, the SDK calculates the sampling interval according to the parameters set in the methods, and triggers the onPlaybackAudioFrame callback according to the sampling interval.
1355
+ *
1356
+ * @param channelId The channel ID.
1357
+ * @param audioFrame The raw audio data. See AudioFrame.
1358
+ */
1359
+ onPlaybackAudioFrame?(channelId: string, audioFrame: AudioFrame): void;
1360
+
1361
+ /**
1362
+ * Retrieves the mixed captured and playback audio frame.
1363
+ *
1364
+ * To ensure that the data format of mixed captured and playback audio frame meets the expectations, Agora recommends that you set the data format as follows: After calling setMixedAudioFrameParameters to set the audio data format and registerAudioFrameObserver to register the audio frame observer object, the SDK calculates the sampling interval according to the parameters set in the methods, and triggers the onMixedAudioFrame callback according to the sampling interval.
1365
+ *
1366
+ * @param channelId The channel ID.
1367
+ * @param audioFrame The raw audio data. See AudioFrame.
1368
+ */
1369
+ onMixedAudioFrame?(channelId: string, audioFrame: AudioFrame): void;
1370
+
1371
+ /**
1372
+ * Gets the in-ear monitoring audio frame.
1373
+ *
1374
+ * In order to ensure that the obtained in-ear audio data meets the expectations, Agora recommends that you set the in-ear monitoring-ear audio data format as follows: After calling setEarMonitoringAudioFrameParameters to set the audio data format and registerAudioFrameObserver to register the audio frame observer object, the SDK calculates the sampling interval according to the parameters set in the methods, and triggers the onEarMonitoringAudioFrame callback according to the sampling interval.
1375
+ *
1376
+ * @param audioFrame The raw audio data. See AudioFrame.
1377
+ */
1378
+ onEarMonitoringAudioFrame?(audioFrame: AudioFrame): void;
1379
+ }
1380
+
1381
+ /**
1382
+ * The audio frame observer.
1383
+ */
1384
+ export interface IAudioFrameObserver extends IAudioFrameObserverBase {
1385
+ /**
1386
+ * Retrieves the audio frame before mixing of subscribed remote users.
1387
+ *
1388
+ * Due to framework limitations, this callback does not support sending processed audio data back to the SDK.
1389
+ *
1390
+ * @param channelId The channel ID.
1391
+ * @param uid The ID of subscribed remote users.
1392
+ * @param audioFrame The raw audio data. See AudioFrame.
1393
+ */
1394
+ onPlaybackAudioFrameBeforeMixing?(
1395
+ channelId: string,
1396
+ uid: number,
1397
+ audioFrame: AudioFrame
1398
+ ): void;
1399
+ }
1400
+
1401
+ /**
1402
+ * The audio spectrum data.
1403
+ */
1404
+ export class AudioSpectrumData {
1405
+ /**
1406
+ * The audio spectrum data. Agora divides the audio frequency into 256 frequency domains, and reports the energy value of each frequency domain through this parameter. The value range of each energy type is [-300, 1] and the unit is dBFS.
1407
+ */
1408
+ audioSpectrumData?: number[];
1409
+ /**
1410
+ * The audio spectrum data length is 256.
1411
+ */
1412
+ dataLength?: number;
1413
+ }
1414
+
1415
+ /**
1416
+ * Audio spectrum information of the remote user.
1417
+ */
1418
+ export class UserAudioSpectrumInfo {
1419
+ /**
1420
+ * The user ID of the remote user.
1421
+ */
1422
+ uid?: number;
1423
+ /**
1424
+ * Audio spectrum information of the remote user. See AudioSpectrumData.
1425
+ */
1426
+ spectrumData?: AudioSpectrumData;
1427
+ }
1428
+
1429
+ /**
1430
+ * The audio spectrum observer.
1431
+ */
1432
+ export interface IAudioSpectrumObserver {
1433
+ /**
1434
+ * Gets the statistics of a local audio spectrum.
1435
+ *
1436
+ * After successfully calling registerAudioSpectrumObserver to implement the onLocalAudioSpectrum callback in IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK triggers this callback as the time interval you set to report the received remote audio data spectrum before encoding.
1437
+ *
1438
+ * @param data The audio spectrum data of the local user. See AudioSpectrumData.
1439
+ */
1440
+ onLocalAudioSpectrum?(data: AudioSpectrumData): void;
1441
+
1442
+ /**
1443
+ * Gets the remote audio spectrum.
1444
+ *
1445
+ * After successfully calling registerAudioSpectrumObserver to implement the onRemoteAudioSpectrum callback in the IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK will trigger the callback as the time interval you set to report the received remote audio data spectrum.
1446
+ *
1447
+ * @param spectrums The audio spectrum information of the remote user. See UserAudioSpectrumInfo. The number of arrays is the number of remote users monitored by the SDK. If the array is null, it means that no audio spectrum of remote users is detected.
1448
+ * @param spectrumNumber The number of remote users.
1449
+ */
1450
+ onRemoteAudioSpectrum?(
1451
+ spectrums: UserAudioSpectrumInfo[],
1452
+ spectrumNumber: number
1453
+ ): void;
1454
+ }
1455
+
1456
+ /**
1457
+ * Receives encoded video images.
1458
+ */
1459
+ export interface IVideoEncodedFrameObserver {
1460
+ /**
1461
+ * Reports that the receiver has received the to-be-decoded video frame sent by the remote end.
1462
+ *
1463
+ * If you call the setRemoteVideoSubscriptionOptions method and set encodedFrameOnly to true, the SDK triggers this callback locally to report the received encoded video frame information.
1464
+ *
1465
+ * @param uid The user ID of the remote user.
1466
+ * @param imageBuffer The encoded video image buffer.
1467
+ * @param length The data length of the video image.
1468
+ * @param videoEncodedFrameInfo For the information of the encoded video frame, see EncodedVideoFrameInfo.
1469
+ */
1470
+ onEncodedVideoFrameReceived?(
1471
+ uid: number,
1472
+ imageBuffer: Uint8Array,
1473
+ length: number,
1474
+ videoEncodedFrameInfo: EncodedVideoFrameInfo
1475
+ ): void;
1476
+ }
1477
+
1478
+ /**
1479
+ * The process mode of the video frame:
1480
+ */
1481
+ export enum VideoFrameProcessMode {
1482
+ /**
1483
+ * Read-only mode. In this mode, you do not modify the video frame. The video frame observer is a renderer.
1484
+ */
1485
+ ProcessModeReadOnly = 0,
1486
+ /**
1487
+ * Read and write mode. In this mode, you modify the video frame. The video frame observer is a video filter.
1488
+ */
1489
+ ProcessModeReadWrite = 1,
1490
+ }
1491
+
1492
+ /**
1493
+ * The IVideoFrameObserver class.
1494
+ */
1495
+ export interface IVideoFrameObserver {
1496
+ /**
1497
+ * Occurs each time the SDK receives a video frame captured by local devices.
1498
+ *
1499
+ * You can get raw video data collected by the local device through this callback.
1500
+ *
1501
+ * @param sourceType Video source types, including cameras, screens, or media player. See VideoSourceType.
1502
+ * @param videoFrame The video frame. See VideoFrame. The default value of the video frame data format obtained through this callback is as follows:
1503
+ * macOS: I420
1504
+ * Windows: YUV420
1505
+ */
1506
+ onCaptureVideoFrame?(
1507
+ sourceType: VideoSourceType,
1508
+ videoFrame: VideoFrame
1509
+ ): void;
1510
+
1511
+ /**
1512
+ * Occurs each time the SDK receives a video frame before encoding.
1513
+ *
1514
+ * After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data before encoding and then process the data according to your particular scenarios. After processing, you can send the processed video data back to the SDK in this callback.
1515
+ * It is recommended that you ensure the modified parameters in videoFrame are consistent with the actual situation of the video frames in the video frame buffer. Otherwise, it may cause unexpected rotation, distortion, and other issues in the local preview and remote video display.
1516
+ * It's recommended that you implement this callback through the C++ API.
1517
+ * Due to framework limitations, this callback does not support sending processed video data back to the SDK.
1518
+ * The video data that this callback gets has been preprocessed, with its content cropped and rotated, and the image enhanced.
1519
+ *
1520
+ * @param sourceType The type of the video source. See VideoSourceType.
1521
+ * @param videoFrame The video frame. See VideoFrame. The default value of the video frame data format obtained through this callback is as follows:
1522
+ * macOS: I420
1523
+ * Windows: YUV420
1524
+ */
1525
+ onPreEncodeVideoFrame?(
1526
+ sourceType: VideoSourceType,
1527
+ videoFrame: VideoFrame
1528
+ ): void;
1529
+
1530
+ /**
1531
+ * @ignore
1532
+ */
1533
+ onMediaPlayerVideoFrame?(videoFrame: VideoFrame, mediaPlayerId: number): void;
1534
+
1535
+ /**
1536
+ * Occurs each time the SDK receives a video frame sent by the remote user.
1537
+ *
1538
+ * After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data sent from the remote end before rendering, and then process it according to the particular scenarios.
1539
+ * It is recommended that you ensure the modified parameters in videoFrame are consistent with the actual situation of the video frames in the video frame buffer. Otherwise, it may cause unexpected rotation, distortion, and other issues in the local preview and remote video display.
1540
+ * If the video data type you get is RGBA, the SDK does not support processing the data of the alpha channel.
1541
+ * It's recommended that you implement this callback through the C++ API.
1542
+ * Due to framework limitations, this callback does not support sending processed video data back to the SDK.
1543
+ *
1544
+ * @param channelId The channel ID.
1545
+ * @param remoteUid The user ID of the remote user who sends the current video frame.
1546
+ * @param videoFrame The video frame. See VideoFrame. The default value of the video frame data format obtained through this callback is as follows:
1547
+ * macOS: I420
1548
+ * Windows: YUV420
1549
+ */
1550
+ onRenderVideoFrame?(
1551
+ channelId: string,
1552
+ remoteUid: number,
1553
+ videoFrame: VideoFrame
1554
+ ): void;
1555
+
1556
+ /**
1557
+ * @ignore
1558
+ */
1559
+ onTranscodedVideoFrame?(videoFrame: VideoFrame): void;
1560
+ }
1561
+
1562
+ /**
1563
+ * The external video frame encoding type.
1564
+ */
1565
+ export enum ExternalVideoSourceType {
1566
+ /**
1567
+ * 0: The video frame is not encoded.
1568
+ */
1569
+ VideoFrame = 0,
1570
+ /**
1571
+ * 1: The video frame is encoded.
1572
+ */
1573
+ EncodedVideoFrame = 1,
1574
+ }
1575
+
1576
+ /**
1577
+ * @ignore
1578
+ */
1579
+ export enum MediaRecorderContainerFormat {
1580
+ /**
1581
+ * @ignore
1582
+ */
1583
+ FormatMp4 = 1,
1584
+ }
1585
+
1586
+ /**
1587
+ * The recording content.
1588
+ */
1589
+ export enum MediaRecorderStreamType {
1590
+ /**
1591
+ * Only audio.
1592
+ */
1593
+ StreamTypeAudio = 0x01,
1594
+ /**
1595
+ * Only video.
1596
+ */
1597
+ StreamTypeVideo = 0x02,
1598
+ /**
1599
+ * (Default) Audio and video.
1600
+ */
1601
+ StreamTypeBoth = 0x01 | 0x02,
1602
+ }
1603
+
1604
+ /**
1605
+ * The current recording state.
1606
+ */
1607
+ export enum RecorderState {
1608
+ /**
1609
+ * -1: An error occurs during the recording. See RecorderReasonCode for the reason.
1610
+ */
1611
+ RecorderStateError = -1,
1612
+ /**
1613
+ * 2: The audio and video recording starts.
1614
+ */
1615
+ RecorderStateStart = 2,
1616
+ /**
1617
+ * 3: The audio and video recording stops.
1618
+ */
1619
+ RecorderStateStop = 3,
1620
+ }
1621
+
1622
+ /**
1623
+ * The reason for the state change.
1624
+ */
1625
+ export enum RecorderReasonCode {
1626
+ /**
1627
+ * 0: No error.
1628
+ */
1629
+ RecorderReasonNone = 0,
1630
+ /**
1631
+ * @ignore
1632
+ */
1633
+ RecorderReasonWriteFailed = 1,
1634
+ /**
1635
+ * @ignore
1636
+ */
1637
+ RecorderReasonNoStream = 2,
1638
+ /**
1639
+ * @ignore
1640
+ */
1641
+ RecorderReasonOverMaxDuration = 3,
1642
+ /**
1643
+ * @ignore
1644
+ */
1645
+ RecorderReasonConfigChanged = 4,
1646
+ }
1647
+
1648
+ /**
1649
+ * @ignore
1650
+ */
1651
+ export class MediaRecorderConfiguration {
1652
+ /**
1653
+ * @ignore
1654
+ */
1655
+ storagePath?: string;
1656
+ /**
1657
+ * @ignore
1658
+ */
1659
+ containerFormat?: MediaRecorderContainerFormat;
1660
+ /**
1661
+ * @ignore
1662
+ */
1663
+ streamType?: MediaRecorderStreamType;
1664
+ /**
1665
+ * @ignore
1666
+ */
1667
+ maxDurationMs?: number;
1668
+ /**
1669
+ * @ignore
1670
+ */
1671
+ recorderInfoUpdateInterval?: number;
1672
+ /**
1673
+ * @ignore
1674
+ */
1675
+ width?: number;
1676
+ /**
1677
+ * @ignore
1678
+ */
1679
+ height?: number;
1680
+ /**
1681
+ * @ignore
1682
+ */
1683
+ fps?: number;
1684
+ /**
1685
+ * @ignore
1686
+ */
1687
+ sample_rate?: number;
1688
+ /**
1689
+ * @ignore
1690
+ */
1691
+ channel_num?: number;
1692
+ /**
1693
+ * @ignore
1694
+ */
1695
+ videoSourceType?: VideoSourceType;
1696
+ }
1697
+
1698
+ /**
1699
+ * Facial information observer.
1700
+ *
1701
+ * You can call registerFaceInfoObserver to register one IFaceInfoObserver observer.
1702
+ */
1703
+ export interface IFaceInfoObserver {
1704
+ /**
1705
+ * Occurs when the facial information processed by speech driven extension is received.
1706
+ *
1707
+ * @param outFaceInfo Output parameter, the JSON string of the facial information processed by the voice driver plugin, including the following fields:
1708
+ * faces: Object sequence. The collection of facial information, with each face corresponding to an object.
1709
+ * blendshapes: Object. The collection of face capture coefficients, named according to ARkit standards, with each key-value pair representing a blendshape coefficient. The blendshape coefficient is a floating point number with a range of [0.0, 1.0].
1710
+ * rotation: Object sequence. The rotation of the head, which includes the following three key-value pairs, with values as floating point numbers ranging from -180.0 to 180.0:
1711
+ * pitch: Head pitch angle. A positve value means looking down, while a negative value means looking up.
1712
+ * yaw: Head yaw angle. A positve value means turning left, while a negative value means turning right.
1713
+ * roll: Head roll angle. A positve value means tilting to the right, while a negative value means tilting to the left.
1714
+ * timestamp: String. The timestamp of the output result, in milliseconds. Here is an example of JSON:
1715
+ * { "faces":[{ "blendshapes":{ "eyeBlinkLeft":0.9, "eyeLookDownLeft":0.0, "eyeLookInLeft":0.0, "eyeLookOutLeft":0.0, "eyeLookUpLeft":0.0, "eyeSquintLeft":0.0, "eyeWideLeft":0.0, "eyeBlinkRight":0.0, "eyeLookDownRight":0.0, "eyeLookInRight":0.0, "eyeLookOutRight":0.0, "eyeLookUpRight":0.0, "eyeSquintRight":0.0, "eyeWideRight":0.0, "jawForward":0.0, "jawLeft":0.0, "jawRight":0.0, "jawOpen":0.0, "mouthClose":0.0, "mouthFunnel":0.0, "mouthPucker":0.0, "mouthLeft":0.0, "mouthRight":0.0, "mouthSmileLeft":0.0, "mouthSmileRight":0.0, "mouthFrownLeft":0.0, "mouthFrownRight":0.0, "mouthDimpleLeft":0.0, "mouthDimpleRight":0.0, "mouthStretchLeft":0.0, "mouthStretchRight":0.0, "mouthRollLower":0.0, "mouthRollUpper":0.0, "mouthShrugLower":0.0, "mouthShrugUpper":0.0, "mouthPressLeft":0.0, "mouthPressRight":0.0, "mouthLowerDownLeft":0.0, "mouthLowerDownRight":0.0, "mouthUpperUpLeft":0.0, "mouthUpperUpRight":0.0, "browDownLeft":0.0, "browDownRight":0.0, "browInnerUp":0.0, "browOuterUpLeft":0.0, "browOuterUpRight":0.0, "cheekPuff":0.0, "cheekSquintLeft":0.0, "cheekSquintRight":0.0, "noseSneerLeft":0.0, "noseSneerRight":0.0, "tongueOut":0.0 }, "rotation":{"pitch":30.0, "yaw":25.5, "roll":-15.5},
1716
+ * }], "timestamp":"654879876546" }
1717
+ *
1718
+ * @returns
1719
+ * true : Facial information JSON parsing successful. false : Facial information JSON parsing failed.
1720
+ */
1721
+ onFaceInfo?(outFaceInfo: string): void;
1722
+ }
1723
+
1724
+ /**
1725
+ * @ignore
1726
+ */
1727
+ export class RecorderInfo {
1728
+ /**
1729
+ * @ignore
1730
+ */
1731
+ fileName?: string;
1732
+ /**
1733
+ * @ignore
1734
+ */
1735
+ durationMs?: number;
1736
+ /**
1737
+ * @ignore
1738
+ */
1739
+ fileSize?: number;
1740
+ }
1741
+
1742
+ /**
1743
+ * @ignore
1744
+ */
1745
+ export interface IMediaRecorderObserver {
1746
+ /**
1747
+ * @ignore
1748
+ */
1749
+ onRecorderStateChanged?(
1750
+ channelId: string,
1751
+ uid: number,
1752
+ state: RecorderState,
1753
+ reason: RecorderReasonCode
1754
+ ): void;
1755
+
1756
+ /**
1757
+ * @ignore
1758
+ */
1759
+ onRecorderInfoUpdated?(
1760
+ channelId: string,
1761
+ uid: number,
1762
+ info: RecorderInfo
1763
+ ): void;
1764
+ }