Agora C++ API Reference for All Platforms

Public Member Functions | Public Attributes | List of all members
agora::rtc::RtcEngineContext Struct Reference

Inherited by agora::rtc::RtcEngineContextInternal.

## Public Member Functions
| RtcEngineContext ()

## Public Attributes
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

## Detailed Description

The context of IRtcEngine.

## Constructor & Destructor Documentation

## ◆ RtcEngineContext()

agora::rtc::RtcEngineContext::RtcEngineContext | ( |  | ) |
| inline

## Member Data Documentation

## ◆ eventHandler

IRtcEngineEventHandler* agora::rtc::RtcEngineContext::eventHandler

The event handler for IRtcEngine.

## ◆ appId

const char* agora::rtc::RtcEngineContext::appId

The App ID issued by Agora for your project. Only users in apps with 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 your App ID, call release to destroy the current IRtcEngine instance, and then create a new one.

## ◆ context

void* agora::rtc::RtcEngineContext::context

- For Android, it is the context of Activity or Application.
- For Windows, it is the window handle of app. Once set, this parameter enables you to plug or unplug the video devices while they are powered.

## ◆ channelProfile

CHANNEL_PROFILE_TYPE agora::rtc::RtcEngineContext::channelProfile

The channel profile. See CHANNEL_PROFILE_TYPE.

## ◆ license

const char* agora::rtc::RtcEngineContext::license

The license used for verification when connectting channel. Charge according to the license

## ◆ audioScenario

AUDIO_SCENARIO_TYPE agora::rtc::RtcEngineContext::audioScenario

The audio application scenario. See AUDIO_SCENARIO_TYPE.

Note
  Agora recommends the following scenarios:
  - `AUDIO_SCENARIO_DEFAULT(0)`
  - `AUDIO_SCENARIO_GAME_STREAMING(3)`

## ◆ areaCode

unsigned int agora::rtc::RtcEngineContext::areaCode

The region for connection. This is an advanced feature and applies to scenarios that have regional restrictions.

For the regions that Agora supports, see AREA_CODE. The area codes support bitwise operation.

After specifying the region, the app integrated with the Agora SDK connects to the Agora servers within that region.

## ◆ logConfig

commons::LogConfig agora::rtc::RtcEngineContext::logConfig

The log files that the SDK outputs. See LogConfig.

By default, the SDK generates five SDK log files and five API call log files with the following rules:

- The SDK log files are: `agorasdk.log`, `agorasdk.1.log`, `agorasdk.2.log`, `agorasdk.3.log`, and `agorasdk.4.log`.
- The API call log files are: `agoraapi.log`, `agoraapi.1.log`, `agoraapi.2.log`, `agoraapi.3.log`, and `agoraapi.4.log`.
- The default size for each SDK log file is 1,024 KB; the default size for each API call log file is 2,048 KB. These log files are encoded in UTF-8.
- The SDK writes the latest logs in `agorasdk.log` or `agoraapi.log`.
- When `agorasdk.log` is full, the SDK processes the log files in the following order:
  - Delete the `agorasdk.4.log` file (if any).
  - Rename `agorasdk.3.log` to `agorasdk.4.log`.
  - Rename `agorasdk.2.log` to `agorasdk.3.log`.
  - Rename `agorasdk.1.log` to `agorasdk.2.log`.
  - Create a new `agorasdk.log` file.

## ◆ threadPriority

Optional<THREAD_PRIORITY_TYPE> agora::rtc::RtcEngineContext::threadPriority

Thread priority for SDK common threads

## ◆ useExternalEglContext

bool agora::rtc::RtcEngineContext::useExternalEglContext

Whether to use egl context in the current thread as sdk‘s root egl context, which is shared by all egl related modules. eg. camera capture, video renderer.

Note
  This property applies to Android only.

## ◆ domainLimit

bool agora::rtc::RtcEngineContext::domainLimit

Determines whether to enable domain limit -true: only connect to servers which already parsed by DNS -false: (Default) connect to servers with no limit

## ◆ autoRegisterAgoraExtensions

bool agora::rtc::RtcEngineContext::autoRegisterAgoraExtensions

Whether to automatically register Agora extensions when initializing RtcEngine. -true: (Default) Automatically register Agora extensions. -false: Do not automatically register Agora extensions. The user calls EnableExtension to manually register an Agora extension.