RtcEngine.cs 95 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100
  1. using System;
  2. using video_track_id_t = System.UInt32;
  3. #if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_ANDROID
  4. using UnityEngine;
  5. #endif
  6. namespace Agora.Rtc
  7. {
  8. public sealed class RtcEngine : IRtcEngineEx
  9. {
  10. private RtcEngineImpl _rtcEngineImpl = null;
  11. private IAudioDeviceManager _audioDeviceManager = null;
  12. private IVideoDeviceManager _videoDeviceManager = null;
  13. //private ICloudSpatialAudioEngine _cloudSpatialAudioEngine = null;
  14. private ILocalSpatialAudioEngine _localSpatialAudioEngine = null;
  15. private IMediaPlayerCacheManager _mediaPlayerCacheManager = null;
  16. private IMediaRecorder _mediaRecorder = null;
  17. private const int ErrorCode = -7;
  18. #if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_ANDROID
  19. private GameObject _agoraEngineObject;
  20. #endif
  21. private RtcEngine()
  22. {
  23. _rtcEngineImpl = RtcEngineImpl.GetInstance();
  24. _audioDeviceManager = AudioDeviceManager.GetInstance(this, _rtcEngineImpl.GetAudioDeviceManager());
  25. _videoDeviceManager = VideoDeviceManager.GetInstance(this, _rtcEngineImpl.GetVideoDeviceManager());
  26. //_cloudSpatialAudioEngine = CloudSpatialAudioEngine.GetInstance(this, _rtcEngineImpl.GetCloudSpatialAudioEngine());
  27. _localSpatialAudioEngine = LocalSpatialAudioEngine.GetInstance(this, _rtcEngineImpl.GetLocalSpatialAudioEngine());
  28. _mediaPlayerCacheManager = MediaPlayerCacheManager.GetInstance(this, _rtcEngineImpl.GetMediaPlayerCacheManager());
  29. _mediaRecorder = MediaRecorder.GetInstance(this, _rtcEngineImpl.GetMediaRecorder());
  30. #if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_ANDROID
  31. InitAgoraEngineObject();
  32. #endif
  33. }
  34. ~RtcEngine()
  35. {
  36. _audioDeviceManager = null;
  37. _videoDeviceManager = null;
  38. //_cloudSpatialAudioEngine = null;
  39. _localSpatialAudioEngine = null;
  40. _mediaPlayerCacheManager = null;
  41. _mediaRecorder = null;
  42. }
  43. private static IRtcEngine instance = null;
  44. public static IRtcEngine Instance
  45. {
  46. get
  47. {
  48. return instance ?? (instance = new RtcEngine());
  49. }
  50. }
  51. public static IRtcEngineEx InstanceEx
  52. {
  53. get
  54. {
  55. return (IRtcEngineEx)(instance ?? (instance = new RtcEngine()));
  56. }
  57. }
  58. public static IRtcEngine CreateAgoraRtcEngine()
  59. {
  60. return instance ?? (instance = new RtcEngine());
  61. }
  62. public static IRtcEngineEx CreateAgoraRtcEngineEx()
  63. {
  64. return (IRtcEngineEx)(instance ?? (instance = new RtcEngine()));
  65. }
  66. public static IRtcEngine Get()
  67. {
  68. return instance;
  69. }
  70. #if UNITY_EDITOR_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_IOS || UNITY_ANDROID
  71. private void InitAgoraEngineObject()
  72. {
  73. _agoraEngineObject = GameObject.Find("AgoraRtcEngineObj");
  74. if (_agoraEngineObject == null)
  75. {
  76. _agoraEngineObject = new GameObject("AgoraRtcEngineObj");
  77. UnityEngine.Object.DontDestroyOnLoad(_agoraEngineObject);
  78. _agoraEngineObject.hideFlags = HideFlags.HideInHierarchy;
  79. _agoraEngineObject.AddComponent<AgoraGameObject>();
  80. }
  81. }
  82. #endif
  83. public override int Initialize(RtcEngineContext context)
  84. {
  85. if (_rtcEngineImpl == null)
  86. {
  87. return ErrorCode;
  88. }
  89. return _rtcEngineImpl.Initialize(context);
  90. }
  91. public override void Dispose(bool sync = false)
  92. {
  93. if (_rtcEngineImpl == null)
  94. {
  95. return;
  96. }
  97. _rtcEngineImpl.Dispose(sync);
  98. _rtcEngineImpl = null;
  99. AudioDeviceManager.ReleaseInstance();
  100. VideoDeviceManager.ReleaseInstance();
  101. //CloudSpatialAudioEngine.ReleaseInstance();
  102. LocalSpatialAudioEngine.ReleaseInstance();
  103. MediaPlayerCacheManager.ReleaseInstance();
  104. MediaRecorder.ReleaseInstance();
  105. instance = null;
  106. }
  107. public override void InitEventHandler(IRtcEngineEventHandler engineEventHandler)
  108. {
  109. if (_rtcEngineImpl == null)
  110. {
  111. return;
  112. }
  113. _rtcEngineImpl.InitEventHandler(engineEventHandler);
  114. }
  115. public override void RegisterAudioFrameObserver(IAudioFrameObserver audioFrameObserver, OBSERVER_MODE mode = OBSERVER_MODE.INTPTR)
  116. {
  117. if (_rtcEngineImpl == null)
  118. {
  119. return;
  120. }
  121. _rtcEngineImpl.RegisterAudioFrameObserver(audioFrameObserver, mode);
  122. }
  123. public override void UnRegisterAudioFrameObserver()
  124. {
  125. if (_rtcEngineImpl == null)
  126. {
  127. return;
  128. }
  129. _rtcEngineImpl.UnRegisterAudioFrameObserver();
  130. }
  131. public override void RegisterVideoFrameObserver(IVideoFrameObserver videoFrameObserver, OBSERVER_MODE mode = OBSERVER_MODE.INTPTR)
  132. {
  133. if (_rtcEngineImpl == null)
  134. {
  135. return;
  136. }
  137. _rtcEngineImpl.RegisterVideoFrameObserver(videoFrameObserver, mode);
  138. }
  139. public override void UnRegisterVideoFrameObserver()
  140. {
  141. if (_rtcEngineImpl == null)
  142. {
  143. return;
  144. }
  145. _rtcEngineImpl.UnRegisterVideoFrameObserver();
  146. }
  147. public override void RegisterVideoEncodedFrameObserver(IVideoEncodedFrameObserver videoEncodedImageReceiver, OBSERVER_MODE mode = OBSERVER_MODE.INTPTR)
  148. {
  149. if (_rtcEngineImpl == null)
  150. {
  151. return;
  152. }
  153. _rtcEngineImpl.RegisterVideoEncodedFrameObserver(videoEncodedImageReceiver, mode);
  154. }
  155. public override void UnRegisterVideoEncodedFrameObserver()
  156. {
  157. if (_rtcEngineImpl == null)
  158. {
  159. return;
  160. }
  161. _rtcEngineImpl.UnRegisterVideoEncodedFrameObserver();
  162. }
  163. public override IAudioDeviceManager GetAudioDeviceManager()
  164. {
  165. if (_rtcEngineImpl == null)
  166. {
  167. return null;
  168. }
  169. return _audioDeviceManager;
  170. }
  171. public override IVideoDeviceManager GetVideoDeviceManager()
  172. {
  173. if (_rtcEngineImpl == null)
  174. {
  175. return null;
  176. }
  177. return _videoDeviceManager;
  178. }
  179. public override IMediaPlayerCacheManager GetMediaPlayerCacheManager()
  180. {
  181. if (_rtcEngineImpl == null)
  182. {
  183. return null;
  184. }
  185. return _mediaPlayerCacheManager;
  186. }
  187. public override IMediaRecorder GetMediaRecorder()
  188. {
  189. if (_rtcEngineImpl == null)
  190. {
  191. return null;
  192. }
  193. return _mediaRecorder;
  194. }
  195. public override IMediaPlayer CreateMediaPlayer()
  196. {
  197. if (_rtcEngineImpl == null)
  198. {
  199. return null;
  200. }
  201. return new MediaPlayer(this, _rtcEngineImpl.GetMediaPlayer());
  202. }
  203. public override void DestroyMediaPlayer(IMediaPlayer mediaPlayer)
  204. {
  205. if (_rtcEngineImpl == null || mediaPlayer == null)
  206. {
  207. }
  208. mediaPlayer.Dispose();
  209. }
  210. //public override ICloudSpatialAudioEngine GetCloudSpatialAudioEngine()
  211. //{
  212. // if (_rtcEngineImpl == null)
  213. // {
  214. // AgoraLog.LogError(ErrorMsgLog);
  215. // return null;
  216. // }
  217. // return _cloudSpatialAudioEngine;
  218. //}
  219. public override ILocalSpatialAudioEngine GetLocalSpatialAudioEngine()
  220. {
  221. if (_rtcEngineImpl == null)
  222. {
  223. return null;
  224. }
  225. return _localSpatialAudioEngine;
  226. }
  227. public override string GetVersion(ref int build)
  228. {
  229. if (_rtcEngineImpl == null)
  230. {
  231. build = 0;
  232. return null;
  233. }
  234. return _rtcEngineImpl.GetVersion(ref build);
  235. }
  236. public override string GetErrorDescription(int code)
  237. {
  238. if (_rtcEngineImpl == null)
  239. {
  240. return null;
  241. }
  242. return _rtcEngineImpl.GetErrorDescription(code);
  243. }
  244. public override int JoinChannel(string token, string channelId, string info = "", uint uid = 0)
  245. {
  246. if (_rtcEngineImpl == null)
  247. {
  248. return ErrorCode;
  249. }
  250. return _rtcEngineImpl.JoinChannel(token, channelId, info, uid);
  251. }
  252. public override int JoinChannel(string token, string channelId, uint uid, ChannelMediaOptions options)
  253. {
  254. if (_rtcEngineImpl == null)
  255. {
  256. return ErrorCode;
  257. }
  258. return _rtcEngineImpl.JoinChannel(token, channelId, uid, options);
  259. }
  260. public override int UpdateChannelMediaOptions(ChannelMediaOptions options)
  261. {
  262. if (_rtcEngineImpl == null)
  263. {
  264. return ErrorCode;
  265. }
  266. return _rtcEngineImpl.UpdateChannelMediaOptions(options);
  267. }
  268. public override int LeaveChannel()
  269. {
  270. if (_rtcEngineImpl == null)
  271. {
  272. return ErrorCode;
  273. }
  274. return _rtcEngineImpl.LeaveChannel();
  275. }
  276. public override int LeaveChannel(LeaveChannelOptions options)
  277. {
  278. if (_rtcEngineImpl == null)
  279. {
  280. return ErrorCode;
  281. }
  282. return _rtcEngineImpl.LeaveChannel(options);
  283. }
  284. public override int RenewToken(string token)
  285. {
  286. if (_rtcEngineImpl == null)
  287. {
  288. return ErrorCode;
  289. }
  290. return _rtcEngineImpl.RenewToken(token);
  291. }
  292. public override int SetChannelProfile(CHANNEL_PROFILE_TYPE profile)
  293. {
  294. if (_rtcEngineImpl == null)
  295. {
  296. return ErrorCode;
  297. }
  298. return _rtcEngineImpl.SetChannelProfile(profile);
  299. }
  300. public override int SetClientRole(CLIENT_ROLE_TYPE role)
  301. {
  302. if (_rtcEngineImpl == null)
  303. {
  304. return ErrorCode;
  305. }
  306. return _rtcEngineImpl.SetClientRole(role);
  307. }
  308. public override int SetClientRole(CLIENT_ROLE_TYPE role, ClientRoleOptions options)
  309. {
  310. if (_rtcEngineImpl == null)
  311. {
  312. return ErrorCode;
  313. }
  314. return _rtcEngineImpl.SetClientRole(role, options);
  315. }
  316. public override int StartEchoTest()
  317. {
  318. if (_rtcEngineImpl == null)
  319. {
  320. return ErrorCode;
  321. }
  322. return _rtcEngineImpl.StartEchoTest();
  323. }
  324. public override int StartEchoTest(int intervalInSeconds)
  325. {
  326. if (_rtcEngineImpl == null)
  327. {
  328. return ErrorCode;
  329. }
  330. return _rtcEngineImpl.StartEchoTest(intervalInSeconds);
  331. }
  332. public override int StartEchoTest(EchoTestConfiguration config)
  333. {
  334. if (_rtcEngineImpl == null)
  335. {
  336. return ErrorCode;
  337. }
  338. return _rtcEngineImpl.StartEchoTest(config);
  339. }
  340. public override int StopEchoTest()
  341. {
  342. if (_rtcEngineImpl == null)
  343. {
  344. return ErrorCode;
  345. }
  346. return _rtcEngineImpl.StopEchoTest();
  347. }
  348. public override int EnableVideo()
  349. {
  350. if (_rtcEngineImpl == null)
  351. {
  352. return ErrorCode;
  353. }
  354. return _rtcEngineImpl.EnableVideo();
  355. }
  356. public override int DisableVideo()
  357. {
  358. if (_rtcEngineImpl == null)
  359. {
  360. return ErrorCode;
  361. }
  362. return _rtcEngineImpl.DisableVideo();
  363. }
  364. public override int StartPreview()
  365. {
  366. if (_rtcEngineImpl == null)
  367. {
  368. return ErrorCode;
  369. }
  370. return _rtcEngineImpl.StartPreview();
  371. }
  372. public override int StartPreview(VIDEO_SOURCE_TYPE sourceType)
  373. {
  374. if (_rtcEngineImpl == null)
  375. {
  376. return ErrorCode;
  377. }
  378. return _rtcEngineImpl.StartPreview();
  379. }
  380. public override int StopPreview()
  381. {
  382. if (_rtcEngineImpl == null)
  383. {
  384. return ErrorCode;
  385. }
  386. return _rtcEngineImpl.StopPreview();
  387. }
  388. public override int StopPreview(VIDEO_SOURCE_TYPE sourceType)
  389. {
  390. if (_rtcEngineImpl == null)
  391. {
  392. return ErrorCode;
  393. }
  394. return _rtcEngineImpl.StopPreview(sourceType);
  395. }
  396. public override int StartLastmileProbeTest(LastmileProbeConfig config)
  397. {
  398. if (_rtcEngineImpl == null)
  399. {
  400. return ErrorCode;
  401. }
  402. return _rtcEngineImpl.StartLastmileProbeTest(config);
  403. }
  404. public override int StopLastmileProbeTest()
  405. {
  406. if (_rtcEngineImpl == null)
  407. {
  408. return ErrorCode;
  409. }
  410. return _rtcEngineImpl.StopLastmileProbeTest();
  411. }
  412. public override int SetVideoEncoderConfiguration(VideoEncoderConfiguration config)
  413. {
  414. if (_rtcEngineImpl == null)
  415. {
  416. return ErrorCode;
  417. }
  418. return _rtcEngineImpl.SetVideoEncoderConfiguration(config);
  419. }
  420. public override int SetBeautyEffectOptions(bool enabled, BeautyOptions options, MEDIA_SOURCE_TYPE type = MEDIA_SOURCE_TYPE.PRIMARY_CAMERA_SOURCE)
  421. {
  422. if (_rtcEngineImpl == null)
  423. {
  424. return ErrorCode;
  425. }
  426. return _rtcEngineImpl.SetBeautyEffectOptions(enabled, options, type);
  427. }
  428. public override int EnableVirtualBackground(bool enabled, VirtualBackgroundSource backgroundSource, SegmentationProperty segproperty, MEDIA_SOURCE_TYPE type = MEDIA_SOURCE_TYPE.PRIMARY_CAMERA_SOURCE)
  429. {
  430. if (_rtcEngineImpl == null)
  431. {
  432. return ErrorCode;
  433. }
  434. return _rtcEngineImpl.EnableVirtualBackground(enabled, backgroundSource, segproperty, type);
  435. }
  436. public override int SetupRemoteVideo(VideoCanvas canvas)
  437. {
  438. if (_rtcEngineImpl == null)
  439. {
  440. return ErrorCode;
  441. }
  442. return _rtcEngineImpl.SetupRemoteVideo(canvas);
  443. }
  444. public override int SetupLocalVideo(VideoCanvas canvas)
  445. {
  446. if (_rtcEngineImpl == null)
  447. {
  448. return ErrorCode;
  449. }
  450. return _rtcEngineImpl.SetupLocalVideo(canvas);
  451. }
  452. public override int EnableAudio()
  453. {
  454. if (_rtcEngineImpl == null)
  455. {
  456. return ErrorCode;
  457. }
  458. return _rtcEngineImpl.EnableAudio();
  459. }
  460. public override int DisableAudio()
  461. {
  462. if (_rtcEngineImpl == null)
  463. {
  464. return ErrorCode;
  465. }
  466. return _rtcEngineImpl.DisableAudio();
  467. }
  468. public override int SetAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario)
  469. {
  470. if (_rtcEngineImpl == null)
  471. {
  472. return ErrorCode;
  473. }
  474. return _rtcEngineImpl.SetAudioProfile(profile, scenario);
  475. }
  476. public override int SetAudioScenario(AUDIO_SCENARIO_TYPE scenario)
  477. {
  478. if (_rtcEngineImpl == null)
  479. {
  480. return ErrorCode;
  481. }
  482. return _rtcEngineImpl.SetAudioScenario(scenario);
  483. }
  484. public override int SetAudioProfile(AUDIO_PROFILE_TYPE profile)
  485. {
  486. if (_rtcEngineImpl == null)
  487. {
  488. return ErrorCode;
  489. }
  490. return _rtcEngineImpl.SetAudioProfile(profile);
  491. }
  492. public override int EnableLocalAudio(bool enabled)
  493. {
  494. if (_rtcEngineImpl == null)
  495. {
  496. return ErrorCode;
  497. }
  498. return _rtcEngineImpl.EnableLocalAudio(enabled);
  499. }
  500. public override int MuteLocalAudioStream(bool mute)
  501. {
  502. if (_rtcEngineImpl == null)
  503. {
  504. return ErrorCode;
  505. }
  506. return _rtcEngineImpl.MuteLocalAudioStream(mute);
  507. }
  508. public override int MuteAllRemoteAudioStreams(bool mute)
  509. {
  510. if (_rtcEngineImpl == null)
  511. {
  512. return ErrorCode;
  513. }
  514. return _rtcEngineImpl.MuteAllRemoteAudioStreams(mute);
  515. }
  516. public override int SetDefaultMuteAllRemoteAudioStreams(bool mute)
  517. {
  518. if (_rtcEngineImpl == null)
  519. {
  520. return ErrorCode;
  521. }
  522. return _rtcEngineImpl.SetDefaultMuteAllRemoteAudioStreams(mute);
  523. }
  524. public override int MuteRemoteAudioStream(uint uid, bool mute)
  525. {
  526. if (_rtcEngineImpl == null)
  527. {
  528. return ErrorCode;
  529. }
  530. return _rtcEngineImpl.MuteRemoteAudioStream(uid, mute);
  531. }
  532. public override int MuteLocalVideoStream(bool mute)
  533. {
  534. if (_rtcEngineImpl == null)
  535. {
  536. return ErrorCode;
  537. }
  538. return _rtcEngineImpl.MuteLocalVideoStream(mute);
  539. }
  540. public override int EnableLocalVideo(bool enabled)
  541. {
  542. if (_rtcEngineImpl == null)
  543. {
  544. return ErrorCode;
  545. }
  546. return _rtcEngineImpl.EnableLocalVideo(enabled);
  547. }
  548. public override int MuteAllRemoteVideoStreams(bool mute)
  549. {
  550. if (_rtcEngineImpl == null)
  551. {
  552. return ErrorCode;
  553. }
  554. return _rtcEngineImpl.MuteAllRemoteVideoStreams(mute);
  555. }
  556. public override int SetDefaultMuteAllRemoteVideoStreams(bool mute)
  557. {
  558. if (_rtcEngineImpl == null)
  559. {
  560. return ErrorCode;
  561. }
  562. return _rtcEngineImpl.SetDefaultMuteAllRemoteVideoStreams(mute);
  563. }
  564. public override int EnableVideoImageSource(bool enable, ImageTrackOptions options)
  565. {
  566. if (_rtcEngineImpl == null)
  567. {
  568. return ErrorCode;
  569. }
  570. return _rtcEngineImpl.EnableVideoImageSource(enable, options);
  571. }
  572. public override int SetColorEnhanceOptions(bool enabled, ColorEnhanceOptions options, MEDIA_SOURCE_TYPE type = MEDIA_SOURCE_TYPE.PRIMARY_CAMERA_SOURCE)
  573. {
  574. if (_rtcEngineImpl == null)
  575. {
  576. return ErrorCode;
  577. }
  578. return _rtcEngineImpl.SetColorEnhanceOptions(enabled, options, type);
  579. }
  580. public override int SetLowlightEnhanceOptions(bool enabled, LowlightEnhanceOptions options, MEDIA_SOURCE_TYPE type = MEDIA_SOURCE_TYPE.PRIMARY_CAMERA_SOURCE)
  581. {
  582. if (_rtcEngineImpl == null)
  583. {
  584. return ErrorCode;
  585. }
  586. return _rtcEngineImpl.SetLowlightEnhanceOptions(enabled, options, type);
  587. }
  588. public override int SetRemoteVideoSubscriptionOptions(uint uid, VideoSubscriptionOptions options)
  589. {
  590. if (_rtcEngineImpl == null)
  591. {
  592. return ErrorCode;
  593. }
  594. return _rtcEngineImpl.SetRemoteVideoSubscriptionOptions(uid, options);
  595. }
  596. public override int SetVideoDenoiserOptions(bool enabled, VideoDenoiserOptions options, MEDIA_SOURCE_TYPE type = MEDIA_SOURCE_TYPE.PRIMARY_CAMERA_SOURCE)
  597. {
  598. if (_rtcEngineImpl == null)
  599. {
  600. return ErrorCode;
  601. }
  602. return _rtcEngineImpl.SetVideoDenoiserOptions(enabled, options, type);
  603. }
  604. public override int MuteRemoteVideoStream(uint uid, bool mute)
  605. {
  606. if (_rtcEngineImpl == null)
  607. {
  608. return ErrorCode;
  609. }
  610. return _rtcEngineImpl.MuteRemoteVideoStream(uid, mute);
  611. }
  612. public override int SetRemoteVideoStreamType(uint uid, VIDEO_STREAM_TYPE streamType)
  613. {
  614. if (_rtcEngineImpl == null)
  615. {
  616. return ErrorCode;
  617. }
  618. return _rtcEngineImpl.SetRemoteVideoStreamType(uid, streamType);
  619. }
  620. public override int SetRemoteDefaultVideoStreamType(VIDEO_STREAM_TYPE streamType)
  621. {
  622. if (_rtcEngineImpl == null)
  623. {
  624. return ErrorCode;
  625. }
  626. return _rtcEngineImpl.SetRemoteDefaultVideoStreamType(streamType);
  627. }
  628. public override int SetDualStreamMode(SIMULCAST_STREAM_MODE mode)
  629. {
  630. if (_rtcEngineImpl == null)
  631. {
  632. return ErrorCode;
  633. }
  634. return _rtcEngineImpl.SetDualStreamMode(mode);
  635. }
  636. public override int SetDualStreamMode(VIDEO_SOURCE_TYPE sourceType, SIMULCAST_STREAM_MODE mode)
  637. {
  638. if (_rtcEngineImpl == null)
  639. {
  640. return ErrorCode;
  641. }
  642. return _rtcEngineImpl.SetDualStreamMode(sourceType, mode);
  643. }
  644. public override int SetDualStreamMode(VIDEO_SOURCE_TYPE sourceType, SIMULCAST_STREAM_MODE mode, SimulcastStreamConfig streamConfig)
  645. {
  646. if (_rtcEngineImpl == null)
  647. {
  648. return ErrorCode;
  649. }
  650. return _rtcEngineImpl.SetDualStreamMode(sourceType, mode, streamConfig);
  651. }
  652. public override int SetDualStreamModeEx(VIDEO_SOURCE_TYPE sourceType, SIMULCAST_STREAM_MODE mode, SimulcastStreamConfig streamConfig, RtcConnection connection)
  653. {
  654. if (_rtcEngineImpl == null)
  655. {
  656. return ErrorCode;
  657. }
  658. return _rtcEngineImpl.SetDualStreamModeEx(sourceType, mode, streamConfig, connection);
  659. }
  660. public override int TakeSnapshotEx(RtcConnection connection, uint uid, string filePath)
  661. {
  662. if (_rtcEngineImpl == null)
  663. {
  664. return ErrorCode;
  665. }
  666. return _rtcEngineImpl.TakeSnapshotEx(connection, uid, filePath);
  667. }
  668. public override int EnableAudioVolumeIndication(int interval, int smooth, bool reportVad)
  669. {
  670. if (_rtcEngineImpl == null)
  671. {
  672. return ErrorCode;
  673. }
  674. return _rtcEngineImpl.EnableAudioVolumeIndication(interval, smooth, reportVad);
  675. }
  676. public override int StartAudioRecording(string filePath, AUDIO_RECORDING_QUALITY_TYPE quality)
  677. {
  678. if (_rtcEngineImpl == null)
  679. {
  680. return ErrorCode;
  681. }
  682. return _rtcEngineImpl.StartAudioRecording(filePath, quality);
  683. }
  684. public override int StartAudioRecording(string filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality)
  685. {
  686. if (_rtcEngineImpl == null)
  687. {
  688. return ErrorCode;
  689. }
  690. return _rtcEngineImpl.StartAudioRecording(filePath, sampleRate, quality);
  691. }
  692. public override int StartAudioRecording(AudioRecordingConfiguration config)
  693. {
  694. if (_rtcEngineImpl == null)
  695. {
  696. return ErrorCode;
  697. }
  698. return _rtcEngineImpl.StartAudioRecording(config);
  699. }
  700. public override void RegisterAudioEncodedFrameObserver(AudioEncodedFrameObserverConfig config, IAudioEncodedFrameObserver observer)
  701. {
  702. if (_rtcEngineImpl == null)
  703. {
  704. return;
  705. }
  706. _rtcEngineImpl.RegisterAudioEncodedFrameObserver(config, observer);
  707. }
  708. public override void UnRegisterAudioEncodedFrameObserver()
  709. {
  710. if (_rtcEngineImpl == null)
  711. {
  712. return;
  713. }
  714. _rtcEngineImpl.UnRegisterAudioEncodedFrameObserver();
  715. }
  716. public override int StopAudioRecording()
  717. {
  718. if (_rtcEngineImpl == null)
  719. {
  720. return ErrorCode;
  721. }
  722. return _rtcEngineImpl.StopAudioRecording();
  723. }
  724. public override int StartAudioMixing(string filePath, bool loopback, int cycle)
  725. {
  726. if (_rtcEngineImpl == null)
  727. {
  728. return ErrorCode;
  729. }
  730. return _rtcEngineImpl.StartAudioMixing(filePath, loopback, cycle);
  731. }
  732. public override int StartAudioMixing(string filePath, bool loopback, int cycle, int startPos)
  733. {
  734. if (_rtcEngineImpl == null)
  735. {
  736. return ErrorCode;
  737. }
  738. return _rtcEngineImpl.StartAudioMixing(filePath, loopback, cycle, startPos);
  739. }
  740. public override int SetAudioMixingDualMonoMode(AUDIO_MIXING_DUAL_MONO_MODE mode)
  741. {
  742. if (_rtcEngineImpl == null)
  743. {
  744. return ErrorCode;
  745. }
  746. return _rtcEngineImpl.SetAudioMixingDualMonoMode(mode);
  747. }
  748. public override int StopAudioMixing()
  749. {
  750. if (_rtcEngineImpl == null)
  751. {
  752. return ErrorCode;
  753. }
  754. return _rtcEngineImpl.StopAudioMixing();
  755. }
  756. public override int PauseAudioMixing()
  757. {
  758. if (_rtcEngineImpl == null)
  759. {
  760. return ErrorCode;
  761. }
  762. return _rtcEngineImpl.PauseAudioMixing();
  763. }
  764. public override int ResumeAudioMixing()
  765. {
  766. if (_rtcEngineImpl == null)
  767. {
  768. return ErrorCode;
  769. }
  770. return _rtcEngineImpl.ResumeAudioMixing();
  771. }
  772. public override int AdjustAudioMixingVolume(int volume)
  773. {
  774. if (_rtcEngineImpl == null)
  775. {
  776. return ErrorCode;
  777. }
  778. return _rtcEngineImpl.AdjustAudioMixingVolume(volume);
  779. }
  780. public override int AdjustAudioMixingPublishVolume(int volume)
  781. {
  782. if (_rtcEngineImpl == null)
  783. {
  784. return ErrorCode;
  785. }
  786. return _rtcEngineImpl.AdjustAudioMixingPublishVolume(volume);
  787. }
  788. public override int GetAudioMixingPublishVolume()
  789. {
  790. if (_rtcEngineImpl == null)
  791. {
  792. return ErrorCode;
  793. }
  794. return _rtcEngineImpl.GetAudioMixingPublishVolume();
  795. }
  796. public override int AdjustAudioMixingPlayoutVolume(int volume)
  797. {
  798. if (_rtcEngineImpl == null)
  799. {
  800. return ErrorCode;
  801. }
  802. return _rtcEngineImpl.AdjustAudioMixingPlayoutVolume(volume);
  803. }
  804. public override int GetAudioMixingPlayoutVolume()
  805. {
  806. if (_rtcEngineImpl == null)
  807. {
  808. return ErrorCode;
  809. }
  810. return _rtcEngineImpl.GetAudioMixingPlayoutVolume();
  811. }
  812. public override int GetAudioMixingDuration()
  813. {
  814. if (_rtcEngineImpl == null)
  815. {
  816. return ErrorCode;
  817. }
  818. return _rtcEngineImpl.GetAudioMixingDuration();
  819. }
  820. public override int GetAudioMixingCurrentPosition()
  821. {
  822. if (_rtcEngineImpl == null)
  823. {
  824. return ErrorCode;
  825. }
  826. return _rtcEngineImpl.GetAudioMixingCurrentPosition();
  827. }
  828. public override int SetAudioMixingPosition(int pos)
  829. {
  830. if (_rtcEngineImpl == null)
  831. {
  832. return ErrorCode;
  833. }
  834. return _rtcEngineImpl.SetAudioMixingPosition(pos);
  835. }
  836. public override int SetAudioMixingPitch(int pitch)
  837. {
  838. if (_rtcEngineImpl == null)
  839. {
  840. return ErrorCode;
  841. }
  842. return _rtcEngineImpl.SetAudioMixingPitch(pitch);
  843. }
  844. public override int GetEffectsVolume()
  845. {
  846. if (_rtcEngineImpl == null)
  847. {
  848. return ErrorCode;
  849. }
  850. return _rtcEngineImpl.GetEffectsVolume();
  851. }
  852. public override int SetEffectsVolume(int volume)
  853. {
  854. if (_rtcEngineImpl == null)
  855. {
  856. return ErrorCode;
  857. }
  858. return _rtcEngineImpl.SetEffectsVolume(volume);
  859. }
  860. public override int PreloadEffect(int soundId, string filePath, int startPos = 0)
  861. {
  862. if (_rtcEngineImpl == null)
  863. {
  864. return ErrorCode;
  865. }
  866. return _rtcEngineImpl.PreloadEffect(soundId, filePath, startPos);
  867. }
  868. public override int PlayEffect(int soundId, string filePath, int loopCount, double pitch, double pan, int gain, bool publish = false, int startPos = 0)
  869. {
  870. if (_rtcEngineImpl == null)
  871. {
  872. return ErrorCode;
  873. }
  874. return _rtcEngineImpl.PlayEffect(soundId, filePath, loopCount, pitch, pan, gain, publish, startPos);
  875. }
  876. public override int PlayAllEffects(int loopCount, double pitch, double pan, int gain, bool publish = false)
  877. {
  878. if (_rtcEngineImpl == null)
  879. {
  880. return ErrorCode;
  881. }
  882. return _rtcEngineImpl.PlayAllEffects(loopCount, pitch, pan, gain, publish);
  883. }
  884. public override int GetVolumeOfEffect(int soundId)
  885. {
  886. if (_rtcEngineImpl == null)
  887. {
  888. return ErrorCode;
  889. }
  890. return _rtcEngineImpl.GetVolumeOfEffect(soundId);
  891. }
  892. public override int SetVolumeOfEffect(int soundId, int volume)
  893. {
  894. if (_rtcEngineImpl == null)
  895. {
  896. return ErrorCode;
  897. }
  898. return _rtcEngineImpl.SetVolumeOfEffect(soundId, volume);
  899. }
  900. public override int PauseEffect(int soundId)
  901. {
  902. if (_rtcEngineImpl == null)
  903. {
  904. return ErrorCode;
  905. }
  906. return _rtcEngineImpl.PauseEffect(soundId);
  907. }
  908. public override int PauseAllEffects()
  909. {
  910. if (_rtcEngineImpl == null)
  911. {
  912. return ErrorCode;
  913. }
  914. return _rtcEngineImpl.PauseAllEffects();
  915. }
  916. public override int ResumeEffect(int soundId)
  917. {
  918. if (_rtcEngineImpl == null)
  919. {
  920. return ErrorCode;
  921. }
  922. return _rtcEngineImpl.ResumeEffect(soundId);
  923. }
  924. public override int ResumeAllEffects()
  925. {
  926. if (_rtcEngineImpl == null)
  927. {
  928. return ErrorCode;
  929. }
  930. return _rtcEngineImpl.ResumeAllEffects();
  931. }
  932. public override int StopEffect(int soundId)
  933. {
  934. if (_rtcEngineImpl == null)
  935. {
  936. return ErrorCode;
  937. }
  938. return _rtcEngineImpl.StopEffect(soundId);
  939. }
  940. public override int StopAllEffects()
  941. {
  942. if (_rtcEngineImpl == null)
  943. {
  944. return ErrorCode;
  945. }
  946. return _rtcEngineImpl.StopAllEffects();
  947. }
  948. public override int UnloadEffect(int soundId)
  949. {
  950. if (_rtcEngineImpl == null)
  951. {
  952. return ErrorCode;
  953. }
  954. return _rtcEngineImpl.UnloadEffect(soundId);
  955. }
  956. public override int UnloadAllEffects()
  957. {
  958. if (_rtcEngineImpl == null)
  959. {
  960. return ErrorCode;
  961. }
  962. return _rtcEngineImpl.UnloadAllEffects();
  963. }
  964. public override int GetEffectCurrentPosition(int soundId)
  965. {
  966. if (_rtcEngineImpl == null)
  967. {
  968. return ErrorCode;
  969. }
  970. return _rtcEngineImpl.GetEffectCurrentPosition(soundId);
  971. }
  972. public override int GetEffectDuration(string filePath)
  973. {
  974. if (_rtcEngineImpl == null)
  975. {
  976. return ErrorCode;
  977. }
  978. return _rtcEngineImpl.GetEffectDuration(filePath);
  979. }
  980. public override int SetEffectPosition(int soundId, int pos)
  981. {
  982. if (_rtcEngineImpl == null)
  983. {
  984. return ErrorCode;
  985. }
  986. return _rtcEngineImpl.SetEffectPosition(soundId, pos);
  987. }
  988. public override int EnableSoundPositionIndication(bool enabled)
  989. {
  990. if (_rtcEngineImpl == null)
  991. {
  992. return ErrorCode;
  993. }
  994. return _rtcEngineImpl.EnableSoundPositionIndication(enabled);
  995. }
  996. public override int SetRemoteVoicePosition(uint uid, double pan, double gain)
  997. {
  998. if (_rtcEngineImpl == null)
  999. {
  1000. return ErrorCode;
  1001. }
  1002. return _rtcEngineImpl.SetRemoteVoicePosition(uid, pan, gain);
  1003. }
  1004. public override int EnableSpatialAudio(bool enabled)
  1005. {
  1006. if (_rtcEngineImpl == null)
  1007. {
  1008. return ErrorCode;
  1009. }
  1010. return _rtcEngineImpl.EnableSpatialAudio(enabled);
  1011. }
  1012. public override int SetRemoteUserSpatialAudioParams(uint uid, SpatialAudioParams param)
  1013. {
  1014. if (_rtcEngineImpl == null)
  1015. {
  1016. return ErrorCode;
  1017. }
  1018. return _rtcEngineImpl.SetRemoteUserSpatialAudioParams(uid, param);
  1019. }
  1020. public override int SetVoiceBeautifierPreset(VOICE_BEAUTIFIER_PRESET preset)
  1021. {
  1022. if (_rtcEngineImpl == null)
  1023. {
  1024. return ErrorCode;
  1025. }
  1026. return _rtcEngineImpl.SetVoiceBeautifierPreset(preset);
  1027. }
  1028. public override int SetAudioEffectPreset(AUDIO_EFFECT_PRESET preset)
  1029. {
  1030. if (_rtcEngineImpl == null)
  1031. {
  1032. return ErrorCode;
  1033. }
  1034. return _rtcEngineImpl.SetAudioEffectPreset(preset);
  1035. }
  1036. public override int SetVoiceConversionPreset(VOICE_CONVERSION_PRESET preset)
  1037. {
  1038. if (_rtcEngineImpl == null)
  1039. {
  1040. return ErrorCode;
  1041. }
  1042. return _rtcEngineImpl.SetVoiceConversionPreset(preset);
  1043. }
  1044. public override int SetAudioEffectParameters(AUDIO_EFFECT_PRESET preset, int param1, int param2)
  1045. {
  1046. if (_rtcEngineImpl == null)
  1047. {
  1048. return ErrorCode;
  1049. }
  1050. return _rtcEngineImpl.SetAudioEffectParameters(preset, param1, param2);
  1051. }
  1052. public override int SetVoiceBeautifierParameters(VOICE_BEAUTIFIER_PRESET preset, int param1, int param2)
  1053. {
  1054. if (_rtcEngineImpl == null)
  1055. {
  1056. return ErrorCode;
  1057. }
  1058. return _rtcEngineImpl.SetVoiceBeautifierParameters(preset, param1, param2);
  1059. }
  1060. public override int SetVoiceConversionParameters(VOICE_CONVERSION_PRESET preset, int param1, int param2)
  1061. {
  1062. if (_rtcEngineImpl == null)
  1063. {
  1064. return ErrorCode;
  1065. }
  1066. return _rtcEngineImpl.SetVoiceConversionParameters(preset, param1, param2);
  1067. }
  1068. public override int SetLocalVoicePitch(double pitch)
  1069. {
  1070. if (_rtcEngineImpl == null)
  1071. {
  1072. return ErrorCode;
  1073. }
  1074. return _rtcEngineImpl.SetLocalVoicePitch(pitch);
  1075. }
  1076. public override int SetLocalVoiceEqualization(AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain)
  1077. {
  1078. if (_rtcEngineImpl == null)
  1079. {
  1080. return ErrorCode;
  1081. }
  1082. return _rtcEngineImpl.SetLocalVoiceEqualization(bandFrequency, bandGain);
  1083. }
  1084. public override int SetLocalVoiceReverb(AUDIO_REVERB_TYPE reverbKey, int value)
  1085. {
  1086. if (_rtcEngineImpl == null)
  1087. {
  1088. return ErrorCode;
  1089. }
  1090. return _rtcEngineImpl.SetLocalVoiceReverb(reverbKey, value);
  1091. }
  1092. public override int SetLogFile(string filePath)
  1093. {
  1094. if (_rtcEngineImpl == null)
  1095. {
  1096. return ErrorCode;
  1097. }
  1098. return _rtcEngineImpl.SetLogFile(filePath);
  1099. }
  1100. public override int SetLogFilter(uint filter)
  1101. {
  1102. if (_rtcEngineImpl == null)
  1103. {
  1104. return ErrorCode;
  1105. }
  1106. return _rtcEngineImpl.SetLogFilter(filter);
  1107. }
  1108. public override int SetLogLevel(LOG_LEVEL level)
  1109. {
  1110. if (_rtcEngineImpl == null)
  1111. {
  1112. return ErrorCode;
  1113. }
  1114. return _rtcEngineImpl.SetLogLevel(level);
  1115. }
  1116. public override int SetLogFileSize(uint fileSizeInKBytes)
  1117. {
  1118. if (_rtcEngineImpl == null)
  1119. {
  1120. return ErrorCode;
  1121. }
  1122. return _rtcEngineImpl.SetLogFileSize(fileSizeInKBytes);
  1123. }
  1124. public override int SetLocalRenderMode(RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)
  1125. {
  1126. if (_rtcEngineImpl == null)
  1127. {
  1128. return ErrorCode;
  1129. }
  1130. return _rtcEngineImpl.SetLocalRenderMode(renderMode, mirrorMode);
  1131. }
  1132. public override int SetRemoteRenderMode(uint uid, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)
  1133. {
  1134. if (_rtcEngineImpl == null)
  1135. {
  1136. return ErrorCode;
  1137. }
  1138. return _rtcEngineImpl.SetRemoteRenderMode(uid, renderMode, mirrorMode);
  1139. }
  1140. public override int SetLocalRenderMode(RENDER_MODE_TYPE renderMode)
  1141. {
  1142. if (_rtcEngineImpl == null)
  1143. {
  1144. return ErrorCode;
  1145. }
  1146. return _rtcEngineImpl.SetLocalRenderMode(renderMode);
  1147. }
  1148. public override int SetLocalVideoMirrorMode(VIDEO_MIRROR_MODE_TYPE mirrorMode)
  1149. {
  1150. if (_rtcEngineImpl == null)
  1151. {
  1152. return ErrorCode;
  1153. }
  1154. return _rtcEngineImpl.SetLocalVideoMirrorMode(mirrorMode);
  1155. }
  1156. public override int EnableDualStreamMode(bool enabled)
  1157. {
  1158. if (_rtcEngineImpl == null)
  1159. {
  1160. return ErrorCode;
  1161. }
  1162. return _rtcEngineImpl.EnableDualStreamMode(enabled);
  1163. }
  1164. public override int EnableDualStreamMode(VIDEO_SOURCE_TYPE sourceType, bool enabled)
  1165. {
  1166. if (_rtcEngineImpl == null)
  1167. {
  1168. return ErrorCode;
  1169. }
  1170. return _rtcEngineImpl.EnableDualStreamMode(sourceType, enabled);
  1171. }
  1172. public override int EnableDualStreamMode(VIDEO_SOURCE_TYPE sourceType, bool enabled, SimulcastStreamConfig streamConfig)
  1173. {
  1174. if (_rtcEngineImpl == null)
  1175. {
  1176. return ErrorCode;
  1177. }
  1178. return _rtcEngineImpl.EnableDualStreamMode(sourceType, enabled, streamConfig);
  1179. }
  1180. public override int SetExternalAudioSink(bool enabled, int sampleRate, int channels)
  1181. {
  1182. if (_rtcEngineImpl == null)
  1183. {
  1184. return ErrorCode;
  1185. }
  1186. return _rtcEngineImpl.SetExternalAudioSink(enabled, sampleRate, channels);
  1187. }
  1188. public override int StartPrimaryCustomAudioTrack(AudioTrackConfig config)
  1189. {
  1190. if (_rtcEngineImpl == null)
  1191. {
  1192. return ErrorCode;
  1193. }
  1194. return _rtcEngineImpl.StartPrimaryCustomAudioTrack(config);
  1195. }
  1196. public override int StopPrimaryCustomAudioTrack()
  1197. {
  1198. if (_rtcEngineImpl == null)
  1199. {
  1200. return ErrorCode;
  1201. }
  1202. return _rtcEngineImpl.StopPrimaryCustomAudioTrack();
  1203. }
  1204. public override int StartSecondaryCustomAudioTrack(AudioTrackConfig config)
  1205. {
  1206. if (_rtcEngineImpl == null)
  1207. {
  1208. return ErrorCode;
  1209. }
  1210. return _rtcEngineImpl.StartSecondaryCustomAudioTrack(config);
  1211. }
  1212. public override int StopSecondaryCustomAudioTrack()
  1213. {
  1214. if (_rtcEngineImpl == null)
  1215. {
  1216. return ErrorCode;
  1217. }
  1218. return _rtcEngineImpl.StopSecondaryCustomAudioTrack();
  1219. }
  1220. public override int SetRecordingAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)
  1221. {
  1222. if (_rtcEngineImpl == null)
  1223. {
  1224. return ErrorCode;
  1225. }
  1226. return _rtcEngineImpl.SetRecordingAudioFrameParameters(sampleRate, channel, mode, samplesPerCall);
  1227. }
  1228. public override int SetPlaybackAudioFrameParameters(int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)
  1229. {
  1230. if (_rtcEngineImpl == null)
  1231. {
  1232. return ErrorCode;
  1233. }
  1234. return _rtcEngineImpl.SetPlaybackAudioFrameParameters(sampleRate, channel, mode, samplesPerCall);
  1235. }
  1236. public override int SetMixedAudioFrameParameters(int sampleRate, int channel, int samplesPerCall)
  1237. {
  1238. if (_rtcEngineImpl == null)
  1239. {
  1240. return ErrorCode;
  1241. }
  1242. return _rtcEngineImpl.SetMixedAudioFrameParameters(sampleRate, channel, samplesPerCall);
  1243. }
  1244. public override int SetPlaybackAudioFrameBeforeMixingParameters(int sampleRate, int channel)
  1245. {
  1246. if (_rtcEngineImpl == null)
  1247. {
  1248. return ErrorCode;
  1249. }
  1250. return _rtcEngineImpl.SetPlaybackAudioFrameBeforeMixingParameters(sampleRate, channel);
  1251. }
  1252. public override int EnableAudioSpectrumMonitor(int intervalInMS = 100)
  1253. {
  1254. if (_rtcEngineImpl == null)
  1255. {
  1256. return ErrorCode;
  1257. }
  1258. return _rtcEngineImpl.EnableAudioSpectrumMonitor(intervalInMS);
  1259. }
  1260. public override int DisableAudioSpectrumMonitor()
  1261. {
  1262. if (_rtcEngineImpl == null)
  1263. {
  1264. return ErrorCode;
  1265. }
  1266. return _rtcEngineImpl.DisableAudioSpectrumMonitor();
  1267. }
  1268. public override void RegisterAudioSpectrumObserver(IAudioSpectrumObserver observer)
  1269. {
  1270. if (_rtcEngineImpl == null)
  1271. {
  1272. return;
  1273. }
  1274. _rtcEngineImpl.RegisterAudioSpectrumObserver(observer);
  1275. }
  1276. public override void UnregisterAudioSpectrumObserver()
  1277. {
  1278. if (_rtcEngineImpl == null)
  1279. {
  1280. return;
  1281. }
  1282. _rtcEngineImpl.UnregisterAudioSpectrumObserver();
  1283. }
  1284. public override int AdjustRecordingSignalVolume(int volume)
  1285. {
  1286. if (_rtcEngineImpl == null)
  1287. {
  1288. return ErrorCode;
  1289. }
  1290. return _rtcEngineImpl.AdjustRecordingSignalVolume(volume);
  1291. }
  1292. public override int MuteRecordingSignal(bool mute)
  1293. {
  1294. if (_rtcEngineImpl == null)
  1295. {
  1296. return ErrorCode;
  1297. }
  1298. return _rtcEngineImpl.MuteRecordingSignal(mute);
  1299. }
  1300. public override int AdjustPlaybackSignalVolume(int volume)
  1301. {
  1302. if (_rtcEngineImpl == null)
  1303. {
  1304. return ErrorCode;
  1305. }
  1306. return _rtcEngineImpl.AdjustPlaybackSignalVolume(volume);
  1307. }
  1308. public override int AdjustLoopbackSignalVolume(int volume)
  1309. {
  1310. if (_rtcEngineImpl == null)
  1311. {
  1312. return ErrorCode;
  1313. }
  1314. return _rtcEngineImpl.AdjustLoopbackSignalVolume(volume);
  1315. }
  1316. public override int AdjustUserPlaybackSignalVolume(uint uid, int volume)
  1317. {
  1318. if (_rtcEngineImpl == null)
  1319. {
  1320. return ErrorCode;
  1321. }
  1322. return _rtcEngineImpl.AdjustUserPlaybackSignalVolume(uid, volume);
  1323. }
  1324. public override int EnableLoopbackRecording(bool enabled, string deviceName = "")
  1325. {
  1326. if (_rtcEngineImpl == null)
  1327. {
  1328. return ErrorCode;
  1329. }
  1330. return _rtcEngineImpl.EnableLoopbackRecording(enabled, deviceName);
  1331. }
  1332. public override int GetLoopbackRecordingVolume()
  1333. {
  1334. if (_rtcEngineImpl == null)
  1335. {
  1336. return ErrorCode;
  1337. }
  1338. return _rtcEngineImpl.GetLoopbackRecordingVolume();
  1339. }
  1340. public override int EnableInEarMonitoring(bool enabled, int includeAudioFilters)
  1341. {
  1342. if (_rtcEngineImpl == null)
  1343. {
  1344. return ErrorCode;
  1345. }
  1346. return _rtcEngineImpl.EnableInEarMonitoring(enabled, includeAudioFilters);
  1347. }
  1348. public override int SetInEarMonitoringVolume(int volume)
  1349. {
  1350. if (_rtcEngineImpl == null)
  1351. {
  1352. return ErrorCode;
  1353. }
  1354. return _rtcEngineImpl.SetInEarMonitoringVolume(volume);
  1355. }
  1356. public override int LoadExtensionProvider(string path, bool unload_after_use = false)
  1357. {
  1358. if (_rtcEngineImpl == null)
  1359. {
  1360. return ErrorCode;
  1361. }
  1362. return _rtcEngineImpl.LoadExtensionProvider(path, unload_after_use);
  1363. }
  1364. public override int SetExtensionProviderProperty(string provider, string key, string value)
  1365. {
  1366. if (_rtcEngineImpl == null)
  1367. {
  1368. return ErrorCode;
  1369. }
  1370. return _rtcEngineImpl.SetExtensionProviderProperty(provider, key, value);
  1371. }
  1372. public override int EnableExtension(string provider, string extension, bool enable = true, MEDIA_SOURCE_TYPE type = MEDIA_SOURCE_TYPE.UNKNOWN_MEDIA_SOURCE)
  1373. {
  1374. if (_rtcEngineImpl == null)
  1375. {
  1376. return ErrorCode;
  1377. }
  1378. return _rtcEngineImpl.EnableExtension(provider, extension, enable, type);
  1379. }
  1380. public override int SetExtensionProperty(string provider, string extension, string key, string value, MEDIA_SOURCE_TYPE type = MEDIA_SOURCE_TYPE.UNKNOWN_MEDIA_SOURCE)
  1381. {
  1382. if (_rtcEngineImpl == null)
  1383. {
  1384. return ErrorCode;
  1385. }
  1386. return _rtcEngineImpl.SetExtensionProperty(provider, extension, key, value, type);
  1387. }
  1388. public override int GetExtensionProperty(string provider, string extension, string key, ref string value, int buf_len, MEDIA_SOURCE_TYPE type = MEDIA_SOURCE_TYPE.UNKNOWN_MEDIA_SOURCE)
  1389. {
  1390. if (_rtcEngineImpl == null)
  1391. {
  1392. return ErrorCode;
  1393. }
  1394. return _rtcEngineImpl.GetExtensionProperty(provider, extension, key, ref value, buf_len, type);
  1395. }
  1396. public override int SetCameraCapturerConfiguration(CameraCapturerConfiguration config)
  1397. {
  1398. if (_rtcEngineImpl == null)
  1399. {
  1400. return ErrorCode;
  1401. }
  1402. return _rtcEngineImpl.SetCameraCapturerConfiguration(config);
  1403. }
  1404. public override int SwitchCamera()
  1405. {
  1406. if (_rtcEngineImpl == null)
  1407. {
  1408. return ErrorCode;
  1409. }
  1410. return _rtcEngineImpl.SwitchCamera();
  1411. }
  1412. public override bool IsCameraZoomSupported()
  1413. {
  1414. if (_rtcEngineImpl == null)
  1415. {
  1416. return false;
  1417. }
  1418. return _rtcEngineImpl.IsCameraZoomSupported();
  1419. }
  1420. public override bool IsCameraFaceDetectSupported()
  1421. {
  1422. if (_rtcEngineImpl == null)
  1423. {
  1424. return false;
  1425. }
  1426. return _rtcEngineImpl.IsCameraFaceDetectSupported();
  1427. }
  1428. public override bool IsCameraTorchSupported()
  1429. {
  1430. if (_rtcEngineImpl == null)
  1431. {
  1432. return false;
  1433. }
  1434. return _rtcEngineImpl.IsCameraTorchSupported();
  1435. }
  1436. public override bool IsCameraFocusSupported()
  1437. {
  1438. if (_rtcEngineImpl == null)
  1439. {
  1440. return false;
  1441. }
  1442. return _rtcEngineImpl.IsCameraFocusSupported();
  1443. }
  1444. public override bool IsCameraAutoFocusFaceModeSupported()
  1445. {
  1446. if (_rtcEngineImpl == null)
  1447. {
  1448. return false;
  1449. }
  1450. return _rtcEngineImpl.IsCameraAutoFocusFaceModeSupported();
  1451. }
  1452. public override int SetCameraZoomFactor(float factor)
  1453. {
  1454. if (_rtcEngineImpl == null)
  1455. {
  1456. return ErrorCode;
  1457. }
  1458. return _rtcEngineImpl.SetCameraZoomFactor(factor);
  1459. }
  1460. public override int EnableFaceDetection(bool enabled)
  1461. {
  1462. if (_rtcEngineImpl == null)
  1463. {
  1464. return ErrorCode;
  1465. }
  1466. return _rtcEngineImpl.EnableFaceDetection(enabled);
  1467. }
  1468. public override float GetCameraMaxZoomFactor()
  1469. {
  1470. if (_rtcEngineImpl == null)
  1471. {
  1472. return ErrorCode;
  1473. }
  1474. return _rtcEngineImpl.GetCameraMaxZoomFactor();
  1475. }
  1476. public override int SetCameraFocusPositionInPreview(float positionX, float positionY)
  1477. {
  1478. if (_rtcEngineImpl == null)
  1479. {
  1480. return ErrorCode;
  1481. }
  1482. return _rtcEngineImpl.SetCameraFocusPositionInPreview(positionX, positionY);
  1483. }
  1484. public override int SetCameraTorchOn(bool isOn)
  1485. {
  1486. if (_rtcEngineImpl == null)
  1487. {
  1488. return ErrorCode;
  1489. }
  1490. return _rtcEngineImpl.SetCameraTorchOn(isOn);
  1491. }
  1492. public override int SetCameraAutoFocusFaceModeEnabled(bool enabled)
  1493. {
  1494. if (_rtcEngineImpl == null)
  1495. {
  1496. return ErrorCode;
  1497. }
  1498. return _rtcEngineImpl.SetCameraAutoFocusFaceModeEnabled(enabled);
  1499. }
  1500. public override bool IsCameraExposurePositionSupported()
  1501. {
  1502. if (_rtcEngineImpl == null)
  1503. {
  1504. return false;
  1505. }
  1506. return _rtcEngineImpl.IsCameraExposurePositionSupported();
  1507. }
  1508. public override int SetCameraExposurePosition(float positionXinView, float positionYinView)
  1509. {
  1510. if (_rtcEngineImpl == null)
  1511. {
  1512. return ErrorCode;
  1513. }
  1514. return _rtcEngineImpl.SetCameraExposurePosition(positionXinView, positionYinView);
  1515. }
  1516. public override bool IsCameraAutoExposureFaceModeSupported()
  1517. {
  1518. if (_rtcEngineImpl == null)
  1519. {
  1520. return false;
  1521. }
  1522. return _rtcEngineImpl.IsCameraAutoExposureFaceModeSupported();
  1523. }
  1524. public override int SetCameraAutoExposureFaceModeEnabled(bool enabled)
  1525. {
  1526. if (_rtcEngineImpl == null)
  1527. {
  1528. return ErrorCode;
  1529. }
  1530. return _rtcEngineImpl.SetCameraAutoExposureFaceModeEnabled(enabled);
  1531. }
  1532. public override int SetDefaultAudioRouteToSpeakerphone(bool defaultToSpeaker)
  1533. {
  1534. if (_rtcEngineImpl == null)
  1535. {
  1536. return ErrorCode;
  1537. }
  1538. return _rtcEngineImpl.SetDefaultAudioRouteToSpeakerphone(defaultToSpeaker);
  1539. }
  1540. public override int SetEnableSpeakerphone(bool speakerOn)
  1541. {
  1542. if (_rtcEngineImpl == null)
  1543. {
  1544. return ErrorCode;
  1545. }
  1546. return _rtcEngineImpl.SetEnableSpeakerphone(speakerOn);
  1547. }
  1548. public override bool IsSpeakerphoneEnabled()
  1549. {
  1550. if (_rtcEngineImpl == null)
  1551. {
  1552. return false;
  1553. }
  1554. return _rtcEngineImpl.IsSpeakerphoneEnabled();
  1555. }
  1556. public override int StartScreenCaptureByDisplayId(uint displayId, Rectangle regionRect, ScreenCaptureParameters captureParams)
  1557. {
  1558. if (_rtcEngineImpl == null)
  1559. {
  1560. return ErrorCode;
  1561. }
  1562. return _rtcEngineImpl.StartScreenCaptureByDisplayId(displayId, regionRect, captureParams);
  1563. }
  1564. public override int StartScreenCaptureByScreenRect(Rectangle screenRect, Rectangle regionRect, ScreenCaptureParameters captureParams)
  1565. {
  1566. if (_rtcEngineImpl == null)
  1567. {
  1568. return ErrorCode;
  1569. }
  1570. return _rtcEngineImpl.StartScreenCaptureByScreenRect(screenRect, regionRect, captureParams);
  1571. }
  1572. public override int StartScreenCapture(byte[] mediaProjectionPermissionResultData, ScreenCaptureParameters captureParams)
  1573. {
  1574. if (_rtcEngineImpl == null)
  1575. {
  1576. return ErrorCode;
  1577. }
  1578. return _rtcEngineImpl.StartScreenCapture(mediaProjectionPermissionResultData, captureParams);
  1579. }
  1580. //only in android
  1581. public override int StartScreenCapture(ScreenCaptureParameters2 captureParams)
  1582. {
  1583. if (_rtcEngineImpl == null)
  1584. {
  1585. return ErrorCode;
  1586. }
  1587. return _rtcEngineImpl.StartScreenCapture(captureParams);
  1588. }
  1589. //only in android
  1590. public override int UpdateScreenCapture(ScreenCaptureParameters2 captureParams)
  1591. {
  1592. if (_rtcEngineImpl == null)
  1593. {
  1594. return ErrorCode;
  1595. }
  1596. return _rtcEngineImpl.UpdateScreenCapture(captureParams);
  1597. }
  1598. public override int StartScreenCaptureByWindowId(UInt64 windowId, Rectangle regionRect, ScreenCaptureParameters captureParams)
  1599. {
  1600. if (_rtcEngineImpl == null)
  1601. {
  1602. return ErrorCode;
  1603. }
  1604. return _rtcEngineImpl.StartScreenCaptureByWindowId(windowId, regionRect, captureParams);
  1605. }
  1606. public override int SetScreenCaptureContentHint(VIDEO_CONTENT_HINT contentHint)
  1607. {
  1608. if (_rtcEngineImpl == null)
  1609. {
  1610. return ErrorCode;
  1611. }
  1612. return _rtcEngineImpl.SetScreenCaptureContentHint(contentHint);
  1613. }
  1614. public override int UpdateScreenCaptureRegion(Rectangle regionRect)
  1615. {
  1616. if (_rtcEngineImpl == null)
  1617. {
  1618. return ErrorCode;
  1619. }
  1620. return _rtcEngineImpl.UpdateScreenCaptureRegion(regionRect);
  1621. }
  1622. public override int UpdateScreenCaptureParameters(ScreenCaptureParameters captureParams)
  1623. {
  1624. if (_rtcEngineImpl == null)
  1625. {
  1626. return ErrorCode;
  1627. }
  1628. return _rtcEngineImpl.UpdateScreenCaptureParameters(captureParams);
  1629. }
  1630. public override int StopScreenCapture()
  1631. {
  1632. if (_rtcEngineImpl == null)
  1633. {
  1634. return ErrorCode;
  1635. }
  1636. return _rtcEngineImpl.StopScreenCapture();
  1637. }
  1638. public override string GetCallId()
  1639. {
  1640. if (_rtcEngineImpl == null)
  1641. {
  1642. return null;
  1643. }
  1644. return _rtcEngineImpl.GetCallId();
  1645. }
  1646. public override int Rate(string callId, int rating, string description)
  1647. {
  1648. if (_rtcEngineImpl == null)
  1649. {
  1650. return ErrorCode;
  1651. }
  1652. return _rtcEngineImpl.Rate(callId, rating, description);
  1653. }
  1654. public override int Complain(string callId, string description)
  1655. {
  1656. if (_rtcEngineImpl == null)
  1657. {
  1658. return ErrorCode;
  1659. }
  1660. return _rtcEngineImpl.Complain(callId, description);
  1661. }
  1662. //public override int AddPublishStreamUrl(string url, bool transcodingEnabled)
  1663. //{
  1664. // if (_rtcEngineImpl == null)
  1665. // {
  1666. // AgoraLog.LogError(ErrorMsgLog);
  1667. // return ErrorCode;
  1668. // }
  1669. // return _rtcEngineImpl.AddPublishStreamUrl(url, transcodingEnabled);
  1670. //}
  1671. //public override int RemovePublishStreamUrl(string url)
  1672. //{
  1673. // if (_rtcEngineImpl == null)
  1674. // {
  1675. // AgoraLog.LogError(ErrorMsgLog);
  1676. // return ErrorCode;
  1677. // }
  1678. // return _rtcEngineImpl.RemovePublishStreamUrl(url);
  1679. //}
  1680. //public override int SetLiveTranscoding(LiveTranscoding transcoding)
  1681. //{
  1682. // if (_rtcEngineImpl == null)
  1683. // {
  1684. // AgoraLog.LogError(ErrorMsgLog);
  1685. // return ErrorCode;
  1686. // }
  1687. // return _rtcEngineImpl.SetLiveTranscoding(transcoding);
  1688. //}
  1689. public override int StartLocalVideoTranscoder(LocalTranscoderConfiguration config)
  1690. {
  1691. if (_rtcEngineImpl == null)
  1692. {
  1693. return ErrorCode;
  1694. }
  1695. return _rtcEngineImpl.StartLocalVideoTranscoder(config);
  1696. }
  1697. public override int UpdateLocalTranscoderConfiguration(LocalTranscoderConfiguration config)
  1698. {
  1699. if (_rtcEngineImpl == null)
  1700. {
  1701. return ErrorCode;
  1702. }
  1703. return _rtcEngineImpl.UpdateLocalTranscoderConfiguration(config);
  1704. }
  1705. public override int StopLocalVideoTranscoder()
  1706. {
  1707. if (_rtcEngineImpl == null)
  1708. {
  1709. return ErrorCode;
  1710. }
  1711. return _rtcEngineImpl.StopLocalVideoTranscoder();
  1712. }
  1713. public override int StartPrimaryCameraCapture(CameraCapturerConfiguration config)
  1714. {
  1715. if (_rtcEngineImpl == null)
  1716. {
  1717. return ErrorCode;
  1718. }
  1719. return _rtcEngineImpl.StartPrimaryCameraCapture(config);
  1720. }
  1721. public override int StartSecondaryCameraCapture(CameraCapturerConfiguration config)
  1722. {
  1723. if (_rtcEngineImpl == null)
  1724. {
  1725. return ErrorCode;
  1726. }
  1727. return _rtcEngineImpl.StartSecondaryCameraCapture(config);
  1728. }
  1729. public override int StopPrimaryCameraCapture()
  1730. {
  1731. if (_rtcEngineImpl == null)
  1732. {
  1733. return ErrorCode;
  1734. }
  1735. return _rtcEngineImpl.StopPrimaryCameraCapture();
  1736. }
  1737. public override int StopSecondaryCameraCapture()
  1738. {
  1739. if (_rtcEngineImpl == null)
  1740. {
  1741. return ErrorCode;
  1742. }
  1743. return _rtcEngineImpl.StopSecondaryCameraCapture();
  1744. }
  1745. public override int SetCameraDeviceOrientation(VIDEO_SOURCE_TYPE type, VIDEO_ORIENTATION orientation)
  1746. {
  1747. if (_rtcEngineImpl == null)
  1748. {
  1749. return ErrorCode;
  1750. }
  1751. return _rtcEngineImpl.SetCameraDeviceOrientation(type, orientation);
  1752. }
  1753. public override int SetScreenCaptureOrientation(VIDEO_SOURCE_TYPE type, VIDEO_ORIENTATION orientation)
  1754. {
  1755. if (_rtcEngineImpl == null)
  1756. {
  1757. return ErrorCode;
  1758. }
  1759. return _rtcEngineImpl.SetScreenCaptureOrientation(type, orientation);
  1760. }
  1761. public override int StartPrimaryScreenCapture(ScreenCaptureConfiguration config)
  1762. {
  1763. if (_rtcEngineImpl == null)
  1764. {
  1765. return ErrorCode;
  1766. }
  1767. return _rtcEngineImpl.StartPrimaryScreenCapture(config);
  1768. }
  1769. public override int StartSecondaryScreenCapture(ScreenCaptureConfiguration config)
  1770. {
  1771. if (_rtcEngineImpl == null)
  1772. {
  1773. return ErrorCode;
  1774. }
  1775. return _rtcEngineImpl.StartSecondaryScreenCapture(config);
  1776. }
  1777. public override int StopPrimaryScreenCapture()
  1778. {
  1779. if (_rtcEngineImpl == null)
  1780. {
  1781. return ErrorCode;
  1782. }
  1783. return _rtcEngineImpl.StopPrimaryScreenCapture();
  1784. }
  1785. public override int StopSecondaryScreenCapture()
  1786. {
  1787. if (_rtcEngineImpl == null)
  1788. {
  1789. return ErrorCode;
  1790. }
  1791. return _rtcEngineImpl.StopSecondaryScreenCapture();
  1792. }
  1793. public override CONNECTION_STATE_TYPE GetConnectionState()
  1794. {
  1795. if (_rtcEngineImpl == null)
  1796. {
  1797. return CONNECTION_STATE_TYPE.CONNECTION_STATE_CONNECTED;
  1798. }
  1799. return _rtcEngineImpl.GetConnectionState();
  1800. }
  1801. public override int SetRemoteUserPriority(uint uid, PRIORITY_TYPE userPriority)
  1802. {
  1803. if (_rtcEngineImpl == null)
  1804. {
  1805. return ErrorCode;
  1806. }
  1807. return _rtcEngineImpl.SetRemoteUserPriority(uid, userPriority);
  1808. }
  1809. //public override int RegisterPacketObserver(IPacketObserver observer)
  1810. //{
  1811. // if (_rtcEngineImpl == null)
  1812. // {
  1813. // AgoraLog.LogError(ErrorMsgLog);
  1814. // }
  1815. // return _rtcEngineImpl.Initialize(context);
  1816. //}
  1817. public override int SetEncryptionMode(string encryptionMode)
  1818. {
  1819. if (_rtcEngineImpl == null)
  1820. {
  1821. return ErrorCode;
  1822. }
  1823. return _rtcEngineImpl.SetEncryptionMode(encryptionMode);
  1824. }
  1825. public override int SetEncryptionSecret(string secret)
  1826. {
  1827. if (_rtcEngineImpl == null)
  1828. {
  1829. return ErrorCode;
  1830. }
  1831. return _rtcEngineImpl.SetEncryptionSecret(secret);
  1832. }
  1833. public override int EnableEncryption(bool enabled, EncryptionConfig config)
  1834. {
  1835. if (_rtcEngineImpl == null)
  1836. {
  1837. return ErrorCode;
  1838. }
  1839. return _rtcEngineImpl.EnableEncryption(enabled, config);
  1840. }
  1841. public override int CreateDataStream(ref int streamId, bool reliable, bool ordered)
  1842. {
  1843. if (_rtcEngineImpl == null)
  1844. {
  1845. return ErrorCode;
  1846. }
  1847. return _rtcEngineImpl.CreateDataStream(ref streamId, reliable, ordered);
  1848. }
  1849. public override int CreateDataStream(ref int streamId, DataStreamConfig config)
  1850. {
  1851. if (_rtcEngineImpl == null)
  1852. {
  1853. return ErrorCode;
  1854. }
  1855. return _rtcEngineImpl.CreateDataStream(ref streamId, config);
  1856. }
  1857. public override int SendStreamMessage(int streamId, byte[] data, uint length)
  1858. {
  1859. if (_rtcEngineImpl == null)
  1860. {
  1861. return ErrorCode;
  1862. }
  1863. return _rtcEngineImpl.SendStreamMessage(streamId, data, length);
  1864. }
  1865. public override int AddVideoWatermark(RtcImage watermark)
  1866. {
  1867. if (_rtcEngineImpl == null)
  1868. {
  1869. return ErrorCode;
  1870. }
  1871. return _rtcEngineImpl.AddVideoWatermark(watermark);
  1872. }
  1873. public override int AddVideoWatermark(string watermarkUrl, WatermarkOptions options)
  1874. {
  1875. if (_rtcEngineImpl == null)
  1876. {
  1877. return ErrorCode;
  1878. }
  1879. return _rtcEngineImpl.AddVideoWatermark(watermarkUrl, options);
  1880. }
  1881. public override int ClearVideoWatermark()
  1882. {
  1883. if (_rtcEngineImpl == null)
  1884. {
  1885. return ErrorCode;
  1886. }
  1887. return _rtcEngineImpl.ClearVideoWatermark();
  1888. }
  1889. public override int ClearVideoWatermarks()
  1890. {
  1891. if (_rtcEngineImpl == null)
  1892. {
  1893. return ErrorCode;
  1894. }
  1895. return _rtcEngineImpl.ClearVideoWatermarks();
  1896. }
  1897. public override int AddInjectStreamUrl(string url, InjectStreamConfig config)
  1898. {
  1899. if (_rtcEngineImpl == null)
  1900. {
  1901. return ErrorCode;
  1902. }
  1903. return _rtcEngineImpl.AddInjectStreamUrl(url, config);
  1904. }
  1905. public override int RemoveInjectStreamUrl(string url)
  1906. {
  1907. if (_rtcEngineImpl == null)
  1908. {
  1909. return ErrorCode;
  1910. }
  1911. return _rtcEngineImpl.RemoveInjectStreamUrl(url);
  1912. }
  1913. public override int PauseAudio()
  1914. {
  1915. if (_rtcEngineImpl == null)
  1916. {
  1917. return ErrorCode;
  1918. }
  1919. return _rtcEngineImpl.PauseAudio();
  1920. }
  1921. public override int ResumeAudio()
  1922. {
  1923. if (_rtcEngineImpl == null)
  1924. {
  1925. return ErrorCode;
  1926. }
  1927. return _rtcEngineImpl.ResumeAudio();
  1928. }
  1929. public override int EnableWebSdkInteroperability(bool enabled)
  1930. {
  1931. if (_rtcEngineImpl == null)
  1932. {
  1933. return ErrorCode;
  1934. }
  1935. return _rtcEngineImpl.EnableWebSdkInteroperability(enabled);
  1936. }
  1937. public override int SendCustomReportMessage(string id, string category, string @event, string label, int value)
  1938. {
  1939. if (_rtcEngineImpl == null)
  1940. {
  1941. return ErrorCode;
  1942. }
  1943. return _rtcEngineImpl.SendCustomReportMessage(id, category, @event, label, value);
  1944. }
  1945. public override void RegisterMediaMetadataObserver(IMetadataObserver observer, METADATA_TYPE type)
  1946. {
  1947. if (_rtcEngineImpl == null)
  1948. {
  1949. return;
  1950. }
  1951. _rtcEngineImpl.RegisterMediaMetadataObserver(observer, type);
  1952. }
  1953. public override void UnregisterMediaMetadataObserver()
  1954. {
  1955. if (_rtcEngineImpl == null)
  1956. {
  1957. return;
  1958. }
  1959. _rtcEngineImpl.UnregisterMediaMetadataObserver();
  1960. }
  1961. public override int StartAudioFrameDump(string channel_id, uint user_id, string location, string uuid, string passwd, long duration_ms, bool auto_upload)
  1962. {
  1963. if (_rtcEngineImpl == null)
  1964. {
  1965. return ErrorCode;
  1966. }
  1967. return _rtcEngineImpl.StartAudioFrameDump(channel_id, user_id, location, uuid, passwd, duration_ms, auto_upload);
  1968. }
  1969. public override int StopAudioFrameDump(string channel_id, uint user_id, string location)
  1970. {
  1971. if (_rtcEngineImpl == null)
  1972. {
  1973. return ErrorCode;
  1974. }
  1975. return _rtcEngineImpl.StopAudioFrameDump(channel_id, user_id, location);
  1976. }
  1977. public override int RegisterLocalUserAccount(string appId, string userAccount)
  1978. {
  1979. if (_rtcEngineImpl == null)
  1980. {
  1981. return ErrorCode;
  1982. }
  1983. return _rtcEngineImpl.RegisterLocalUserAccount(appId, userAccount);
  1984. }
  1985. public override int JoinChannelWithUserAccount(string token, string channelId, string userAccount)
  1986. {
  1987. if (_rtcEngineImpl == null)
  1988. {
  1989. return ErrorCode;
  1990. }
  1991. return _rtcEngineImpl.JoinChannelWithUserAccount(token, channelId, userAccount);
  1992. }
  1993. public override int JoinChannelWithUserAccount(string token, string channelId, string userAccount, ChannelMediaOptions options)
  1994. {
  1995. if (_rtcEngineImpl == null)
  1996. {
  1997. return ErrorCode;
  1998. }
  1999. return _rtcEngineImpl.JoinChannelWithUserAccount(token, channelId, userAccount, options);
  2000. }
  2001. public override int GetUserInfoByUserAccount(string userAccount, ref UserInfo userInfo)
  2002. {
  2003. if (_rtcEngineImpl == null)
  2004. {
  2005. return ErrorCode;
  2006. }
  2007. return _rtcEngineImpl.GetUserInfoByUserAccount(userAccount, ref userInfo);
  2008. }
  2009. public override int GetUserInfoByUid(uint uid, ref UserInfo userInfo)
  2010. {
  2011. if (_rtcEngineImpl == null)
  2012. {
  2013. return ErrorCode;
  2014. }
  2015. return _rtcEngineImpl.GetUserInfoByUid(uid, ref userInfo);
  2016. }
  2017. public override int StartChannelMediaRelay(ChannelMediaRelayConfiguration configuration)
  2018. {
  2019. if (_rtcEngineImpl == null)
  2020. {
  2021. return ErrorCode;
  2022. }
  2023. return _rtcEngineImpl.StartChannelMediaRelay(configuration);
  2024. }
  2025. public override int UpdateChannelMediaRelay(ChannelMediaRelayConfiguration configuration)
  2026. {
  2027. if (_rtcEngineImpl == null)
  2028. {
  2029. return ErrorCode;
  2030. }
  2031. return _rtcEngineImpl.UpdateChannelMediaRelay(configuration);
  2032. }
  2033. public override int StopChannelMediaRelay()
  2034. {
  2035. if (_rtcEngineImpl == null)
  2036. {
  2037. return ErrorCode;
  2038. }
  2039. return _rtcEngineImpl.StopChannelMediaRelay();
  2040. }
  2041. public override int SetDirectCdnStreamingAudioConfiguration(AUDIO_PROFILE_TYPE profile)
  2042. {
  2043. if (_rtcEngineImpl == null)
  2044. {
  2045. return ErrorCode;
  2046. }
  2047. return _rtcEngineImpl.SetDirectCdnStreamingAudioConfiguration(profile);
  2048. }
  2049. public override int SetDirectCdnStreamingVideoConfiguration(VideoEncoderConfiguration config)
  2050. {
  2051. if (_rtcEngineImpl == null)
  2052. {
  2053. return ErrorCode;
  2054. }
  2055. return _rtcEngineImpl.SetDirectCdnStreamingVideoConfiguration(config);
  2056. }
  2057. public override int StartDirectCdnStreaming(string publishUrl, DirectCdnStreamingMediaOptions options)
  2058. {
  2059. if (_rtcEngineImpl == null)
  2060. {
  2061. return ErrorCode;
  2062. }
  2063. return _rtcEngineImpl.StartDirectCdnStreaming(publishUrl, options);
  2064. }
  2065. public override int StopDirectCdnStreaming()
  2066. {
  2067. if (_rtcEngineImpl == null)
  2068. {
  2069. return ErrorCode;
  2070. }
  2071. return _rtcEngineImpl.StopDirectCdnStreaming();
  2072. }
  2073. public override int UpdateDirectCdnStreamingMediaOptions(DirectCdnStreamingMediaOptions options)
  2074. {
  2075. if (_rtcEngineImpl == null)
  2076. {
  2077. return ErrorCode;
  2078. }
  2079. return _rtcEngineImpl.UpdateDirectCdnStreamingMediaOptions(options);
  2080. }
  2081. public override int JoinChannelEx(string token, RtcConnection connection, ChannelMediaOptions options)
  2082. {
  2083. if (_rtcEngineImpl == null)
  2084. {
  2085. return ErrorCode;
  2086. }
  2087. return _rtcEngineImpl.JoinChannelEx(token, connection, options);
  2088. }
  2089. public override int LeaveChannelEx(RtcConnection connection)
  2090. {
  2091. if (_rtcEngineImpl == null)
  2092. {
  2093. return ErrorCode;
  2094. }
  2095. return _rtcEngineImpl.LeaveChannelEx(connection);
  2096. }
  2097. public override int UpdateChannelMediaOptionsEx(ChannelMediaOptions options, RtcConnection connection)
  2098. {
  2099. if (_rtcEngineImpl == null)
  2100. {
  2101. return ErrorCode;
  2102. }
  2103. return _rtcEngineImpl.UpdateChannelMediaOptionsEx(options, connection);
  2104. }
  2105. public override int SetVideoEncoderConfigurationEx(VideoEncoderConfiguration config, RtcConnection connection)
  2106. {
  2107. if (_rtcEngineImpl == null)
  2108. {
  2109. return ErrorCode;
  2110. }
  2111. return _rtcEngineImpl.SetVideoEncoderConfigurationEx(config, connection);
  2112. }
  2113. public override int SetupRemoteVideoEx(VideoCanvas canvas, RtcConnection connection)
  2114. {
  2115. if (_rtcEngineImpl == null)
  2116. {
  2117. return ErrorCode;
  2118. }
  2119. return _rtcEngineImpl.SetupRemoteVideoEx(canvas, connection);
  2120. }
  2121. public override int MuteRemoteAudioStreamEx(uint uid, bool mute, RtcConnection connection)
  2122. {
  2123. if (_rtcEngineImpl == null)
  2124. {
  2125. return ErrorCode;
  2126. }
  2127. return _rtcEngineImpl.MuteRemoteAudioStreamEx(uid, mute, connection);
  2128. }
  2129. public override int MuteRemoteVideoStreamEx(uint uid, bool mute, RtcConnection connection)
  2130. {
  2131. if (_rtcEngineImpl == null)
  2132. {
  2133. return ErrorCode;
  2134. }
  2135. return _rtcEngineImpl.MuteRemoteVideoStreamEx(uid, mute, connection);
  2136. }
  2137. public override int SetRemoteVoicePositionEx(uint uid, double pan, double gain, RtcConnection connection)
  2138. {
  2139. if (_rtcEngineImpl == null)
  2140. {
  2141. return ErrorCode;
  2142. }
  2143. return _rtcEngineImpl.SetRemoteVoicePositionEx(uid, pan, gain, connection);
  2144. }
  2145. public override int SetRemoteUserSpatialAudioParamsEx(uint uid, SpatialAudioParams param, RtcConnection connection)
  2146. {
  2147. if (_rtcEngineImpl == null)
  2148. {
  2149. return ErrorCode;
  2150. }
  2151. return _rtcEngineImpl.SetRemoteUserSpatialAudioParamsEx(uid, param, connection);
  2152. }
  2153. public override int SetRemoteRenderModeEx(uint uid, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode, RtcConnection connection)
  2154. {
  2155. if (_rtcEngineImpl == null)
  2156. {
  2157. return ErrorCode;
  2158. }
  2159. return _rtcEngineImpl.SetRemoteRenderModeEx(uid, renderMode, mirrorMode, connection);
  2160. }
  2161. public override int EnableLoopbackRecordingEx(bool enabled, RtcConnection connection)
  2162. {
  2163. if (_rtcEngineImpl == null)
  2164. {
  2165. return ErrorCode;
  2166. }
  2167. return _rtcEngineImpl.EnableLoopbackRecordingEx(enabled, connection);
  2168. }
  2169. public override CONNECTION_STATE_TYPE GetConnectionStateEx(RtcConnection connection)
  2170. {
  2171. if (_rtcEngineImpl == null)
  2172. {
  2173. return CONNECTION_STATE_TYPE.CONNECTION_STATE_CONNECTED;
  2174. }
  2175. return _rtcEngineImpl.GetConnectionStateEx(connection);
  2176. }
  2177. public override int EnableEncryptionEx(RtcConnection connection, bool enabled, EncryptionConfig config)
  2178. {
  2179. if (_rtcEngineImpl == null)
  2180. {
  2181. return ErrorCode;
  2182. }
  2183. return _rtcEngineImpl.EnableEncryptionEx(connection, enabled, config);
  2184. }
  2185. public override int CreateDataStreamEx(ref int streamId, bool reliable, bool ordered, RtcConnection connection)
  2186. {
  2187. if (_rtcEngineImpl == null)
  2188. {
  2189. return ErrorCode;
  2190. }
  2191. return _rtcEngineImpl.CreateDataStreamEx(ref streamId, reliable, ordered, connection);
  2192. }
  2193. public override int CreateDataStreamEx(ref int streamId, DataStreamConfig config, RtcConnection connection)
  2194. {
  2195. if (_rtcEngineImpl == null)
  2196. {
  2197. return ErrorCode;
  2198. }
  2199. return _rtcEngineImpl.CreateDataStreamEx(ref streamId, config, connection);
  2200. }
  2201. public override int SendStreamMessageEx(int streamId, byte[] data, uint length, RtcConnection connection)
  2202. {
  2203. if (_rtcEngineImpl == null)
  2204. {
  2205. return ErrorCode;
  2206. }
  2207. return _rtcEngineImpl.SendStreamMessageEx(streamId, data, length, connection);
  2208. }
  2209. public override int AddVideoWatermarkEx(string watermarkUrl, WatermarkOptions options, RtcConnection connection)
  2210. {
  2211. if (_rtcEngineImpl == null)
  2212. {
  2213. return ErrorCode;
  2214. }
  2215. return _rtcEngineImpl.AddVideoWatermarkEx(watermarkUrl, options, connection);
  2216. }
  2217. public override int ClearVideoWatermarkEx(RtcConnection connection)
  2218. {
  2219. if (_rtcEngineImpl == null)
  2220. {
  2221. return ErrorCode;
  2222. }
  2223. return _rtcEngineImpl.ClearVideoWatermarkEx(connection);
  2224. }
  2225. public override int SendCustomReportMessageEx(string id, string category, string @event, string label, int value, RtcConnection connection)
  2226. {
  2227. if (_rtcEngineImpl == null)
  2228. {
  2229. return ErrorCode;
  2230. }
  2231. return _rtcEngineImpl.SendCustomReportMessageEx(id, category, @event, label, value, connection);
  2232. }
  2233. public override int PushAudioFrame(MEDIA_SOURCE_TYPE type, AudioFrame frame, bool wrap = false, int sourceId = 0)
  2234. {
  2235. if (_rtcEngineImpl == null)
  2236. {
  2237. return ErrorCode;
  2238. }
  2239. return _rtcEngineImpl.PushAudioFrame(type, frame, wrap, sourceId);
  2240. }
  2241. public override int PullAudioFrame(AudioFrame frame)
  2242. {
  2243. if (_rtcEngineImpl == null)
  2244. {
  2245. return ErrorCode;
  2246. }
  2247. return _rtcEngineImpl.PullAudioFrame(frame);
  2248. }
  2249. public override int SetExternalVideoSource(bool enabled, bool useTexture, EXTERNAL_VIDEO_SOURCE_TYPE sourceType, SenderOptions encodedVideoOption)
  2250. {
  2251. if (_rtcEngineImpl == null)
  2252. {
  2253. return ErrorCode;
  2254. }
  2255. return _rtcEngineImpl.SetExternalVideoSource(enabled, useTexture, sourceType, encodedVideoOption);
  2256. }
  2257. public override int SetExternalAudioSource(bool enabled, int sampleRate, int channels, int sourceNumber, bool localPlayback = false, bool publish = true)
  2258. {
  2259. if (_rtcEngineImpl == null)
  2260. {
  2261. return ErrorCode;
  2262. }
  2263. return _rtcEngineImpl.SetExternalAudioSource(enabled, sampleRate, channels, sourceNumber, localPlayback, publish);
  2264. }
  2265. public override int PushVideoFrame(ExternalVideoFrame frame, uint videoTrackId = 0)
  2266. {
  2267. if (_rtcEngineImpl == null)
  2268. {
  2269. return ErrorCode;
  2270. }
  2271. return _rtcEngineImpl.PushVideoFrame(frame, videoTrackId);
  2272. }
  2273. public override int PushEncodedVideoImage(byte[] imageBuffer, uint length, EncodedVideoFrameInfo videoEncodedFrameInfo, uint videoTrackId = 0)
  2274. {
  2275. if (_rtcEngineImpl == null)
  2276. {
  2277. return ErrorCode;
  2278. }
  2279. return _rtcEngineImpl.PushEncodedVideoImage(imageBuffer, length, videoEncodedFrameInfo, videoTrackId);
  2280. }
  2281. public override video_track_id_t CreateCustomEncodedVideoTrack(SenderOptions sender_option)
  2282. {
  2283. if (_rtcEngineImpl == null)
  2284. {
  2285. return 0;
  2286. }
  2287. return _rtcEngineImpl.CreateCustomEncodedVideoTrack(sender_option);
  2288. }
  2289. public override int DestroyCustomEncodedVideoTrack(video_track_id_t video_track_id)
  2290. {
  2291. if (_rtcEngineImpl == null)
  2292. {
  2293. return ErrorCode;
  2294. }
  2295. return _rtcEngineImpl.DestroyCustomEncodedVideoTrack(video_track_id);
  2296. }
  2297. public override video_track_id_t CreateCustomVideoTrack()
  2298. {
  2299. if (_rtcEngineImpl == null)
  2300. {
  2301. return 0;
  2302. }
  2303. return _rtcEngineImpl.CreateCustomVideoTrack();
  2304. }
  2305. public override int DestroyCustomVideoTrack(video_track_id_t video_track_id)
  2306. {
  2307. if (_rtcEngineImpl == null)
  2308. {
  2309. return 0;
  2310. }
  2311. return _rtcEngineImpl.DestroyCustomVideoTrack(video_track_id);
  2312. }
  2313. //public override int GetCertificateVerifyResult(string credential_buf, int credential_len, string certificate_buf, int certificate_len)
  2314. //{
  2315. // if (_rtcEngineImpl == null)
  2316. // {
  2317. // AgoraLog.LogError(ErrorMsgLog);
  2318. // }
  2319. // return _rtcEngineImpl.Initialize(context);
  2320. //}
  2321. public override int SetAudioSessionOperationRestriction(AUDIO_SESSION_OPERATION_RESTRICTION restriction)
  2322. {
  2323. if (_rtcEngineImpl == null)
  2324. {
  2325. return ErrorCode;
  2326. }
  2327. return _rtcEngineImpl.SetAudioSessionOperationRestriction(restriction);
  2328. }
  2329. public override int AdjustCustomAudioPublishVolume(int sourceId, int volume)
  2330. {
  2331. if (_rtcEngineImpl == null)
  2332. {
  2333. return ErrorCode;
  2334. }
  2335. return _rtcEngineImpl.AdjustCustomAudioPublishVolume(sourceId, volume);
  2336. }
  2337. public override int AdjustCustomAudioPlayoutVolume(int sourceId, int volume)
  2338. {
  2339. if (_rtcEngineImpl == null)
  2340. {
  2341. return ErrorCode;
  2342. }
  2343. return _rtcEngineImpl.AdjustCustomAudioPlayoutVolume(sourceId, volume);
  2344. }
  2345. public override int SetParameters(string parameters)
  2346. {
  2347. if (_rtcEngineImpl == null)
  2348. {
  2349. return ErrorCode;
  2350. }
  2351. return _rtcEngineImpl.SetParameters(parameters);
  2352. }
  2353. public override int GetAudioDeviceInfo(ref DeviceInfo deviceInfo)
  2354. {
  2355. if (_rtcEngineImpl == null)
  2356. {
  2357. return ErrorCode;
  2358. }
  2359. return _rtcEngineImpl.GetAudioDeviceInfo(ref deviceInfo);
  2360. }
  2361. public override int EnableCustomAudioLocalPlayback(int sourceId, bool enabled)
  2362. {
  2363. if (_rtcEngineImpl == null)
  2364. {
  2365. return ErrorCode;
  2366. }
  2367. return _rtcEngineImpl.EnableCustomAudioLocalPlayback(sourceId, enabled);
  2368. }
  2369. public override int SetLocalPublishFallbackOption(STREAM_FALLBACK_OPTIONS option)
  2370. {
  2371. if (_rtcEngineImpl == null)
  2372. {
  2373. return ErrorCode;
  2374. }
  2375. return _rtcEngineImpl.SetLocalPublishFallbackOption(option);
  2376. }
  2377. public override int SetRemoteSubscribeFallbackOption(STREAM_FALLBACK_OPTIONS option)
  2378. {
  2379. if (_rtcEngineImpl == null)
  2380. {
  2381. return ErrorCode;
  2382. }
  2383. return _rtcEngineImpl.SetRemoteSubscribeFallbackOption(option);
  2384. }
  2385. public override int PauseAllChannelMediaRelay()
  2386. {
  2387. if (_rtcEngineImpl == null)
  2388. {
  2389. return ErrorCode;
  2390. }
  2391. return _rtcEngineImpl.PauseAllChannelMediaRelay();
  2392. }
  2393. public override int ResumeAllChannelMediaRelay()
  2394. {
  2395. if (_rtcEngineImpl == null)
  2396. {
  2397. return ErrorCode;
  2398. }
  2399. return _rtcEngineImpl.ResumeAllChannelMediaRelay();
  2400. }
  2401. public override int EnableEchoCancellationExternal(bool enabled, int audioSourceDelay)
  2402. {
  2403. if (_rtcEngineImpl == null)
  2404. {
  2405. return ErrorCode;
  2406. }
  2407. return _rtcEngineImpl.EnableEchoCancellationExternal(enabled, audioSourceDelay);
  2408. }
  2409. public override int TakeSnapshot(uint uid, string filePath)
  2410. {
  2411. if (_rtcEngineImpl == null)
  2412. {
  2413. return ErrorCode;
  2414. }
  2415. return _rtcEngineImpl.TakeSnapshot(uid, filePath);
  2416. }
  2417. public override int StartRhythmPlayer(string sound1, string sound2, AgoraRhythmPlayerConfig config)
  2418. {
  2419. if (_rtcEngineImpl == null)
  2420. {
  2421. return ErrorCode;
  2422. }
  2423. return _rtcEngineImpl.StartRhythmPlayer(sound1, sound2, config);
  2424. }
  2425. public override int StopRhythmPlayer()
  2426. {
  2427. if (_rtcEngineImpl == null)
  2428. {
  2429. return ErrorCode;
  2430. }
  2431. return _rtcEngineImpl.StopRhythmPlayer();
  2432. }
  2433. public override int ConfigRhythmPlayer(AgoraRhythmPlayerConfig config)
  2434. {
  2435. if (_rtcEngineImpl == null)
  2436. {
  2437. return ErrorCode;
  2438. }
  2439. return _rtcEngineImpl.ConfigRhythmPlayer(config);
  2440. }
  2441. //public override int SetRemoteVideoSubscriptionOptions(uint uid, VideoSubscriptionOptions options)
  2442. //{
  2443. // if (_rtcEngineImpl == null)
  2444. // {
  2445. // AgoraLog.LogError(ErrorMsgLog);
  2446. // }
  2447. // return _rtcEngineImpl.Initialize(context);
  2448. //}
  2449. //public override int SetRemoteVideoSubscriptionOptionsEx(uint uid, VideoSubscriptionOptions options, RtcConnection connection)
  2450. //{
  2451. // if (_rtcEngineImpl == null)
  2452. // {
  2453. // AgoraLog.LogError(ErrorMsgLog);
  2454. // }
  2455. // return _rtcEngineImpl.Initialize(context);
  2456. //}
  2457. public override int SetDirectExternalAudioSource(bool enable, bool localPlayback)
  2458. {
  2459. if (_rtcEngineImpl == null)
  2460. {
  2461. return ErrorCode;
  2462. }
  2463. return _rtcEngineImpl.SetDirectExternalAudioSource(enable, localPlayback);
  2464. }
  2465. public override int PushDirectAudioFrame(AudioFrame frame)
  2466. {
  2467. if (_rtcEngineImpl == null)
  2468. {
  2469. return ErrorCode;
  2470. }
  2471. return _rtcEngineImpl.PushDirectAudioFrame(frame);
  2472. }
  2473. public override int SetCloudProxy(CLOUD_PROXY_TYPE proxyType)
  2474. {
  2475. if (_rtcEngineImpl == null)
  2476. {
  2477. return ErrorCode;
  2478. }
  2479. return _rtcEngineImpl.SetCloudProxy(proxyType);
  2480. }
  2481. public override int SetLocalAccessPoint(LocalAccessPointConfiguration config)
  2482. {
  2483. if (_rtcEngineImpl == null)
  2484. {
  2485. return ErrorCode;
  2486. }
  2487. return _rtcEngineImpl.SetLocalAccessPoint(config);
  2488. }
  2489. //public override int EnableFishEyeCorrection(bool enabled, FishEyeCorrectionParams @params)
  2490. //{
  2491. // if (_rtcEngineImpl == null)
  2492. // {
  2493. // AgoraLog.LogError(ErrorMsgLog);
  2494. // return ErrorCode;
  2495. // }
  2496. // return _rtcEngineImpl.EnableFishEyeCorrection(enabled, @params);
  2497. //}
  2498. public override int SetAdvancedAudioOptions(AdvancedAudioOptions options)
  2499. {
  2500. if (_rtcEngineImpl == null)
  2501. {
  2502. return ErrorCode;
  2503. }
  2504. return _rtcEngineImpl.SetAdvancedAudioOptions(options);
  2505. }
  2506. public override int SetAVSyncSource(string channelId, uint uid)
  2507. {
  2508. if (_rtcEngineImpl == null)
  2509. {
  2510. return ErrorCode;
  2511. }
  2512. return _rtcEngineImpl.SetAVSyncSource(channelId, uid);
  2513. }
  2514. public override int StartRtmpStreamWithoutTranscoding(string url)
  2515. {
  2516. if (_rtcEngineImpl == null)
  2517. {
  2518. return ErrorCode;
  2519. }
  2520. return _rtcEngineImpl.StartRtmpStreamWithoutTranscoding(url);
  2521. }
  2522. public override int StartRtmpStreamWithTranscoding(string url, LiveTranscoding transcoding)
  2523. {
  2524. if (_rtcEngineImpl == null)
  2525. {
  2526. return ErrorCode;
  2527. }
  2528. return _rtcEngineImpl.StartRtmpStreamWithTranscoding(url, transcoding);
  2529. }
  2530. public override int UpdateRtmpTranscoding(LiveTranscoding transcoding)
  2531. {
  2532. if (_rtcEngineImpl == null)
  2533. {
  2534. return ErrorCode;
  2535. }
  2536. return _rtcEngineImpl.UpdateRtmpTranscoding(transcoding);
  2537. }
  2538. public override int StopRtmpStream(string url)
  2539. {
  2540. if (_rtcEngineImpl == null)
  2541. {
  2542. return ErrorCode;
  2543. }
  2544. return _rtcEngineImpl.StopRtmpStream(url);
  2545. }
  2546. public override int GetUserInfoByUserAccountEx(string userAccount, ref UserInfo userInfo, RtcConnection connection)
  2547. {
  2548. if (_rtcEngineImpl == null)
  2549. {
  2550. return ErrorCode;
  2551. }
  2552. return _rtcEngineImpl.GetUserInfoByUserAccountEx(userAccount, ref userInfo, connection);
  2553. }
  2554. public override int GetUserInfoByUidEx(uint uid, ref UserInfo userInfo, RtcConnection connection)
  2555. {
  2556. if (_rtcEngineImpl == null)
  2557. {
  2558. return ErrorCode;
  2559. }
  2560. return _rtcEngineImpl.GetUserInfoByUidEx(uid, ref userInfo, connection);
  2561. }
  2562. public override int SetRemoteVideoSubscriptionOptionsEx(uint uid, VideoSubscriptionOptions options, RtcConnection connection)
  2563. {
  2564. if (_rtcEngineImpl == null)
  2565. {
  2566. return ErrorCode;
  2567. }
  2568. return _rtcEngineImpl.SetRemoteVideoSubscriptionOptionsEx(uid, options, connection);
  2569. }
  2570. public override int SetSubscribeAudioBlacklistEx(uint[] uidList, int uidNumber, RtcConnection connection)
  2571. {
  2572. if (_rtcEngineImpl == null)
  2573. {
  2574. return ErrorCode;
  2575. }
  2576. return _rtcEngineImpl.SetSubscribeAudioBlacklistEx(uidList, uidNumber, connection);
  2577. }
  2578. public override int SetSubscribeAudioWhitelistEx(uint[] uidList, int uidNumber, RtcConnection connection)
  2579. {
  2580. if (_rtcEngineImpl == null)
  2581. {
  2582. return ErrorCode;
  2583. }
  2584. return _rtcEngineImpl.SetSubscribeAudioWhitelistEx(uidList, uidNumber, connection);
  2585. }
  2586. public override int SetSubscribeVideoBlacklistEx(uint[] uidList, int uidNumber, RtcConnection connection)
  2587. {
  2588. if (_rtcEngineImpl == null)
  2589. {
  2590. return ErrorCode;
  2591. }
  2592. return _rtcEngineImpl.SetSubscribeVideoBlacklistEx(uidList, uidNumber, connection);
  2593. }
  2594. public override int SetSubscribeVideoWhitelistEx(uint[] uidList, int uidNumber, RtcConnection connection)
  2595. {
  2596. if (_rtcEngineImpl == null)
  2597. {
  2598. return ErrorCode;
  2599. }
  2600. return _rtcEngineImpl.SetSubscribeVideoWhitelistEx(uidList, uidNumber, connection);
  2601. }
  2602. public override int EnableRemoteSuperResolution(uint userId, bool enable)
  2603. {
  2604. if (_rtcEngineImpl == null)
  2605. {
  2606. return ErrorCode;
  2607. }
  2608. return _rtcEngineImpl.EnableRemoteSuperResolution(userId, enable);
  2609. }
  2610. public override int EnableContentInspect(bool enabled, ContentInspectConfig config)
  2611. {
  2612. if (_rtcEngineImpl == null)
  2613. {
  2614. return ErrorCode;
  2615. }
  2616. return _rtcEngineImpl.EnableContentInspect(enabled, config);
  2617. }
  2618. public override int SetRemoteVideoStreamTypeEx(uint uid, VIDEO_STREAM_TYPE streamType, RtcConnection connection)
  2619. {
  2620. if (_rtcEngineImpl == null)
  2621. {
  2622. return ErrorCode;
  2623. }
  2624. return _rtcEngineImpl.SetRemoteVideoStreamTypeEx(uid, streamType, connection);
  2625. }
  2626. public override int EnableAudioVolumeIndicationEx(int interval, int smooth, bool reportVad, RtcConnection connection)
  2627. {
  2628. if (_rtcEngineImpl == null)
  2629. {
  2630. return ErrorCode;
  2631. }
  2632. return _rtcEngineImpl.EnableAudioVolumeIndicationEx(interval, smooth, reportVad, connection);
  2633. }
  2634. public override int SetVideoProfileEx(int width, int height, int frameRate, int bitrate)
  2635. {
  2636. if (_rtcEngineImpl == null)
  2637. {
  2638. return ErrorCode;
  2639. }
  2640. return _rtcEngineImpl.SetVideoProfileEx(width, height, frameRate, bitrate);
  2641. }
  2642. public override int EnableDualStreamModeEx(VIDEO_SOURCE_TYPE sourceType, bool enabled, SimulcastStreamConfig streamConfig, RtcConnection connection)
  2643. {
  2644. if (_rtcEngineImpl == null)
  2645. {
  2646. return ErrorCode;
  2647. }
  2648. return _rtcEngineImpl.EnableDualStreamModeEx(sourceType, enabled, streamConfig, connection);
  2649. }
  2650. //public override int AddPublishStreamUrlEx(string url, bool transcodingEnabled, RtcConnection connection)
  2651. //{
  2652. // if (_rtcEngineImpl == null)
  2653. // {
  2654. // AgoraLog.LogError(ErrorMsgLog);
  2655. // return ErrorCode;
  2656. // }
  2657. // return _rtcEngineImpl.AddPublishStreamUrlEx(url, transcodingEnabled, connection);
  2658. //}
  2659. public override int UploadLogFile(ref string requestId)
  2660. {
  2661. if (_rtcEngineImpl == null)
  2662. {
  2663. return ErrorCode;
  2664. }
  2665. return _rtcEngineImpl.UploadLogFile(ref requestId);
  2666. }
  2667. public override int SetSubscribeAudioBlacklist(uint[] uidList, int uidNumber)
  2668. {
  2669. if (_rtcEngineImpl == null)
  2670. {
  2671. return ErrorCode;
  2672. }
  2673. return _rtcEngineImpl.SetSubscribeAudioBlacklist(uidList, uidNumber);
  2674. }
  2675. public override int SetSubscribeAudioWhitelist(uint[] uidList, int uidNumber)
  2676. {
  2677. if (_rtcEngineImpl == null)
  2678. {
  2679. return ErrorCode;
  2680. }
  2681. return _rtcEngineImpl.SetSubscribeAudioWhitelist(uidList, uidNumber);
  2682. }
  2683. public override int SetSubscribeVideoBlacklist(uint[] uidList, int uidNumber)
  2684. {
  2685. if (_rtcEngineImpl == null)
  2686. {
  2687. return ErrorCode;
  2688. }
  2689. return _rtcEngineImpl.SetSubscribeVideoBlacklist(uidList, uidNumber);
  2690. }
  2691. public override int SetSubscribeVideoWhitelist(uint[] uidList, int uidNumber)
  2692. {
  2693. if (_rtcEngineImpl == null)
  2694. {
  2695. return ErrorCode;
  2696. }
  2697. return _rtcEngineImpl.SetSubscribeVideoWhitelist(uidList, uidNumber);
  2698. }
  2699. public override ScreenCaptureSourceInfo[] GetScreenCaptureSources(SIZE thumbSize, SIZE iconSize, bool includeScreen)
  2700. {
  2701. if (_rtcEngineImpl == null)
  2702. {
  2703. return null;
  2704. }
  2705. return _rtcEngineImpl.GetScreenCaptureSources(thumbSize, iconSize, includeScreen);
  2706. }
  2707. public override int SetScreenCaptureScenario(SCREEN_SCENARIO_TYPE screenScenario)
  2708. {
  2709. if (_rtcEngineImpl == null)
  2710. {
  2711. return ErrorCode;
  2712. }
  2713. return _rtcEngineImpl.SetScreenCaptureScenario(screenScenario);
  2714. }
  2715. public override bool StartDumpVideo(VIDEO_SOURCE_TYPE type, string dir)
  2716. {
  2717. return _rtcEngineImpl.StartDumpVideo(type, dir);
  2718. }
  2719. public override bool StopDumpVideo()
  2720. {
  2721. return _rtcEngineImpl.StopDumpVideo();
  2722. }
  2723. public override int EnableWirelessAccelerate(bool enabled)
  2724. {
  2725. if (_rtcEngineImpl == null)
  2726. {
  2727. return ErrorCode;
  2728. }
  2729. return _rtcEngineImpl.EnableWirelessAccelerate(enabled);
  2730. }
  2731. public override int GetAudioTrackCount()
  2732. {
  2733. if (_rtcEngineImpl == null)
  2734. {
  2735. return ErrorCode;
  2736. }
  2737. return _rtcEngineImpl.GetAudioTrackCount();
  2738. }
  2739. public override int SelectAudioTrack(int index)
  2740. {
  2741. if (_rtcEngineImpl == null)
  2742. {
  2743. return ErrorCode;
  2744. }
  2745. return _rtcEngineImpl.SelectAudioTrack(index);
  2746. }
  2747. }
  2748. }