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, andagorasdk.4.log. - API call log files:
agoraapi.log,agoraapi.1.log,agoraapi.2.log,agoraapi.3.log, andagoraapi.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.logoragoraapi.log. - When
agorasdk.logis full, the SDK handles log files in the following order:- Delete
agorasdk.4.log(if exists); - Rename
agorasdk.3.logtoagorasdk.4.log; - Rename
agorasdk.2.logtoagorasdk.3.log; - Rename
agorasdk.1.logtoagorasdk.2.log; - Create a new
agorasdk.logfile.
- Delete
- The overwrite rule for
agoraapi.logis the same asagorasdk.log.
- SDK log files:
- 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.