IRTCEngine
Create IRTCEngine
Note: the log switch and log path used to be on
IRTCSetting (enable_stream_log / sdk_log_path) and have moved here—
they’re consumed while the engine itself initializes, before any channel object exists.
Release IRTCEngine
Get the version number
Note: the caller must allocate the memory before passing it in, at least 100 bytes.
Get the error code description
Note: the caller must allocate the memory for msg before passing it in, at least 100 bytes. The text is UTF-8, and the language is determined by
RTCEngine_SetLanguage(); English by default (don’t branch on the text—use the error code).
Set the language
Note: process-wide and can be called at any time. It affects srtc’s own error texts and is forwarded to the underlying
RTC_SetLanguage (subsequent backend requests then carry Accept-Language). English when never called; older versions always returned Chinese, so callers that display Chinese must set it explicitly after upgrading.
Get the last error message
Note: writes the text of the error code returned by the last srtc API call into the buffer (UTF-8, same language as
RTCEngine_SetLanguage(), English by default). That error code is maintained by srtc itself, not taken from the underlying library, and is updated whenever an API returns non-OK; call it right after a failing synchronous call. Empty when there is no error. With multiple threads, it reads the last error code within the process, which may be overwritten by another thread.
Basic functions
Set the event handler
Channel functions
You can join multiple channels at the same time. Each channel corresponds to an IRTCChannel object, and channel-level methods and callbacks are all on that object, instead of being distinguished by a leadingchannelId parameter on IRTCEngine as in older versions.
About channelId
channelIdis the value of thechannelfield in the token. The SDK parses it internally, and you get it throughIRTCChannel::getChannelId()channelIdis used only byleaveChannelandgetChannelIds; all other methods are called directly on the channel object
Create a channel object
Note: this only creates the object and doesn’t join the channel. After you get the object, set up its configuration and event handler, then call IRTCChannel::join().
Creating the same channel again returns
Conflict; if no channel can be parsed from the token, it returns SdkTokenInvalid.
Leave a channel
Leave all channels
Get the list of joined channels
Media streaming functions
Network speed test
Note: the test results are returned in the callback.
Get camera info
Get screen info
Get microphone info
Get speaker info
Other
Add a log to upload
Logs you add are uploaded to the log server.