RtcEngineContext

Used to configure the RtcEngineContext instance.

struct RtcEngineContext {
  IRtcEngineEventHandler* eventHandler;
  const char* appId;
  void* context;
  CHANNEL_PROFILE_TYPE channelProfile;
  const char* license;
  AUDIO_SCENARIO_TYPE audioScenario;
  unsigned int areaCode;
  commons::LogConfig logConfig;
  Optional<THREAD_PRIORITY_TYPE> threadPriority;
  bool useExternalEglContext;
  bool domainLimit;
  bool autoRegisterAgoraExtensions;
};

Properties

eventHandler
Event handler for IRtcEngine. See IRtcEngineEventHandler.
appId
App ID issued by Agora for your project. Only users under the same App ID can join the same channel and communicate with each other. An App ID can only be used to create one IRtcEngine instance. To change the App ID, you must call release to destroy the current IRtcEngine instance and then create a new one.
context
On Windows platform, this parameter is the application window handle. After setting, it allows connecting or disconnecting video devices while the device is powered on.
channelProfile
Channel profile type. See CHANNEL_PROFILE_TYPE.
license
License used for authentication when joining a channel. Charges are based on the license.
audioScenario
Audio scenario type. Different scenarios use different volume types. See AUDIO_SCENARIO_TYPE.
areaCode
Connection region. This advanced feature is for scenarios with regional restrictions. Supported regions are listed in AREA_CODE. Area codes support bitwise operations.
logConfig
Log configuration. See LogConfig. By default, the SDK generates five SDK log files and five API call log files as follows:
  • SDK log files: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
  • API call log files: agoraapi.log, agoraapi.1.log, agoraapi.2.log, agoraapi.3.log, and agoraapi.4.log.
  • Each log file has a default size of 2048 KB and is encoded in UTF-8.
  • The SDK writes the latest logs to agorasdk.log or agoraapi.log.
  • When agorasdk.log is full, the SDK handles log files in the following order:
    1. Delete agorasdk.4.log (if exists);
    2. Rename agorasdk.3.log to agorasdk.4.log;
    3. Rename agorasdk.2.log to agorasdk.3.log;
    4. Rename agorasdk.1.log to agorasdk.2.log;
    5. Create a new agorasdk.log file.
  • The overwrite rule for agoraapi.log is the same as agorasdk.log.
threadPriority
Thread priority for SDK general threads. See THREAD_PRIORITY_TYPE.
useExternalEglContext
Note: (Android only)
Whether to use the EGL context in the current thread as the root EGL context for the SDK. This context is shared by all EGL-related modules, such as camera capture and video rendering.
  • true: Use the EGL context in the current thread.
  • false: (default) Do not use the EGL context in the current thread.
domainLimit
Whether to enable domain restriction:
  • true: Enable domain restriction. Suitable for IoT devices using IoT SIM cards to access the network. The SDK only connects to servers in the domain or IP whitelist reported to the carrier.
  • false: (default) Do not enable domain restriction. Suitable for most common scenarios.
autoRegisterAgoraExtensions
Whether to automatically register Agora extensions when initializing IRtcEngine:
  • true: (default) Automatically register extensions.
  • false: Do not automatically register extensions. You need to manually register using enableExtension.