Skip to content

How plugins work

Hao Yang edited this page Aug 24, 2019 · 4 revisions

How To Develop A Plugin

  1. Create a Xcode project & Visual Studio project, for Mac Plugin and VS Plugin respectively. You may take https://github.com/AgoraIO-Community/Agora-Electron-FaceUnity-Plugin as an example start project. You may also use cmake to configure your own lib for both platform together.
  2. Create your main Plugin source. The source needs to implement IAVFramePlugin.h interfaces including: (1) Video/Audio filter middleware
API Note
onPluginCaptureVideoFrame Called with Video data captured by SDK
onPluginRecordAudioFrame Called wit Audio Data captured by SDK
onPluginMixedAudioFrame Called with mixed Audio Frame
onPluginPlaybackAudioFrame Called with play audio frame

(2) Plugin lifecycle apis

API Note
Load Called when SDK needs initialization
Unload Called wit SDK needs deinitialization
Enable Called to enable plugin
Disable Called to disable plugin
setParameter Call to pass config parameters as string josn format
Release Call to release whole SDK instance
  1. Build corresponding dynamic libraries, i.e. dylib on macOS and dll on windows. Use registerPlugin api provided by Electron-SDK to load dynamic lib into memory to make it work.
Clone this wiki locally