Agora Java API Reference for Android
Public Member Functions | List of all members
agora::rtc::IRtcEngineEx Class Referenceabstract
Inheritance diagram for agora::rtc::IRtcEngineEx:
agora::rtc::IRtcEngine agora::base::IEngineBase

Public Member Functions

virtual int joinChannelEx (const char *token, const RtcConnection &connection, const ChannelMediaOptions &options, IRtcEngineEventHandler *eventHandler)=0
 Joins a channel. More...
 
virtual int leaveChannelEx (const RtcConnection &connection)=0
 Leaves a channel. More...
 
virtual int leaveChannelEx (const RtcConnection &connection, const LeaveChannelOptions &options)=0
 Sets channel options and leaves the channel. More...
 
virtual int leaveChannelWithUserAccountEx (const char *channelId, const char *userAccount)=0
 
virtual int leaveChannelWithUserAccountEx (const char *channelId, const char *userAccount, const LeaveChannelOptions &options)=0
 
virtual int updateChannelMediaOptionsEx (const ChannelMediaOptions &options, const RtcConnection &connection)=0
 Updates the channel media options after joining the channel. More...
 
virtual int setVideoEncoderConfigurationEx (const VideoEncoderConfiguration &config, const RtcConnection &connection)=0
 Sets the video encoder configuration. More...
 
virtual int setupRemoteVideoEx (const VideoCanvas &canvas, const RtcConnection &connection)=0
 Initializes the video view of a remote user. More...
 
virtual int muteRemoteAudioStreamEx (uid_t uid, bool mute, const RtcConnection &connection)=0
 Stops or resumes receiving the audio stream of a specified user. More...
 
virtual int muteRemoteVideoStreamEx (uid_t uid, bool mute, const RtcConnection &connection)=0
 Stops or resumes receiving the video stream of a specified user. More...
 
virtual int setRemoteVideoStreamTypeEx (uid_t uid, VIDEO_STREAM_TYPE streamType, const RtcConnection &connection)=0
 Sets the video stream type to subscribe to. More...
 
virtual int muteLocalAudioStreamEx (bool mute, const RtcConnection &connection)=0
 Stops or resumes publishing the local audio stream. More...
 
virtual int muteLocalVideoStreamEx (bool mute, const RtcConnection &connection)=0
 Stops or resumes publishing the local video stream. More...
 
virtual int muteAllRemoteAudioStreamsEx (bool mute, const RtcConnection &connection)=0
 Stops or resumes subscribing to the audio streams of all remote users. More...
 
virtual int muteAllRemoteVideoStreamsEx (bool mute, const RtcConnection &connection)=0
 Stops or resumes subscribing to the video streams of all remote users. More...
 
virtual int setSubscribeAudioBlocklistEx (uid_t *uidList, int uidNumber, const RtcConnection &connection)=0
 Sets the blocklist of subscriptions for audio streams. More...
 
virtual int setSubscribeAudioAllowlistEx (uid_t *uidList, int uidNumber, const RtcConnection &connection)=0
 Sets the allowlist of subscriptions for audio streams. More...
 
virtual int setSubscribeVideoBlocklistEx (uid_t *uidList, int uidNumber, const RtcConnection &connection)=0
 Sets the blocklist of subscriptions for video streams. More...
 
virtual int setSubscribeVideoAllowlistEx (uid_t *uidList, int uidNumber, const RtcConnection &connection)=0
 Sets the allowlist of subscriptions for video streams. More...
 
virtual int setRemoteVideoSubscriptionOptionsEx (uid_t uid, const VideoSubscriptionOptions &options, const RtcConnection &connection)=0
 Sets options for subscribing to remote video streams. More...
 
virtual int setRemoteVoicePositionEx (uid_t uid, double pan, double gain, const RtcConnection &connection)=0
 Sets the 2D position (the position on the horizontal plane) of the remote user's voice. More...
 
virtual int setRemoteUserSpatialAudioParamsEx (uid_t uid, const agora::SpatialAudioParams &params, const RtcConnection &connection)=0
 
virtual int setRemoteRenderModeEx (uid_t uid, media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode, const RtcConnection &connection)=0
 Sets the video display mode of a specified remote user. More...
 
virtual int enableLoopbackRecordingEx (const RtcConnection &connection, bool enabled, const char *deviceName=NULL)=0
 Enables loopback audio capturing. More...
 
virtual int adjustRecordingSignalVolumeEx (int volume, const RtcConnection &connection)=0
 
virtual int muteRecordingSignalEx (bool mute, const RtcConnection &connection)=0
 
virtual int adjustUserPlaybackSignalVolumeEx (uid_t uid, int volume, const RtcConnection &connection)=0
 Adjusts the playback signal volume of a specified remote user. More...
 
virtual CONNECTION_STATE_TYPE getConnectionStateEx (const RtcConnection &connection)=0
 Gets the current connection state of the SDK. More...
 
virtual int enableEncryptionEx (const RtcConnection &connection, bool enabled, const EncryptionConfig &config)=0
 Enables or disables the built-in encryption. More...
 
virtual int createDataStreamEx (int *streamId, bool reliable, bool ordered, const RtcConnection &connection)=0
 Creates a data stream. More...
 
virtual int createDataStreamEx (int *streamId, const DataStreamConfig &config, const RtcConnection &connection)=0
 Creates a data stream. More...
 
virtual int sendStreamMessageEx (int streamId, const char *data, size_t length, const RtcConnection &connection)=0
 Sends data stream messages. More...
 
virtual int sendRdtMessageEx (uid_t uid, RdtStreamType type, const char *data, size_t length, const RtcConnection &connection)=0
 Send Reliable message to remote uid in channel. More...
 
virtual int sendMediaControlMessageEx (uid_t uid, const char *data, size_t length, const RtcConnection &connection)=0
 Send media control message. More...
 
virtual int addVideoWatermarkEx (const char *watermarkUrl, const WatermarkOptions &options, const RtcConnection &connection)=0
 Adds a watermark image to the local video. More...
 
virtual int addVideoWatermarkEx (const WatermarkConfig &config, const RtcConnection &connection)=0
 Adds a watermark image to the local video. More...
 
virtual int removeVideoWatermarkEx (const char *id, const RtcConnection &connection)=0
 Removes the specified watermark image from the local or remote video stream. More...
 
virtual int clearVideoWatermarkEx (const RtcConnection &connection)=0
 Removes the watermark image from the video stream. More...
 
virtual int sendCustomReportMessageEx (const char *id, const char *category, const char *event, const char *label, int value, const RtcConnection &connection)=0
 Agora supports reporting and analyzing customized messages. More...
 
virtual int enableAudioVolumeIndicationEx (int interval, int smooth, bool reportVad, const RtcConnection &connection)=0
 Enables the reporting of users' volume indication. More...
 
virtual int startRtmpStreamWithoutTranscodingEx (const char *url, const RtcConnection &connection)=0
 Starts pushing media streams to a CDN without transcoding. More...
 
virtual int startRtmpStreamWithTranscodingEx (const char *url, const LiveTranscoding &transcoding, const RtcConnection &connection)=0
 Starts Media Push and sets the transcoding configuration. More...
 
virtual int updateRtmpTranscodingEx (const LiveTranscoding &transcoding, const RtcConnection &connection)=0
 Updates the transcoding configuration. More...
 
virtual int stopRtmpStreamEx (const char *url, const RtcConnection &connection)=0
 Stops pushing media streams to a CDN. More...
 
virtual int startOrUpdateChannelMediaRelayEx (const ChannelMediaRelayConfiguration &configuration, const RtcConnection &connection)=0
 Starts relaying media streams across channels or updates channels for media relay. More...
 
virtual int stopChannelMediaRelayEx (const RtcConnection &connection)=0
 Stops the media stream relay. Once the relay stops, the host quits all the target channels. More...
 
virtual int pauseAllChannelMediaRelayEx (const RtcConnection &connection)=0
 Pauses the media stream relay to all target channels. More...
 
virtual int resumeAllChannelMediaRelayEx (const RtcConnection &connection)=0
 Resumes the media stream relay to all target channels. More...
 
virtual int getUserInfoByUserAccountEx (const char *userAccount, rtc::UserInfo *userInfo, const RtcConnection &connection)=0
 
virtual int getUserInfoByUidEx (uid_t uid, rtc::UserInfo *userInfo, const RtcConnection &connection)=0
 
virtual int enableDualStreamModeEx (bool enabled, const SimulcastStreamConfig &streamConfig, const RtcConnection &connection)=0
 Enables or disables dual-stream mode on the sender side. More...
 
virtual int setDualStreamModeEx (SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig &streamConfig, const RtcConnection &connection)=0
 Sets the dual-stream mode on the sender side. More...
 
virtual int setSimulcastConfigEx (const SimulcastConfig &simulcastConfig, const RtcConnection &connection)=0
 Sets the simulcast video stream configuration. More...
 
virtual int setHighPriorityUserListEx (uid_t *uidList, int uidNum, STREAM_FALLBACK_OPTIONS option, const RtcConnection &connection)=0
 
virtual int takeSnapshotEx (const RtcConnection &connection, uid_t uid, const char *filePath)=0
 Takes a snapshot of a video stream using connection ID. More...
 
virtual int takeSnapshotEx (const RtcConnection &connection, uid_t uid, const media::SnapshotConfig &config)=0
 Gets a video screenshot of the specified observation point using the connection ID. More...
 
virtual int enableContentInspectEx (bool enabled, const media::ContentInspectConfig &config, const RtcConnection &connection)=0
 Enables or disables video screenshot and upload. More...
 
virtual int startMediaRenderingTracingEx (const RtcConnection &connection)=0
 Enables tracing the video frame rendering process. More...
 
virtual int setParametersEx (const RtcConnection &connection, const char *parameters)=0
 
virtual int getCallIdEx (agora::util::AString &callId, const RtcConnection &connection)=0
 Gets the call ID with the connection ID. More...
 
virtual int sendAudioMetadataEx (const RtcConnection &connection, const char *metadata, size_t length)=0
 
virtual int preloadEffectEx (const RtcConnection &connection, int soundId, const char *filePath, int startPos=0)=0
 Preloads a specified sound effect to a channel. More...
 
virtual int playEffectEx (const RtcConnection &connection, int soundId, const char *filePath, int loopCount, double pitch, double pan, int gain, bool publish=false, int startPos=0)=0
 Plays a specified sound effect in a channel. More...
 
- Public Member Functions inherited from agora::rtc::IRtcEngine
virtual int initialize (const RtcEngineContext &context)=0
 Initializes IRtcEngine. More...
 
virtual int queryInterface (INTERFACE_ID_TYPE iid, void **inter)=0
 Gets the pointer to the specified interface. More...
 
virtual const char * getVersion (int *build)=0
 Gets the SDK version. More...
 
virtual const char * getErrorDescription (int code)=0
 Gets the warning or error description. More...
 
virtual int queryCodecCapability (CodecCapInfo *codecInfo, int &size)=0
 Queries the video codec capabilities of the SDK. More...
 
virtual int queryDeviceScore ()=0
 Queries device score. More...
 
virtual int preloadChannel (const char *token, const char *channelId, uid_t uid)=0
 Preloads a channel with token, channelId, and uid. More...
 
virtual int preloadChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount)=0
 Preloads a channel with token, channelId, and userAccount. More...
 
virtual int updatePreloadChannelToken (const char *token)=0
 Updates the wildcard token for preloading channels. More...
 
virtual int joinChannel (const char *token, const char *channelId, const char *info, uid_t uid)=0
 Joins a channel. More...
 
virtual int joinChannel (const char *token, const char *channelId, uid_t uid, const ChannelMediaOptions &options)=0
 Joins a channel with media options. More...
 
virtual int updateChannelMediaOptions (const ChannelMediaOptions &options)=0
 Updates the channel media options after joining the channel. More...
 
virtual int leaveChannel ()=0
 Leaves a channel. More...
 
virtual int leaveChannel (const LeaveChannelOptions &options)=0
 Sets channel options and leaves the channel. More...
 
virtual int renewToken (const char *token)=0
 Renews the token. More...
 
virtual int setChannelProfile (CHANNEL_PROFILE_TYPE profile)=0
 Sets the channel profile. More...
 
virtual int setClientRole (CLIENT_ROLE_TYPE role)=0
 Sets the client role. More...
 
virtual int setClientRole (CLIENT_ROLE_TYPE role, const ClientRoleOptions &options)=0
 Sets the user role and the audience latency level in a live streaming scenario. More...
 
virtual int startEchoTest (const EchoTestConfiguration &config)=0
 Starts an audio device loopback test. More...
 
virtual int stopEchoTest ()=0
 Stops the audio call test. More...
 
virtual int enableVideo ()=0
 Enables the video module. More...
 
virtual int disableVideo ()=0
 Disables the video module. More...
 
virtual int startPreview ()=0
 Enables the local video preview. More...
 
virtual int startPreview (VIDEO_SOURCE_TYPE sourceType)=0
 Enables the local video preview and specifies the video source for the preview. More...
 
virtual int stopPreview ()=0
 Stops the local video preview. More...
 
virtual int stopPreview (VIDEO_SOURCE_TYPE sourceType)=0
 Stops the local video preview. More...
 
virtual int startLastmileProbeTest (const LastmileProbeConfig &config)=0
 Starts the last mile network probe test. More...
 
virtual int stopLastmileProbeTest ()=0
 Stops the last mile network probe test. More...
 
virtual int setVideoEncoderConfiguration (const VideoEncoderConfiguration &config)=0
 Sets the video encoder configuration. More...
 
virtual int setBeautyEffectOptions (bool enabled, const BeautyOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Sets the image enhancement options. More...
 
virtual int setFaceShapeBeautyOptions (bool enabled, const FaceShapeBeautyOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Sets the face shape options and specifies the media source. More...
 
virtual int setFaceShapeAreaOptions (const FaceShapeAreaOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Sets the image enhancement options for facial areas and specifies the media source. More...
 
virtual int getFaceShapeBeautyOptions (FaceShapeBeautyOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Gets the beauty effect options. More...
 
virtual int getFaceShapeAreaOptions (agora::rtc::FaceShapeAreaOptions::FACE_SHAPE_AREA shapeArea, FaceShapeAreaOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Gets the facial beauty area options. More...
 
virtual int setFilterEffectOptions (bool enabled, const FilterEffectOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Sets the filter effect options and specifies the media source. More...
 
virtual agora_refptr< IVideoEffectObjectcreateVideoEffectObject (const char *bundlePath, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Creates a video effect object. More...
 
virtual int destroyVideoEffectObject (agora_refptr< IVideoEffectObject > videoEffectObject)=0
 Destroys a video effect object. More...
 
virtual int setLowlightEnhanceOptions (bool enabled, const LowlightEnhanceOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Sets low-light enhancement. More...
 
virtual int setVideoDenoiserOptions (bool enabled, const VideoDenoiserOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Sets video noise reduction. More...
 
virtual int setColorEnhanceOptions (bool enabled, const ColorEnhanceOptions &options, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Sets color enhancement. More...
 
virtual int enableVirtualBackground (bool enabled, VirtualBackgroundSource backgroundSource, SegmentationProperty segproperty, agora::media::MEDIA_SOURCE_TYPE type=agora::media::PRIMARY_CAMERA_SOURCE)=0
 Enables/Disables the virtual background. More...
 
virtual int setupRemoteVideo (const VideoCanvas &canvas)=0
 Initializes the video view of a remote user. More...
 
virtual int setupLocalVideo (const VideoCanvas &canvas)=0
 Initializes the local video view. More...
 
virtual int setVideoScenario (VIDEO_APPLICATION_SCENARIO_TYPE scenarioType)=0
 Sets video application scenarios. More...
 
virtual int setVideoQoEPreference (VIDEO_QOE_PREFERENCE_TYPE qoePreference)=0
 
virtual int enableAudio ()=0
 Enables the audio module. More...
 
virtual int disableAudio ()=0
 Disables the audio module. More...
 
virtual int setAudioProfile (AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) __deprecated=0
 Sets the audio profile and audio scenario. More...
 
virtual int setAudioProfile (AUDIO_PROFILE_TYPE profile)=0
 Sets audio profiles. More...
 
virtual int setAudioScenario (AUDIO_SCENARIO_TYPE scenario)=0
 Sets audio scenarios. More...
 
virtual int enableLocalAudio (bool enabled)=0
 Enables or disables the local audio capture. More...
 
virtual int muteLocalAudioStream (bool mute)=0
 Stops or resumes publishing the local audio stream. More...
 
virtual int muteAllRemoteAudioStreams (bool mute)=0
 Stops or resumes subscribing to the audio streams of all remote users. More...
 
virtual int muteRemoteAudioStream (uid_t uid, bool mute)=0
 Stops or resumes subscribing to the audio stream of a specified user. More...
 
virtual int muteLocalVideoStream (bool mute)=0
 Stops or resumes publishing the local video stream. More...
 
virtual int enableLocalVideo (bool enabled)=0
 Enables/Disables the local video capture. More...
 
virtual int muteAllRemoteVideoStreams (bool mute)=0
 Stops or resumes subscribing to the video streams of all remote users. More...
 
virtual int setRemoteDefaultVideoStreamType (VIDEO_STREAM_TYPE streamType)=0
 Sets the default video stream type to subscribe to. More...
 
virtual int muteRemoteVideoStream (uid_t uid, bool mute)=0
 Stops or resumes subscribing to the video stream of a specified user. More...
 
virtual int setRemoteVideoStreamType (uid_t uid, VIDEO_STREAM_TYPE streamType)=0
 Sets the video stream type to subscribe to. More...
 
virtual int setRemoteVideoSubscriptionOptions (uid_t uid, const VideoSubscriptionOptions &options)=0
 Options for subscribing to remote video streams. More...
 
virtual int setSubscribeAudioBlocklist (uid_t *uidList, int uidNumber)=0
 Sets the blocklist of subscriptions for audio streams. More...
 
virtual int setSubscribeAudioAllowlist (uid_t *uidList, int uidNumber)=0
 Sets the allowlist of subscriptions for audio streams. More...
 
virtual int setSubscribeVideoBlocklist (uid_t *uidList, int uidNumber)=0
 Sets the blocklist of subscriptions for video streams. More...
 
virtual int setSubscribeVideoAllowlist (uid_t *uidList, int uidNumber)=0
 Sets the allowlist of subscriptions for video streams. More...
 
virtual int enableAudioVolumeIndication (int interval, int smooth, bool reportVad)=0
 Enables the reporting of users' volume indication. More...
 
virtual int startAudioRecording (const char *filePath, AUDIO_RECORDING_QUALITY_TYPE quality)=0
 Starts client-side audio recording with recording configuration. More...
 
virtual int startAudioRecording (const char *filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality)=0
 Starts client-side audio recording and sets the recording sample rate. More...
 
virtual int startAudioRecording (const AudioRecordingConfiguration &config)=0
 
virtual int registerAudioEncodedFrameObserver (const AudioEncodedFrameObserverConfig &config, IAudioEncodedFrameObserver *observer)=0
 Registers an encoded audio observer. More...
 
virtual int stopAudioRecording ()=0
 Stops client-side audio recording. More...
 
virtual agora_refptr< IMediaPlayer > createMediaPlayer ()=0
 Creates a media player object. More...
 
virtual int destroyMediaPlayer (agora_refptr< IMediaPlayer > media_player)=0
 Destroys the media player instance. More...
 
virtual agora_refptr< IMediaRecordercreateMediaRecorder (const RecorderStreamInfo &info)=0
 Creates an audio and video recording object. More...
 
virtual int destroyMediaRecorder (agora_refptr< IMediaRecorder > mediaRecorder)=0
 Destroys an audio and video recording object. More...
 
virtual int startAudioMixing (const char *filePath, bool loopback, int cycle)=0
 Starts playing the music file. More...
 
virtual int startAudioMixing (const char *filePath, bool loopback, int cycle, int startPos)=0
 Starts playing the music file. More...
 
virtual int stopAudioMixing ()=0
 Stops playing the music file. More...
 
virtual int pauseAudioMixing ()=0
 Pauses playing and mixing the music file. More...
 
virtual int resumeAudioMixing ()=0
 Resumes playing and mixing the music file. More...
 
virtual int selectAudioTrack (int index)=0
 Selects the audio track used during playback. More...
 
virtual int getAudioTrackCount ()=0
 Gets the index of audio tracks of the current music file. More...
 
virtual int adjustAudioMixingVolume (int volume)=0
 Adjusts the volume during audio mixing. More...
 
virtual int adjustAudioMixingPublishVolume (int volume)=0
 Adjusts the volume of audio mixing for publishing. More...
 
virtual int getAudioMixingPublishVolume ()=0
 Retrieves the audio mixing volume for publishing. More...
 
virtual int adjustAudioMixingPlayoutVolume (int volume)=0
 Adjusts the volume of audio mixing for local playback. More...
 
virtual int getAudioMixingPlayoutVolume ()=0
 Retrieves the audio mixing volume for local playback. More...
 
virtual int getAudioMixingDuration ()=0
 Retrieves the duration (ms) of the music file. More...
 
virtual int getAudioMixingCurrentPosition ()=0
 Retrieves the playback position (ms) of the music file. More...
 
virtual int setAudioMixingPosition (int pos)=0
 Sets the audio mixing position. More...
 
virtual int setAudioMixingDualMonoMode (media::AUDIO_MIXING_DUAL_MONO_MODE mode)=0
 Sets the channel mode of the current audio file. More...
 
virtual int setAudioMixingPitch (int pitch)=0
 Sets the pitch of the local music file. More...
 
virtual int setAudioMixingPlaybackSpeed (int speed)=0
 Sets the playback speed of the current audio file. More...
 
virtual int getEffectsVolume ()=0
 Retrieves the volume of the audio effects. More...
 
virtual int setEffectsVolume (int volume)=0
 Sets the volume of the audio effects. More...
 
virtual int preloadEffect (int soundId, const char *filePath, int startPos=0)=0
 Preloads a specified audio effect file into the memory. More...
 
virtual int playEffect (int soundId, const char *filePath, int loopCount, double pitch, double pan, int gain, bool publish=false, int startPos=0)=0
 Plays the specified local or online audio effect file. More...
 
virtual int playAllEffects (int loopCount, double pitch, double pan, int gain, bool publish=false)=0
 Plays all audio effect files. More...
 
virtual int getVolumeOfEffect (int soundId)=0
 Gets the volume of a specified audio effect file. More...
 
virtual int setVolumeOfEffect (int soundId, int volume)=0
 Gets the volume of a specified audio effect file. More...
 
virtual int pauseEffect (int soundId)=0
 Pauses a specified audio effect file. More...
 
virtual int pauseAllEffects ()=0
 Pauses all audio effects. More...
 
virtual int resumeEffect (int soundId)=0
 Resumes playing a specified audio effect. More...
 
virtual int resumeAllEffects ()=0
 Resumes playing all audio effect files. More...
 
virtual int stopEffect (int soundId)=0
 Stops playing a specified audio effect. More...
 
virtual int stopAllEffects ()=0
 Stops playing all audio effects. More...
 
virtual int unloadEffect (int soundId)=0
 Releases a specified preloaded audio effect from the memory. More...
 
virtual int unloadAllEffects ()=0
 Releases a specified preloaded audio effect from the memory. More...
 
virtual int getEffectDuration (const char *filePath)=0
 Retrieves the duration of the audio effect file. More...
 
virtual int setEffectPosition (int soundId, int pos)=0
 Sets the playback position of an audio effect file. More...
 
virtual int getEffectCurrentPosition (int soundId)=0
 Retrieves the playback position of the audio effect file. More...
 
virtual int enableSoundPositionIndication (bool enabled)=0
 Enables or disables stereo panning for remote users. More...
 
virtual int setRemoteVoicePosition (uid_t uid, double pan, double gain)=0
 Sets the 2D position (the position on the horizontal plane) of the remote user's voice. More...
 
virtual int enableSpatialAudio (bool enabled)=0
 Enables or disables the spatial audio effect. More...
 
virtual int setRemoteUserSpatialAudioParams (uid_t uid, const agora::SpatialAudioParams &params)=0
 Sets the spatial audio effect parameters of the remote user. More...
 
virtual int setVoiceBeautifierPreset (VOICE_BEAUTIFIER_PRESET preset)=0
 Sets a preset voice beautifier effect. More...
 
virtual int setAudioEffectPreset (AUDIO_EFFECT_PRESET preset)=0
 Sets an SDK preset audio effect. More...
 
virtual int setVoiceConversionPreset (VOICE_CONVERSION_PRESET preset)=0
 Sets a preset voice beautifier effect. More...
 
virtual int setAudioEffectParameters (AUDIO_EFFECT_PRESET preset, int param1, int param2)=0
 Sets parameters for SDK preset audio effects. More...
 
virtual int setVoiceBeautifierParameters (VOICE_BEAUTIFIER_PRESET preset, int param1, int param2)=0
 Sets parameters for the preset voice beautifier effects. More...
 
virtual int setVoiceConversionParameters (VOICE_CONVERSION_PRESET preset, int param1, int param2)=0
 
virtual int setLocalVoicePitch (double pitch)=0
 Changes the voice pitch of the local speaker. More...
 
virtual int setLocalVoiceFormant (double formantRatio)=0
 Sets the formant ratio to change the timbre of human voice. More...
 
virtual int setLocalVoiceEqualization (AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain)=0
 Sets the local voice equalization effect. More...
 
virtual int setLocalVoiceReverb (AUDIO_REVERB_TYPE reverbKey, int value)=0
 Sets the local voice reverberation. More...
 
virtual int setHeadphoneEQPreset (HEADPHONE_EQUALIZER_PRESET preset)=0
 Sets the preset headphone equalization effect. More...
 
virtual int setHeadphoneEQParameters (int lowGain, int highGain)=0
 Sets the low- and high-frequency parameters of the headphone equalizer. More...
 
virtual int enableVoiceAITuner (bool enabled, VOICE_AI_TUNER_TYPE type)=0
 Enables or disables the voice AI tuner. More...
 
virtual int setLogFile (const char *filePath)=0
 Sets the log file. More...
 
virtual int setLogFilter (unsigned int filter)=0
 Sets the log output level of the SDK. More...
 
virtual int setLogLevel (commons::LOG_LEVEL level)=0
 Sets the output log level of the SDK. More...
 
virtual int setLogFileSize (unsigned int fileSizeInKBytes)=0
 Sets the log file size. More...
 
virtual int uploadLogFile (agora::util::AString &requestId)=0
 
virtual int writeLog (commons::LOG_LEVEL level, const char *fmt,...)=0
 
virtual int setLocalRenderMode (media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0
 Updates the display mode of the local video view. More...
 
virtual int setRemoteRenderMode (uid_t uid, media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0
 Updates the display mode of the video view of a remote user. More...
 
virtual int setLocalRenderTargetFps (VIDEO_SOURCE_TYPE sourceType, int targetFps)=0
 Sets the maximum frame rate for rendering local video. More...
 
virtual int setRemoteRenderTargetFps (int targetFps)=0
 Sets the maximum frame rate for rendering remote video. More...
 
virtual int setLocalRenderMode (media::base::RENDER_MODE_TYPE renderMode) __deprecated=0
 
virtual int setLocalVideoMirrorMode (VIDEO_MIRROR_MODE_TYPE mirrorMode) __deprecated=0
 Sets the local video mirror mode. More...
 
virtual int enableDualStreamMode (bool enabled) __deprecated=0
 Enables or disables dual-stream mode on the sender side. More...
 
virtual int enableDualStreamMode (bool enabled, const SimulcastStreamConfig &streamConfig) __deprecated=0
 Sets the dual-stream mode on the sender side and the low-quality video stream. More...
 
virtual int setDualStreamMode (SIMULCAST_STREAM_MODE mode)=0
 Sets the dual-stream mode on the sender side. More...
 
virtual int setSimulcastConfig (const SimulcastConfig &simulcastConfig)=0
 Sets the simulcast video stream configuration. More...
 
virtual int setDualStreamMode (SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig &streamConfig)=0
 Sets dual-stream mode configuration on the sender side. More...
 
virtual int enableCustomAudioLocalPlayback (track_id_t trackId, bool enabled)=0
 Sets whether to enable the local playback of external audio source. More...
 
virtual int setRecordingAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0
 Sets the format of the captured raw audio data. More...
 
virtual int setPlaybackAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0
 Sets the format of the raw audio playback data. More...
 
virtual int setMixedAudioFrameParameters (int sampleRate, int channel, int samplesPerCall)=0
 Sets the format of the raw audio data after mixing for audio capture and playback. More...
 
virtual int setEarMonitoringAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0
 Sets the format of the in-ear monitoring raw audio data. More...
 
virtual int setPlaybackAudioFrameBeforeMixingParameters (int sampleRate, int channel)=0
 Sets the format of the raw audio playback data before mixing. More...
 
virtual int setPlaybackAudioFrameBeforeMixingParameters (int sampleRate, int channel, int samplesPerCall)=0
 Sets the format of audio data in the onPlaybackAudioFrameBeforeMixing callback. More...
 
virtual int enableAudioSpectrumMonitor (int intervalInMS=100)=0
 Turns on audio spectrum monitoring. More...
 
virtual int disableAudioSpectrumMonitor ()=0
 Disables audio spectrum monitoring. More...
 
virtual int registerAudioSpectrumObserver (agora::media::IAudioSpectrumObserver *observer)=0
 Registers an audio spectrum observer. More...
 
virtual int unregisterAudioSpectrumObserver (agora::media::IAudioSpectrumObserver *observer)=0
 Unregisters the audio spectrum observer. More...
 
virtual int adjustRecordingSignalVolume (int volume)=0
 Adjusts the capturing signal volume. More...
 
virtual int muteRecordingSignal (bool mute)=0
 Whether to mute the recording signal. More...
 
virtual int adjustPlaybackSignalVolume (int volume)=0
 Adjusts the playback signal volume of all remote users. More...
 
virtual int adjustUserPlaybackSignalVolume (uid_t uid, int volume)=0
 Adjusts the playback signal volume of a specified remote user. More...
 
virtual int setRemoteSubscribeFallbackOption (STREAM_FALLBACK_OPTIONS option)=0
 Sets the fallback option for the subscribed video stream based on the network conditions. More...
 
virtual int setHighPriorityUserList (uid_t *uidList, int uidNum, STREAM_FALLBACK_OPTIONS option)=0
 
virtual int enableExtension (const char *provider, const char *extension, const ExtensionInfo &extensionInfo, bool enable=true)=0
 
virtual int setExtensionProperty (const char *provider, const char *extension, const ExtensionInfo &extensionInfo, const char *key, const char *value)=0
 
virtual int getExtensionProperty (const char *provider, const char *extension, const ExtensionInfo &extensionInfo, const char *key, char *value, int buf_len)=0
 
virtual int enableLoopbackRecording (bool enabled, const char *deviceName=NULL)=0
 Enables loopback audio capturing. More...
 
virtual int adjustLoopbackSignalVolume (int volume)=0
 Adjusts the volume of the signal captured by the sound card. More...
 
virtual int getLoopbackRecordingVolume ()=0
 
virtual int enableInEarMonitoring (bool enabled, int includeAudioFilters)=0
 Enables in-ear monitoring. More...
 
virtual int setInEarMonitoringVolume (int volume)=0
 Sets the volume of the in-ear monitor. More...
 
virtual int setExtensionProviderProperty (const char *provider, const char *key, const char *value)=0
 Sets the properties of the extension provider. More...
 
virtual int registerExtension (const char *provider, const char *extension, agora::media::MEDIA_SOURCE_TYPE type=agora::media::UNKNOWN_MEDIA_SOURCE)=0
 Registers an extension. More...
 
virtual int enableExtension (const char *provider, const char *extension, bool enable=true, agora::media::MEDIA_SOURCE_TYPE type=agora::media::UNKNOWN_MEDIA_SOURCE)=0
 Enables or disables extensions. More...
 
virtual int setExtensionProperty (const char *provider, const char *extension, const char *key, const char *value, agora::media::MEDIA_SOURCE_TYPE type=agora::media::UNKNOWN_MEDIA_SOURCE)=0
 Sets the properties of the extension. More...
 
virtual int getExtensionProperty (const char *provider, const char *extension, const char *key, char *value, int buf_len, agora::media::MEDIA_SOURCE_TYPE type=agora::media::UNKNOWN_MEDIA_SOURCE)=0
 Gets detailed information on the extensions. More...
 
virtual int setCameraCapturerConfiguration (const CameraCapturerConfiguration &config)=0
 Sets the camera capture configuration. More...
 
virtual video_track_id_t createCustomVideoTrack ()=0
 Creates a custom video track. More...
 
virtual video_track_id_t createCustomEncodedVideoTrack (const SenderOptions &sender_option)=0
 
virtual int destroyCustomVideoTrack (video_track_id_t video_track_id)=0
 Destroys the specified video track. More...
 
virtual int destroyCustomEncodedVideoTrack (video_track_id_t video_track_id)=0
 
virtual int getCallId (agora::util::AString &callId)=0
 Retrieves the call ID. More...
 
virtual int rate (const char *callId, int rating, const char *description)=0
 Allows a user to rate a call after the call ends. More...
 
virtual int complain (const char *callId, const char *description)=0
 Allows a user to complain about the call quality after a call ends. More...
 
virtual int startRtmpStreamWithoutTranscoding (const char *url)=0
 Starts pushing media streams to a CDN without transcoding. More...
 
virtual int startRtmpStreamWithTranscoding (const char *url, const LiveTranscoding &transcoding)=0
 Starts Media Push and sets the transcoding configuration. More...
 
virtual int updateRtmpTranscoding (const LiveTranscoding &transcoding)=0
 Updates the transcoding configuration. More...
 
virtual int startLocalVideoTranscoder (const LocalTranscoderConfiguration &config)=0
 Starts the local video mixing. More...
 
virtual int updateLocalTranscoderConfiguration (const LocalTranscoderConfiguration &config)=0
 Updates the local video mixing configuration. More...
 
virtual int stopRtmpStream (const char *url)=0
 Stops pushing media streams to a CDN. More...
 
virtual int stopLocalVideoTranscoder ()=0
 Stops the local video mixing. More...
 
virtual int startLocalAudioMixer (const LocalAudioMixerConfiguration &config)=0
 Starts local audio mixing. More...
 
virtual int updateLocalAudioMixerConfiguration (const LocalAudioMixerConfiguration &config)=0
 Updates the configurations for mixing audio streams locally. More...
 
virtual int stopLocalAudioMixer ()=0
 Stops the local audio mixing. More...
 
virtual int startCameraCapture (VIDEO_SOURCE_TYPE sourceType, const CameraCapturerConfiguration &config)=0
 Starts camera capture. More...
 
virtual int stopCameraCapture (VIDEO_SOURCE_TYPE sourceType)=0
 Stops camera capture. More...
 
virtual int setCameraDeviceOrientation (VIDEO_SOURCE_TYPE type, VIDEO_ORIENTATION orientation)=0
 Sets the rotation angle of the captured video. More...
 
virtual int setScreenCaptureOrientation (VIDEO_SOURCE_TYPE type, VIDEO_ORIENTATION orientation)=0
 
virtual int startScreenCapture (VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration &config)=0
 Starts screen capture from the specified video source. More...
 
virtual int stopScreenCapture (VIDEO_SOURCE_TYPE sourceType)=0
 Stops screen capture from the specified video source. More...
 
virtual CONNECTION_STATE_TYPE getConnectionState ()=0
 Gets the current connection state of the SDK. More...
 
virtual bool registerEventHandler (IRtcEngineEventHandler *eventHandler)=0
 
virtual bool unregisterEventHandler (IRtcEngineEventHandler *eventHandler)=0
 
virtual int setRemoteUserPriority (uid_t uid, PRIORITY_TYPE userPriority)=0
 
virtual int registerPacketObserver (IPacketObserver *observer)=0
 Registers a packet observer. More...
 
virtual int enableEncryption (bool enabled, const EncryptionConfig &config)=0
 Enables or disables the built-in encryption. More...
 
virtual int createDataStream (int *streamId, bool reliable, bool ordered)=0
 Creates a data stream. More...
 
virtual int createDataStream (int *streamId, const DataStreamConfig &config)=0
 Creates a data stream. More...
 
virtual int sendStreamMessage (int streamId, const char *data, size_t length)=0
 Sends data stream messages. More...
 
virtual int sendRdtMessage (uid_t uid, RdtStreamType type, const char *data, size_t length)=0
 Send Reliable message to remote uid in channel. More...
 
virtual int sendMediaControlMessage (uid_t uid, const char *data, size_t length)=0
 Send media control message. More...
 
virtual int addVideoWatermark (const RtcImage &watermark) __deprecated=0
 Adds a watermark image to the local video. More...
 
virtual int addVideoWatermark (const char *watermarkUrl, const WatermarkOptions &options)=0
 Adds a watermark image to the local video. More...
 
virtual int addVideoWatermark (const WatermarkConfig &configs)=0
 Adds a watermark image to the local video. More...
 
virtual int removeVideoWatermark (const char *id)=0
 Removes the watermark image from the local video. More...
 
virtual int clearVideoWatermarks ()=0
 Removes the watermark image from the video stream. More...
 
virtual int pauseAudio () __deprecated=0
 
virtual int resumeAudio () __deprecated=0
 
virtual int enableWebSdkInteroperability (bool enabled) __deprecated=0
 Enables interoperability with the Agora Web SDK (applicable only in the live streaming. More...
 
virtual int sendCustomReportMessage (const char *id, const char *category, const char *event, const char *label, int value)=0
 Reports customized messages. More...
 
virtual int registerMediaMetadataObserver (IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type)=0
 Registers the metadata observer. More...
 
virtual int unregisterMediaMetadataObserver (IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type)=0
 Unregisters the specified metadata observer. More...
 
virtual int startAudioFrameDump (const char *channel_id, uid_t uid, const char *location, const char *uuid, const char *passwd, long duration_ms, bool auto_upload)=0
 
virtual int stopAudioFrameDump (const char *channel_id, uid_t uid, const char *location)=0
 
virtual int setAINSMode (bool enabled, AUDIO_AINS_MODE mode)=0
 Sets whether to enable the AI ​​noise suppression function and set the noise suppression mode. More...
 
virtual int registerLocalUserAccount (const char *appId, const char *userAccount)=0
 Registers a user account. More...
 
virtual int joinChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount)=0
 Joins a channel with a User Account and Token. More...
 
virtual int joinChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount, const ChannelMediaOptions &options)=0
 Join a channel using a user account and token, and set the media options. More...
 
virtual int joinChannelWithUserAccountEx (const char *token, const char *channelId, const char *userAccount, const ChannelMediaOptions &options, IRtcEngineEventHandler *eventHandler)=0
 Join a channel using a user account and token, and set the media options. More...
 
virtual int getUserInfoByUserAccount (const char *userAccount, rtc::UserInfo *userInfo)=0
 Gets the user information by passing in the user account. More...
 
virtual int getUserInfoByUid (uid_t uid, rtc::UserInfo *userInfo)=0
 Gets the user information by passing in the user ID. More...
 
virtual int startOrUpdateChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0
 Starts relaying media streams across channels or updates channels for media relay. More...
 
virtual int stopChannelMediaRelay ()=0
 Stops the media stream relay. Once the relay stops, the host quits all the target channels. More...
 
virtual int pauseAllChannelMediaRelay ()=0
 Pauses the media stream relay to all target channels. More...
 
virtual int resumeAllChannelMediaRelay ()=0
 Resumes the media stream relay to all target channels. More...
 
virtual int setDirectCdnStreamingAudioConfiguration (AUDIO_PROFILE_TYPE profile)=0
 Sets the audio profile of the audio streams directly pushed to the CDN by the host. More...
 
virtual int setDirectCdnStreamingVideoConfiguration (const VideoEncoderConfiguration &config)=0
 Sets the video profile of the media streams directly pushed to the CDN by the host. More...
 
virtual int startDirectCdnStreaming (IDirectCdnStreamingEventHandler *eventHandler, const char *publishUrl, const DirectCdnStreamingMediaOptions &options)=0
 Starts pushing media streams to the CDN directly. More...
 
virtual int stopDirectCdnStreaming ()=0
 Stops pushing media streams to the CDN directly. More...
 
virtual int updateDirectCdnStreamingMediaOptions (const DirectCdnStreamingMediaOptions &options)=0
 
virtual int startRhythmPlayer (const char *sound1, const char *sound2, const AgoraRhythmPlayerConfig &config)=0
 Enables the virtual metronome. More...
 
virtual int stopRhythmPlayer ()=0
 Disables the virtual metronome. More...
 
virtual int configRhythmPlayer (const AgoraRhythmPlayerConfig &config)=0
 Configures the virtual metronome. More...
 
virtual int takeSnapshot (uid_t uid, const char *filePath)=0
 Takes a snapshot of a video stream. More...
 
virtual int takeSnapshot (uid_t uid, const media::SnapshotConfig &config)=0
 Takes a screenshot of the video at the specified observation point. More...
 
virtual int enableContentInspect (bool enabled, const media::ContentInspectConfig &config)=0
 Enables or disables video screenshot and upload. More...
 
virtual int adjustCustomAudioPublishVolume (track_id_t trackId, int volume)=0
 Adjusts the volume of the custom audio track played remotely. More...
 
virtual int adjustCustomAudioPlayoutVolume (track_id_t trackId, int volume)=0
 Adjusts the volume of the custom audio track played locally. More...
 
virtual int setCloudProxy (CLOUD_PROXY_TYPE proxyType)=0
 Sets up cloud proxy service. More...
 
virtual int setLocalAccessPoint (const LocalAccessPointConfiguration &config)=0
 Configures the connection to Agora's Private Media Server access module. More...
 
virtual int setAdvancedAudioOptions (AdvancedAudioOptions &options, int sourceType=0)=0
 Sets audio advanced options. More...
 
virtual int setAVSyncSource (const char *channelId, uid_t uid)=0
 Sets audio-video synchronization for the sender. More...
 
virtual int enableVideoImageSource (bool enable, const ImageTrackOptions &options)=0
 Sets whether to replace the current video feeds with images when publishing video streams. More...
 
virtual int64_t getCurrentMonotonicTimeInMs ()=0
 Gets the current Monotonic Time of the SDK. More...
 
virtual int getNetworkType ()=0
 Gets the type of the local network connection. More...
 
virtual int setParameters (const char *parameters)=0
 Provides technical preview functionalities or special customizations by configuring the SDK with JSON options. More...
 
virtual int startMediaRenderingTracing ()=0
 Enables tracing the video frame rendering process. More...
 
virtual int enableInstantMediaRendering ()=0
 Enables audio and video frame instant rendering. More...
 
virtual uint64_t getNtpWallTimeInMs ()=0
 Gets the current NTP (Network Time Protocol) time. More...
 
virtual bool isFeatureAvailableOnDevice (FeatureType type)=0
 Checks whether the device supports the specified advanced feature. More...
 
virtual int sendAudioMetadata (const char *metadata, size_t length)=0
 send audio metadata More...
 
virtual int queryHDRCapability (VIDEO_MODULE_TYPE videoModule, HDR_CAPABILITY &capability)=0
 Queries the HDR capability of the video module. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from agora::rtc::IRtcEngine
static AGORA_CPP_API void release (RtcEngineReleaseCallback callback=nullptr)
 Releases the IRtcEngine instance. More...
 

Member Function Documentation

◆ joinChannelEx()

virtual int agora::rtc::IRtcEngineEx::joinChannelEx ( const char *  token,
const RtcConnection connection,
const ChannelMediaOptions options,
IRtcEngineEventHandler eventHandler 
)
pure virtual

Joins a channel.

You can call this method multiple times to join more than one channel. If you want to join the same channel from different devices, ensure that the user IDs are different for all devices. Applicable scenarios: This method can be called in scenarios involving multiple channels. Call timing: Call this method after initialize. In a multi-camera capture scenario, you need to call the startPreview(VIDEO_SOURCE_TYPE sourceType) method after calling this method to set the sourceType to VIDEO_SOURCE_CAMERA_SECONDARY, to ensure that the second camera captures normally. Related callbacks: A successful call of this method triggers the following callbacks:

  • The local client: The onJoinChannelSuccess and onConnectionStateChanged callbacks.
  • The remote client: The onUserJoined callback, if a user joining the channel in the COMMUNICATION profile, or a host joining a channel in the LIVE_BROADCASTING profile. When the connection between the local client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the onRejoinChannelSuccess callback on the local client.
Note
If you are already in a channel, you cannot rejoin the channel with the same user ID. Before joining a channel, ensure that the App ID you use to generate a token is the same as that you pass in the initialize method; otherwise, you may fail to join the channel with the token.
Parameters
tokenThe token generated on your server for authentication. See .Note:
  • (Recommended) If your project has enabled the security mode (using APP ID and Token for authentication), this parameter is required.
  • If you have only enabled the testing mode (using APP ID for authentication), this parameter is optional. You will automatically exit the channel 24 hours after successfully joining in.
  • If you need to join different channels at the same time or switch between channels, Agora recommends using a wildcard token so that you don't need to apply for a new token every time joining a channel. See Secure authentication with tokens.
connectionThe connection information. See RtcConnection.
optionsThe channel media options. See ChannelMediaOptions.
eventHandlerThe callback class of IRtcEngineEx. See IRtcEngineEventHandler. You can get the callback events of multiple channels through the eventHandler object passed in this parameter.
Returns
  • 0: Success.
  • < 0: Failure.
    • -2: The parameter is invalid. For example, the token is invalid, the uid parameter is not set to an integer, or the value of a member in ChannelMediaOptions is invalid. You need to pass in a valid parameter and join the channel again.
    • -3: Fails to initialize the IRtcEngine object. You need to reinitialize the IRtcEngine object.
    • -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
    • -8: The internal state of the IRtcEngine object is wrong. The typical cause is that after calling startEchoTest to start a call loop test, you call this method to join the channel without calling stopEchoTest to stop the test. You need to call stopEchoTest before calling this method.
    • -17: The request to join the channel is rejected. The typical cause is that the user is already in the channel. Agora recommends that you use the onConnectionStateChanged callback to see whether the user is in the channel. Do not call this method to join the channel unless you receive the CONNECTION_STATE_DISCONNECTED (1) state.
    • -102: The channel name is invalid. You need to pass in a valid channel name in channelId to rejoin the channel.
    • -121: The user ID is invalid. You need to pass in a valid user ID in uid to rejoin the channel.

◆ leaveChannelEx() [1/2]

virtual int agora::rtc::IRtcEngineEx::leaveChannelEx ( const RtcConnection connection)
pure virtual

Leaves a channel.

After calling this method, the SDK terminates the audio and video interaction, leaves the current channel, and releases all resources related to the session. After calling joinChannelEx to join a channel, you must call this method or leaveChannelEx(const RtcConnection& connection, const LeaveChannelOptions& options) to end the call, otherwise, the next call cannot be started. Applicable scenarios: This method can be called in scenarios involving multiple channels. Call timing: Call this method after joinChannelEx. Related callbacks: A successful call of this method triggers the following callbacks:

  • The local client: The onLeaveChannel callback will be triggered.
  • The remote client: The onUserOffline callback will be triggered after the remote host leaves the channel.
Note
If you call release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback.
  • This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel.
  • If you call leaveChannel() or leaveChannel(const LeaveChannelOptions& options), you will leave all the channels you have joined by calling joinChannel(const char* token, const char* channelId, const char* info, uid_t uid), joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options), or joinChannelEx.
Parameters
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ leaveChannelEx() [2/2]

virtual int agora::rtc::IRtcEngineEx::leaveChannelEx ( const RtcConnection connection,
const LeaveChannelOptions options 
)
pure virtual

Sets channel options and leaves the channel.

After calling this method, the SDK terminates the audio and video interaction, leaves the current channel, and releases all resources related to the session. After calling joinChannelEx to join a channel, you must call this method or leaveChannelEx(const RtcConnection& connection) to end the call, otherwise, the next call cannot be started. Applicable scenarios: This method can be called in scenarios involving multiple channels. Call timing: Call this method after joinChannelEx. Related callbacks: A successful call of this method triggers the following callbacks:

  • The local client: The onLeaveChannel callback will be triggered.
  • The remote client: The onUserOffline callback will be triggered after the remote host leaves the channel.
Note
If you call release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback.
  • This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel.
  • If you call leaveChannel() or leaveChannel(const LeaveChannelOptions& options), you will leave all the channels you have joined by calling joinChannel(const char* token, const char* channelId, const char* info, uid_t uid), joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options), or joinChannelEx.
Parameters
connectionThe connection information. See RtcConnection.
optionsSince v4.1.0 The options for leaving the channel. See LeaveChannelOptions. Note: This parameter only supports the stopMicrophoneRecording member in the LeaveChannelOptions settings; setting other members does not take effect.
Returns
  • 0: Success.
  • < 0: Failure.

◆ leaveChannelWithUserAccountEx() [1/2]

virtual int agora::rtc::IRtcEngineEx::leaveChannelWithUserAccountEx ( const char *  channelId,
const char *  userAccount 
)
pure virtual

Leaves a channel with the channel ID and user account.

This method allows a user to leave the channel, for example, by hanging up or exiting a call.

This method is an asynchronous call, which means that the result of this method returns even before the user has not actually left the channel. Once the user successfully leaves the channel, the SDK triggers the onLeaveChannel callback.

Parameters
channelIdThe channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
userAccountThe user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
Returns
  • 0: Success.
  • < 0: Failure.

◆ leaveChannelWithUserAccountEx() [2/2]

virtual int agora::rtc::IRtcEngineEx::leaveChannelWithUserAccountEx ( const char *  channelId,
const char *  userAccount,
const LeaveChannelOptions options 
)
pure virtual

Leaves a channel with the channel ID and user account and sets the options for leaving.

Parameters
channelIdThe channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
userAccountThe user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are:
  • All lowercase English letters: a to z.
  • All uppercase English letters: A to Z.
  • All numeric characters: 0 to 9.
  • The space character.
  • Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",".
optionsThe options for leaving the channel. See #LeaveChannelOptions.
Returns
int
  • 0: Success.
  • < 0: Failure.

◆ updateChannelMediaOptionsEx()

virtual int agora::rtc::IRtcEngineEx::updateChannelMediaOptionsEx ( const ChannelMediaOptions options,
const RtcConnection connection 
)
pure virtual

Updates the channel media options after joining the channel.

Parameters
optionsThe channel media options. See ChannelMediaOptions.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.
    • -2: The value of a member in ChannelMediaOptions is invalid. For example, the token or the user ID is invalid. You need to fill in a valid parameter.
    • -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
    • -8: The internal state of the IRtcEngine object is wrong. The possible reason is that the user is not in the channel. Agora recommends that you use the onConnectionStateChanged callback to see whether the user is in the channel. If you receive the CONNECTION_STATE_DISCONNECTED (1) or CONNECTION_STATE_FAILED (5) state, the user is not in the channel. You need to call joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) to join a channel before calling this method.

◆ setVideoEncoderConfigurationEx()

virtual int agora::rtc::IRtcEngineEx::setVideoEncoderConfigurationEx ( const VideoEncoderConfiguration config,
const RtcConnection connection 
)
pure virtual

Sets the video encoder configuration.

Sets the encoder configuration for the local video. Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate. Call timing: Call this method after joinChannelEx.

Note
The config specified in this method is the maximum value under ideal network conditions. If the video engine cannot render the video using the specified config due to unreliable network conditions, the parameters further down the list are considered until a successful configuration is found.
Parameters
configVideo profile. See VideoEncoderConfiguration.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setupRemoteVideoEx()

virtual int agora::rtc::IRtcEngineEx::setupRemoteVideoEx ( const VideoCanvas canvas,
const RtcConnection connection 
)
pure virtual

Initializes the video view of a remote user.

This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees. Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view. The application specifies the uid of the remote video in the VideoCanvas method before the remote user joins the channel. If the remote uid is unknown to the application, set it after the application receives the onUserJoined callback. If the Video Recording function is enabled, the Video Recording Service joins the channel as a dummy client, causing other clients to also receive the onUserJoined callback. Do not bind the dummy client to the application view because the dummy client does not send any video streams. To unbind the remote user from the view, set the view parameter to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user.

Note
  • Call this method after joinChannelEx.
  • To update the rendering or mirror mode of the remote video view during a call, use the setRemoteRenderModeEx method.
Parameters
canvasThe remote video view settings. See VideoCanvas.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ muteRemoteAudioStreamEx()

virtual int agora::rtc::IRtcEngineEx::muteRemoteAudioStreamEx ( uid_t  uid,
bool  mute,
const RtcConnection connection 
)
pure virtual

Stops or resumes receiving the audio stream of a specified user.

This method is used to stops or resumes receiving the audio stream of a specified user. You can call this method before or after joining a channel. If a user leaves a channel, the settings in this method become invalid.

Parameters
uidThe ID of the specified user.
muteWhether to stop receiving the audio stream of the specified user:
  • true: Stop receiving the audio stream of the specified user.
  • false: (Default) Resume receiving the audio stream of the specified user.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ muteRemoteVideoStreamEx()

virtual int agora::rtc::IRtcEngineEx::muteRemoteVideoStreamEx ( uid_t  uid,
bool  mute,
const RtcConnection connection 
)
pure virtual

Stops or resumes receiving the video stream of a specified user.

This method is used to stop or resume receiving the video stream of a specified user. You can call this method before or after joining a channel. If a user leaves a channel, the settings in this method become invalid.

Parameters
uidThe user ID of the remote user.
muteWhether to stop receiving the video stream of the specified user:
  • true: Stop receiving the video stream of the specified user.
  • false: (Default) Resume receiving the video stream of the specified user.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setRemoteVideoStreamTypeEx()

virtual int agora::rtc::IRtcEngineEx::setRemoteVideoStreamTypeEx ( uid_t  uid,
VIDEO_STREAM_TYPE  streamType,
const RtcConnection connection 
)
pure virtual

Sets the video stream type to subscribe to.

Depending on the default behavior of the sender and the specific settings when calling setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig), the scenarios for the receiver calling this method are as follows:

  • The SDK enables low-quality video stream adaptive mode ( AUTO_SIMULCAST_STREAM ) on the sender side by default, meaning only the high-quality video stream is transmitted. Only the receiver with the role of the **host**can call this method to initiate a low-quality video stream request. Once the sender receives the request, it starts automatically sending the low-quality video stream. At this point, all users in the channel can call this method to switch to low-quality video stream subscription mode.
  • If the sender calls setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig) and sets mode to DISABLE_SIMULCAST_STREAM (never send low-quality video stream), then calling this method will have no effect.
  • If the sender calls setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig) and sets mode to ENABLE_SIMULCAST_STREAM (always send low-quality video stream), both the host and audience receivers can call this method to switch to low-quality video stream subscription mode. The SDK will dynamically adjust the size of the corresponding video stream based on the size of the video window to save bandwidth and computing resources. The default aspect ratio of the low-quality video stream is the same as that of the high-quality video stream. According to the current aspect ratio of the high-quality video stream, the system will automatically allocate the resolution, frame rate, and bitrate of the low-quality video stream.
Note
If the publisher has already called setDualStreamModeEx and set mode to DISABLE_SIMULCAST_STREAM (never send low-quality video stream), calling this method will not take effect, you should call setDualStreamModeEx again on the sending end and adjust the settings.
Parameters
uidThe user ID.
streamTypeThe video stream type, see VIDEO_STREAM_TYPE.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ muteLocalAudioStreamEx()

virtual int agora::rtc::IRtcEngineEx::muteLocalAudioStreamEx ( bool  mute,
const RtcConnection connection 
)
pure virtual

Stops or resumes publishing the local audio stream.

A successful call of this method triggers the onUserMuteAudio and onRemoteAudioStateChanged callbacks on the remote client.

Note
This method does not affect any ongoing audio recording, because it does not disable the audio capture device.
Parameters
muteWhether to stop publishing the local audio stream:
  • true: Stops publishing the local audio stream.
  • false: (Default) Resumes publishing the local audio stream.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ muteLocalVideoStreamEx()

virtual int agora::rtc::IRtcEngineEx::muteLocalVideoStreamEx ( bool  mute,
const RtcConnection connection 
)
pure virtual

Stops or resumes publishing the local video stream.

A successful call of this method triggers the onUserMuteVideo callback on the remote client.

Note
This method does not affect any ongoing video recording, because it does not disable the camera.
Parameters
muteWhether to stop publishing the local video stream.
  • true: Stop publishing the local video stream.
  • false: (Default) Publish the local video stream.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ muteAllRemoteAudioStreamsEx()

virtual int agora::rtc::IRtcEngineEx::muteAllRemoteAudioStreamsEx ( bool  mute,
const RtcConnection connection 
)
pure virtual

Stops or resumes subscribing to the audio streams of all remote users.

After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including the ones join the channel subsequent to this call.

Note
  • Call this method after joining a channel.
  • If you do not want to subscribe the audio streams of remote users before joining a channel, you can set autoSubscribeAudio as false when calling joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options).
Parameters
muteWhether to stop subscribing to the audio streams of all remote users:
  • true: Stops subscribing to the audio streams of all remote users.
  • false: (Default) Subscribes to the audio streams of all remote users by default.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ muteAllRemoteVideoStreamsEx()

virtual int agora::rtc::IRtcEngineEx::muteAllRemoteVideoStreamsEx ( bool  mute,
const RtcConnection connection 
)
pure virtual

Stops or resumes subscribing to the video streams of all remote users.

After successfully calling this method, the local user stops or resumes subscribing to the video streams of all remote users, including all subsequent users.

Parameters
muteWhether to stop subscribing to the video streams of all remote users.
  • true: Stop subscribing to the video streams of all remote users.
  • false: (Default) Subscribe to the video streams of all remote users by default.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setSubscribeAudioBlocklistEx()

virtual int agora::rtc::IRtcEngineEx::setSubscribeAudioBlocklistEx ( uid_t *  uidList,
int  uidNumber,
const RtcConnection connection 
)
pure virtual

Sets the blocklist of subscriptions for audio streams.

You can call this method to specify the audio streams of a user that you do not want to subscribe to.

Note
  • You can call this method either before or after joining a channel.
  • The blocklist is not affected by the setting in muteRemoteAudioStream, muteAllRemoteAudioStreams, and autoSubscribeAudio in ChannelMediaOptions.
  • Once the blocklist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
  • If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
Parameters
uidListThe user ID list of users that you do not want to subscribe to. If you want to specify the audio streams of a user that you do not want to subscribe to, add the user ID in this list. If you want to remove a user from the blocklist, you need to call the setSubscribeAudioBlocklist method to update the user ID list; this means you only add the uid of users that you do not want to subscribe to in the new user ID list.
uidNumberThe number of users in the user ID list.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setSubscribeAudioAllowlistEx()

virtual int agora::rtc::IRtcEngineEx::setSubscribeAudioAllowlistEx ( uid_t *  uidList,
int  uidNumber,
const RtcConnection connection 
)
pure virtual

Sets the allowlist of subscriptions for audio streams.

You can call this method to specify the audio streams of a user that you want to subscribe to.

Note
  • You can call this method either before or after joining a channel.
  • The allowlist is not affected by the setting in muteRemoteAudioStream, muteAllRemoteAudioStreams and autoSubscribeAudio in ChannelMediaOptions.
  • Once the allowlist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
  • If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
Parameters
uidListThe user ID list of users that you want to subscribe to. If you want to specify the audio streams of a user for subscription, add the user ID in this list. If you want to remove a user from the allowlist, you need to call the setSubscribeAudioAllowlist method to update the user ID list; this means you only add the uid of users that you want to subscribe to in the new user ID list.
uidNumberThe number of users in the user ID list.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setSubscribeVideoBlocklistEx()

virtual int agora::rtc::IRtcEngineEx::setSubscribeVideoBlocklistEx ( uid_t *  uidList,
int  uidNumber,
const RtcConnection connection 
)
pure virtual

Sets the blocklist of subscriptions for video streams.

You can call this method to specify the video streams of a user that you do not want to subscribe to.

Note
  • You can call this method either before or after joining a channel.
  • The blocklist is not affected by the setting in muteRemoteVideoStream, muteAllRemoteVideoStreams and autoSubscribeAudio in ChannelMediaOptions.
  • Once the blocklist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
  • If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
Parameters
uidListThe user ID list of users that you do not want to subscribe to. If you want to specify the video streams of a user that you do not want to subscribe to, add the user ID of that user in this list. If you want to remove a user from the blocklist, you need to call the setSubscribeVideoBlocklist method to update the user ID list; this means you only add the uid of users that you do not want to subscribe to in the new user ID list.
uidNumberThe number of users in the user ID list.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setSubscribeVideoAllowlistEx()

virtual int agora::rtc::IRtcEngineEx::setSubscribeVideoAllowlistEx ( uid_t *  uidList,
int  uidNumber,
const RtcConnection connection 
)
pure virtual

Sets the allowlist of subscriptions for video streams.

You can call this method to specify the video streams of a user that you want to subscribe to.

Note
  • You can call this method either before or after joining a channel.
  • The allowlist is not affected by the setting in muteRemoteVideoStream, muteAllRemoteVideoStreams and autoSubscribeAudio in ChannelMediaOptions.
  • Once the allowlist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
  • If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
Parameters
uidListThe user ID list of users that you want to subscribe to. If you want to specify the video streams of a user for subscription, add the user ID of that user in this list. If you want to remove a user from the allowlist, you need to call the setSubscribeVideoAllowlist method to update the user ID list; this means you only add the uid of users that you want to subscribe to in the new user ID list.
uidNumberThe number of users in the user ID list.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setRemoteVideoSubscriptionOptionsEx()

virtual int agora::rtc::IRtcEngineEx::setRemoteVideoSubscriptionOptionsEx ( uid_t  uid,
const VideoSubscriptionOptions options,
const RtcConnection connection 
)
pure virtual

Sets options for subscribing to remote video streams.

When a remote user has enabled dual-stream mode, you can call this method to choose the option for subscribing to the video streams sent by the remote user.

Parameters
uidThe user ID of the remote user.
optionsThe video subscription options. See VideoSubscriptionOptions.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setRemoteVoicePositionEx()

virtual int agora::rtc::IRtcEngineEx::setRemoteVoicePositionEx ( uid_t  uid,
double  pan,
double  gain,
const RtcConnection connection 
)
pure virtual

Sets the 2D position (the position on the horizontal plane) of the remote user's voice.

This method sets the voice position and volume of a remote user. When the local user calls this method to set the voice position of a remote user, the voice difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a sense of space. This method applies to massive multiplayer online games, such as Battle Royale games.

Note
  • For the best voice positioning, Agora recommends using a wired headset.
  • Call this method after joining a channel.
Parameters
uidThe user ID of the remote user.
panThe voice position of the remote user. The value ranges from -1.0 to 1.0:
  • -1.0: The remote voice comes from the left.
  • 0.0: (Default) The remote voice comes from the front.
  • 1.0: The remote voice comes from the right.
gainThe volume of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original volume of the remote user). The smaller the value, the lower the volume.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setRemoteUserSpatialAudioParamsEx()

virtual int agora::rtc::IRtcEngineEx::setRemoteUserSpatialAudioParamsEx ( uid_t  uid,
const agora::SpatialAudioParams params,
const RtcConnection connection 
)
pure virtual

Sets remote user parameters for spatial audio

Parameters
uidThe ID of the remote user.
paramSpatial audio parameters. See SpatialAudioParams.
connectionThe RtcConnection object.
Returns
int
  • 0: Success.
  • < 0: Failure.

◆ setRemoteRenderModeEx()

virtual int agora::rtc::IRtcEngineEx::setRemoteRenderModeEx ( uid_t  uid,
media::base::RENDER_MODE_TYPE  renderMode,
VIDEO_MIRROR_MODE_TYPE  mirrorMode,
const RtcConnection connection 
)
pure virtual

Sets the video display mode of a specified remote user.

After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. This method affects only the video view that the local user sees.

Note
  • Call this method after initializing the remote view by calling the setupRemoteVideo method.
  • During a call, you can call this method as many times as necessary to update the display mode of the video view of a remote user.
Parameters
uidThe user ID of the remote user.
renderModeThe video display mode of the remote user. See RENDER_MODE_TYPE.
mirrorModeThe mirror mode of the remote user view. See VIDEO_MIRROR_MODE_TYPE.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ enableLoopbackRecordingEx()

virtual int agora::rtc::IRtcEngineEx::enableLoopbackRecordingEx ( const RtcConnection connection,
bool  enabled,
const char *  deviceName = NULL 
)
pure virtual

Enables loopback audio capturing.

If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.

Note
  • This method applies to the macOS and Windows only.
  • macOS does not support loopback audio capture of the default sound card. If you need to use this function, use a virtual sound card and pass its name to the deviceName parameter. Agora recommends using AgoraALD as the virtual sound card for audio capturing.
  • This method only supports using one sound card for audio capturing.
Parameters
connectionThe connection information. See RtcConnection.
enabledSets whether to enable loopback audio capture:
  • true: Enable loopback audio capturing.
  • false: (Default) Disable loopback audio capturing.
deviceName- macOS: The device name of the virtual sound card. The default value is set to NULL, which means using AgoraALD for loopback audio capturing.
  • Windows: The device name of the sound card. The default is set to NULL, which means the SDK uses the sound card of your device for loopback audio capturing.
Returns
  • 0: Success.
  • < 0: Failure.

◆ adjustRecordingSignalVolumeEx()

virtual int agora::rtc::IRtcEngineEx::adjustRecordingSignalVolumeEx ( int  volume,
const RtcConnection connection 
)
pure virtual

Adjusts the recording volume.

Parameters
volumeThe recording volume, which ranges from 0 to 400:
  • 0 : Mute the recording volume.
  • 100: The original volume.
  • 400: (Maximum) Four times the original volume with signal clipping protection.
connectionThe RtcConnection object.
Returns
  • 0 : Success.
  • < 0: Failure.

◆ muteRecordingSignalEx()

virtual int agora::rtc::IRtcEngineEx::muteRecordingSignalEx ( bool  mute,
const RtcConnection connection 
)
pure virtual

Mute or resume recording signal volume.

Parameters
muteDetermines whether to mute or resume the recording signal volume.
  • true: Mute the recording signal volume.
  • false: (Default) Resume the recording signal volume.
connectionThe RtcConnection object.
Returns
  • 0 : Success.
  • < 0: Failure.

◆ adjustUserPlaybackSignalVolumeEx()

virtual int agora::rtc::IRtcEngineEx::adjustUserPlaybackSignalVolumeEx ( uid_t  uid,
int  volume,
const RtcConnection connection 
)
pure virtual

Adjusts the playback signal volume of a specified remote user.

You can call this method to adjust the playback volume of a specified remote user. To adjust the playback volume of different remote users, call the method as many times, once for each remote user. Call timing: Call this method after joinChannelEx.

Parameters
uidThe user ID of the remote user.
volumeThe volume of the user. The value range is [0,400].
  • 0: Mute.
  • 100: (Default) The original volume.
  • 400: Four times the original volume (amplifying the audio signals by four times).
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getConnectionStateEx()

virtual CONNECTION_STATE_TYPE agora::rtc::IRtcEngineEx::getConnectionStateEx ( const RtcConnection connection)
pure virtual

Gets the current connection state of the SDK.

Call timing: This method can be called either before or after joining the channel.

Parameters
connectionThe connection information. See RtcConnection.
Returns
The current connection state. See CONNECTION_STATE_TYPE.

◆ enableEncryptionEx()

virtual int agora::rtc::IRtcEngineEx::enableEncryptionEx ( const RtcConnection connection,
bool  enabled,
const EncryptionConfig config 
)
pure virtual

Enables or disables the built-in encryption.

After the user leaves the channel, the SDK automatically disables the built-in encryption. To enable the built-in encryption, call this method before the user joins the channel again. Applicable scenarios: Scenarios with higher security requirements. Call timing: Call this method before joining a channel.

Note
  • All users within the same channel must set the same encryption configurations when calling this method.
  • If you enable the built-in encryption, you cannot use the Media Push function.
Parameters
enabledWhether to enable built-in encryption:
  • true: Enable the built-in encryption.
  • false: (Default) Disable the built-in encryption.
configBuilt-in encryption configurations. See EncryptionConfig.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ createDataStreamEx() [1/2]

virtual int agora::rtc::IRtcEngineEx::createDataStreamEx ( int *  streamId,
bool  reliable,
bool  ordered,
const RtcConnection connection 
)
pure virtual

Creates a data stream.

You can call this method to create a data stream and improve the reliability and ordering of data transmission. Call timing: Call this method after joinChannelEx. Related callbacks: After setting reliable to true, if the recipient does not receive the data within five seconds, the SDK triggers the onStreamMessageError callback and returns an error code.

Note
Each user can create up to five data streams during the lifecycle of IRtcEngine. The data stream will be destroyed when leaving the channel, and the data stream needs to be recreated if needed.
Parameters
streamIdAn output parameter; the ID of the data stream created.
reliableSets whether the recipients are guaranteed to receive the data stream within five seconds:
  • true: The recipients receive the data from the sender within five seconds. If the recipient does not receive the data within five seconds, the SDK triggers the onStreamMessageError callback and returns an error code.
  • false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. Attention: Please ensure that reliable and ordered are either both set totrue or both set to false.
orderedSets whether the recipients receive the data stream in the sent order:
  • true: The recipients receive the data in the sent order.
  • false: The recipients do not receive the data in the sent order.
connectionThe connection information. See RtcConnection.
Returns
  • 0: The data stream is successfully created.
  • < 0: Failure.

◆ createDataStreamEx() [2/2]

virtual int agora::rtc::IRtcEngineEx::createDataStreamEx ( int *  streamId,
const DataStreamConfig config,
const RtcConnection connection 
)
pure virtual

Creates a data stream.

Compared to createDataStreamEx(int* streamId, bool reliable, bool ordered, const RtcConnection& connection), this method does not guarantee the reliability of data transmission. If a data packet is not received five seconds after it was sent, the SDK directly discards the data. Call timing: Call this method after joinChannelEx.

Note
Each user can create up to five data streams during the lifecycle of IRtcEngine. The data stream will be destroyed when leaving the channel, and the data stream needs to be recreated if needed. If you need a more comprehensive solution for low-latency, high-concurrency, and scalable real-time messaging and status synchronization, it is recommended to use Signaling.
Parameters
streamIdAn output parameter; the ID of the data stream created.
configThe configurations for the data stream. See DataStreamConfig.
connectionThe connection information. See RtcConnection.
Returns
  • 0: The data stream is successfully created.
  • < 0: Failure.

◆ sendStreamMessageEx()

virtual int agora::rtc::IRtcEngineEx::sendStreamMessageEx ( int  streamId,
const char *  data,
size_t  length,
const RtcConnection connection 
)
pure virtual

Sends data stream messages.

After calling createDataStreamEx(int* streamId, const DataStreamConfig& config, const RtcConnection& connection), you can call this method to send data stream messages to all users in the channel. The SDK has the following restrictions on this method:

  • Each client within the channel can have up to 5 data channels simultaneously, with a total shared packet bitrate limit of 30 KB/s for all data channels.
  • Each data channel can send up to 60 packets per second, with each packet being a maximum of 1 KB. A successful method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message. A failed method call triggers the onStreamMessageError callback on the remote client.
Note
  • If you need a more comprehensive solution for low-latency, high-concurrency, and scalable real-time messaging and status synchronization, it is recommended to use Signaling.
  • Call this method after joinChannelEx.
  • Ensure that you call createDataStreamEx(int* streamId, const DataStreamConfig& config, const RtcConnection& connection) to create a data channel before calling this method.
Parameters
streamIdThe data stream ID. You can get the data stream ID by calling createDataStreamEx(int* streamId, const DataStreamConfig& config, const RtcConnection& connection)
dataThe message to be sent.
lengthThe length of the data.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ sendRdtMessageEx()

virtual int agora::rtc::IRtcEngineEx::sendRdtMessageEx ( uid_t  uid,
RdtStreamType  type,
const char *  data,
size_t  length,
const RtcConnection connection 
)
pure virtual

Send Reliable message to remote uid in channel.

@technical preview

Parameters
uidRemote user id.
typeReliable Data Transmission tunnel message type. See RdtStreamType
dataThe pointer to the sent data.
lengthThe length of the sent data.
connectionThe RtcConnection object.
Returns
  • 0: Success.
  • < 0: Failure.

◆ sendMediaControlMessageEx()

virtual int agora::rtc::IRtcEngineEx::sendMediaControlMessageEx ( uid_t  uid,
const char *  data,
size_t  length,
const RtcConnection connection 
)
pure virtual

Send media control message.

@technical preview

Parameters
uidRemote user id. In particular, if the uid is set to 0, it means broadcasting the message to the entire channel.
dataThe pointer to the sent data.
lengthThe length of the sent data, max 1024.
connectionThe RtcConnection object.
Returns
  • 0: Success.
  • < 0: Failure.

◆ addVideoWatermarkEx() [1/2]

virtual int agora::rtc::IRtcEngineEx::addVideoWatermarkEx ( const char *  watermarkUrl,
const WatermarkOptions options,
const RtcConnection connection 
)
pure virtual

Adds a watermark image to the local video.

Deprecated:
v4.6.0. This method is deprecated. Use addVideoWatermarkEx(const WatermarkConfig& config, const RtcConnection& connection) instead.

This method adds a PNG watermark image to the local video in the live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the capturing device can see and capture it. The Agora SDK supports adding only one watermark image onto a live video stream. The newly added watermark image replaces the previous one. The watermark coordinates are dependent on the settings in the setVideoEncoderConfigurationEx method:

  • If the orientation mode of the encoding video ( ORIENTATION_MODE ) is fixed landscape mode or the adaptive landscape mode, the watermark uses the landscape orientation.
  • If the orientation mode of the encoding video ( ORIENTATION_MODE ) is fixed portrait mode or the adaptive portrait mode, the watermark uses the portrait orientation.
  • When setting the watermark position, the region must be less than the dimensions set in the setVideoEncoderConfigurationEx method; otherwise, the watermark image will be cropped.
Note
  • Ensure that you have called enableVideo before calling this method.
  • This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray.
  • If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings.
  • If you have enabled the local video preview by calling the startPreview(VIDEO_SOURCE_TYPE sourceType) method, you can use the visibleInPreview member to set whether or not the watermark is visible in the preview.
  • If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. You can implement the watermark function in your application layer.
Parameters
watermarkUrlThe local file path of the watermark image to be added. This method supports adding a watermark image from the local absolute or relative file path.
optionsThe options of the watermark image to be added. See WatermarkOptions.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ addVideoWatermarkEx() [2/2]

virtual int agora::rtc::IRtcEngineEx::addVideoWatermarkEx ( const WatermarkConfig config,
const RtcConnection connection 
)
pure virtual

Adds a watermark image to the local video.

Since
4.6.0

Applicable scenarios: This method applies to multi-channel scenarios.

Parameters
configWatermark configuration. See WatermarkConfig.
connectionRtcConnection object. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ removeVideoWatermarkEx()

virtual int agora::rtc::IRtcEngineEx::removeVideoWatermarkEx ( const char *  id,
const RtcConnection connection 
)
pure virtual

Removes the specified watermark image from the local or remote video stream.

Since
4.6.0

Applicable scenarios: This method applies to multi-channel scenarios.

Parameters
idWatermark ID.
connectionRtcConnection object. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ clearVideoWatermarkEx()

virtual int agora::rtc::IRtcEngineEx::clearVideoWatermarkEx ( const RtcConnection connection)
pure virtual

Removes the watermark image from the video stream.

Parameters
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ sendCustomReportMessageEx()

virtual int agora::rtc::IRtcEngineEx::sendCustomReportMessageEx ( const char *  id,
const char *  category,
const char *  event,
const char *  label,
int  value,
const RtcConnection connection 
)
pure virtual

Agora supports reporting and analyzing customized messages.

Agora supports reporting and analyzing customized messages. This function is in the beta stage with a free trial. The ability provided in its beta test version is reporting a maximum of 10 message pieces within 6 seconds, with each message piece not exceeding 256 bytes and each string not exceeding 100 bytes. To try out this function, contact support@agora.io and discuss the format of customized messages with us.

◆ enableAudioVolumeIndicationEx()

virtual int agora::rtc::IRtcEngineEx::enableAudioVolumeIndicationEx ( int  interval,
int  smooth,
bool  reportVad,
const RtcConnection connection 
)
pure virtual

Enables the reporting of users' volume indication.

This method enables the SDK to regularly report the volume information to the app of the local user who sends a stream and remote users (three users at most) whose instantaneous volumes are the highest. Call timing: Call this method after joinChannelEx. Related callbacks: The SDK triggers the onAudioVolumeIndication callback according to the interval you set if this method is successfully called and there are users publishing streams in the channel.

Parameters
intervalSets the time interval between two consecutive volume indications:
  • ≤ 0: Disables the volume indication.
  • > 0: Time interval (ms) between two consecutive volume indications. Ensure this parameter is set to a value greater than 10, otherwise you will not receive the onAudioVolumeIndication callback. Agora recommends that this value is set as greater than 100.
smoothThe smoothing factor that sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The recommended value is 3. The greater the value, the more sensitive the indicator.
reportVad- true: Enables the voice activity detection of the local user. Once it is enabled, the vad parameter of the onAudioVolumeIndication callback reports the voice activity status of the local user.
  • false: (Default) Disables the voice activity detection of the local user. Once it is disabled, the vad parameter of the onAudioVolumeIndication callback does not report the voice activity status of the local user, except for the scenario where the engine automatically detects the voice activity of the local user.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ startRtmpStreamWithoutTranscodingEx()

virtual int agora::rtc::IRtcEngineEx::startRtmpStreamWithoutTranscodingEx ( const char *  url,
const RtcConnection connection 
)
pure virtual

Starts pushing media streams to a CDN without transcoding.

Agora recommends that you use the server-side Media Push function. For details, see Use RESTful API. You can call this method to push an audio or video stream to the specified CDN address. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.

Note
  • Call this method after joining a channel.
  • Only hosts in the LIVE_BROADCASTING profile can call this method.
  • If you want to retry pushing streams after a failed push, make sure to call stopRtmpStream first, then call this method to retry pushing streams; otherwise, the SDK returns the same error code as the last failed push.
Parameters
urlThe address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.
    • -2: The URL or configuration of transcoding is invalid; check your URL and transcoding configurations.
    • -7: The SDK is not initialized before calling this method.
    • -19: The Media Push URL is already in use; use another URL instead.

◆ startRtmpStreamWithTranscodingEx()

virtual int agora::rtc::IRtcEngineEx::startRtmpStreamWithTranscodingEx ( const char *  url,
const LiveTranscoding transcoding,
const RtcConnection connection 
)
pure virtual

Starts Media Push and sets the transcoding configuration.

Agora recommends that you use the server-side Media Push function. For details, see Use RESTful API. You can call this method to push a live audio-and-video stream to the specified CDN address and set the transcoding configuration. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.

Note
  • Ensure that you enable the Media Push service before using this function.
  • Call this method after joining a channel.
  • Only hosts in the LIVE_BROADCASTING profile can call this method.
  • If you want to retry pushing streams after a failed push, make sure to call stopRtmpStreamEx first, then call this method to retry pushing streams; otherwise, the SDK returns the same error code as the last failed push.
Parameters
urlThe address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported.
transcodingThe transcoding configuration for Media Push. See LiveTranscoding.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.
    • -2: The URL or configuration of transcoding is invalid; check your URL and transcoding configurations.
    • -7: The SDK is not initialized before calling this method.
    • -19: The Media Push URL is already in use; use another URL instead.

◆ updateRtmpTranscodingEx()

virtual int agora::rtc::IRtcEngineEx::updateRtmpTranscodingEx ( const LiveTranscoding transcoding,
const RtcConnection connection 
)
pure virtual

Updates the transcoding configuration.

Agora recommends that you use the server-side Media Push function. For details, see Use RESTful API. After you start pushing media streams to CDN with transcoding, you can dynamically update the transcoding configuration according to the scenario. The SDK triggers the onTranscodingUpdated callback after the transcoding configuration is updated.

Parameters
transcodingThe transcoding configuration for Media Push. See LiveTranscoding.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ stopRtmpStreamEx()

virtual int agora::rtc::IRtcEngineEx::stopRtmpStreamEx ( const char *  url,
const RtcConnection connection 
)
pure virtual

Stops pushing media streams to a CDN.

Agora recommends that you use the server-side Media Push function. For details, see Use RESTful API. You can call this method to stop the live stream on the specified CDN address. This method can stop pushing media streams to only one CDN address at a time, so if you need to stop pushing streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.

Parameters
urlThe address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ startOrUpdateChannelMediaRelayEx()

virtual int agora::rtc::IRtcEngineEx::startOrUpdateChannelMediaRelayEx ( const ChannelMediaRelayConfiguration configuration,
const RtcConnection connection 
)
pure virtual

Starts relaying media streams across channels or updates channels for media relay.

Since
v4.2.0

The first successful call to this method starts relaying media streams from the source channel to the destination channels. To relay the media stream to other channels, or exit one of the current media relays, you can call this method again to update the destination channels. This feature supports relaying media streams to a maximum of six destination channels. After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback, and this callback returns the state of the media stream relay. Common states are as follows:

  • If the onChannelMediaRelayStateChanged callback returns RELAY_STATE_RUNNING (2) and RELAY_OK (0), it means that the SDK starts relaying media streams from the source channel to the destination channel.
  • If the onChannelMediaRelayStateChanged callback returns RELAY_STATE_FAILURE (3), an exception occurs during the media stream relay.
Note
  • Call this method after joining the channel.
  • This method takes effect only when you are a host in a live streaming channel.
  • The relaying media streams across channels function needs to be enabled by contacting technical support.
  • Agora does not support string user accounts in this API.
Parameters
configurationThe configuration of the media stream relay. See ChannelMediaRelayConfiguration.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.
    • -1: A general error occurs (no specified reason).
    • -2: The parameter is invalid.
    • -8: Internal state error. Probably because the user is not a broadcaster.

◆ stopChannelMediaRelayEx()

virtual int agora::rtc::IRtcEngineEx::stopChannelMediaRelayEx ( const RtcConnection connection)
pure virtual

Stops the media stream relay. Once the relay stops, the host quits all the target channels.

After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback. If the callback reports RELAY_STATE_IDLE (0) and RELAY_OK (0), the host successfully stops the relay.

Note
If the method call fails, the SDK triggers the onChannelMediaRelayStateChanged callback with the RELAY_ERROR_SERVER_NO_RESPONSE (2) or RELAY_ERROR_SERVER_CONNECTION_LOST (8) status code. You can call the leaveChannel(const LeaveChannelOptions& options) method to leave the channel, and the media stream relay automatically stops.
Parameters
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.
    • -5: The method call was rejected. There is no ongoing channel media relay.

◆ pauseAllChannelMediaRelayEx()

virtual int agora::rtc::IRtcEngineEx::pauseAllChannelMediaRelayEx ( const RtcConnection connection)
pure virtual

Pauses the media stream relay to all target channels.

After the cross-channel media stream relay starts, you can call this method to pause relaying media streams to all target channels; after the pause, if you want to resume the relay, call resumeAllChannelMediaRelay.

Note
Call this method after startOrUpdateChannelMediaRelayEx.
Parameters
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.
    • -5: The method call was rejected. There is no ongoing channel media relay.

◆ resumeAllChannelMediaRelayEx()

virtual int agora::rtc::IRtcEngineEx::resumeAllChannelMediaRelayEx ( const RtcConnection connection)
pure virtual

Resumes the media stream relay to all target channels.

After calling the pauseAllChannelMediaRelayEx method, you can call this method to resume relaying media streams to all destination channels.

Note
Call this method after pauseAllChannelMediaRelayEx.
Parameters
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.
    • -5: The method call was rejected. There is no paused channel media relay.

◆ getUserInfoByUserAccountEx()

virtual int agora::rtc::IRtcEngineEx::getUserInfoByUserAccountEx ( const char *  userAccount,
rtc::UserInfo userInfo,
const RtcConnection connection 
)
pure virtual

Gets the user information by passing in the user account. It is same as agora::rtc::IRtcEngine::getUserInfoByUserAccount.

Parameters
userAccountThe user account of the user. Ensure that you set this parameter.
[in,out]userInfoA userInfo object that identifies the user:
  • Input: A userInfo object.
  • Output: A userInfo object that contains the user account and user ID of the user.
connectionThe RtcConnection object.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getUserInfoByUidEx()

virtual int agora::rtc::IRtcEngineEx::getUserInfoByUidEx ( uid_t  uid,
rtc::UserInfo userInfo,
const RtcConnection connection 
)
pure virtual

Gets the user information by passing in the user ID. It is same as agora::rtc::IRtcEngine::getUserInfoByUid.

Parameters
uidThe user ID of the remote user. Ensure that you set this parameter.
[in,out]userInfoA userInfo object that identifies the user:
  • Input: A userInfo object.
  • Output: A userInfo object that contains the user account and user ID of the user.
connectionThe RtcConnection object.
Returns
  • 0: Success.
  • < 0: Failure.

◆ enableDualStreamModeEx()

virtual int agora::rtc::IRtcEngineEx::enableDualStreamModeEx ( bool  enabled,
const SimulcastStreamConfig streamConfig,
const RtcConnection connection 
)
pure virtual

Enables or disables dual-stream mode on the sender side.

Deprecated:
v4.2.0. This method is deprecated. Use setDualStreamModeEx instead

You can call this method to enable or disable the dual-stream mode on the publisher side. Dual streams are a pairing of a high-quality video stream and a low-quality video stream:

  • High-quality video stream: High bitrate, high resolution.
  • Low-quality video stream: Low bitrate, low resolution. After you enable dual-stream mode, you can call setRemoteVideoStreamType to choose to receive either the high-quality video stream or the low-quality video stream on the subscriber side.
Note
This method is applicable to all types of streams from the sender, including but not limited to video streams collected from cameras, screen sharing streams, and custom-collected video streams.
Parameters
enabledWhether to enable dual-stream mode:
  • true: Enable dual-stream mode.
  • false: (Default) Disable dual-stream mode.
streamConfigThe configuration of the low-quality video stream. See SimulcastStreamConfig.Note: When setting mode to DISABLE_SIMULCAST_STREAM, setting streamConfig will not take effect.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setDualStreamModeEx()

virtual int agora::rtc::IRtcEngineEx::setDualStreamModeEx ( SIMULCAST_STREAM_MODE  mode,
const SimulcastStreamConfig streamConfig,
const RtcConnection connection 
)
pure virtual

Sets the dual-stream mode on the sender side.

The SDK defaults to enabling low-quality video stream adaptive mode ( AUTO_SIMULCAST_STREAM ) on the sender side, which means the sender does not actively send low-quality video stream. The receiving end with the role of the host can initiate a low-quality video stream request by calling setRemoteVideoStreamTypeEx, and upon receiving the request, the sending end automatically starts sending low-quality stream.

  • If you want to modify this behavior, you can call this method and set mode to DISABLE_SIMULCAST_STREAM (never send low-quality video streams) or ENABLE_SIMULCAST_STREAM (always send low-quality video streams).
  • If you want to restore the default behavior after making changes, you can call this method again with mode set to AUTO_SIMULCAST_STREAM.
Note
The difference and connection between this method and enableDualStreamModeEx is as follows:
  • When calling this method and setting mode to DISABLE_SIMULCAST_STREAM, it has the same effect as enableDualStreamModeEx (false).
  • When calling this method and setting mode to ENABLE_SIMULCAST_STREAM, it has the same effect as enableDualStreamModeEx (true).
  • Both methods can be called before and after joining a channel. If both methods are used, the settings in the method called later takes precedence.
Parameters
modeThe mode in which the video stream is sent. See SIMULCAST_STREAM_MODE.
streamConfigThe configuration of the low-quality video stream. See SimulcastStreamConfig.Note: When setting mode to DISABLE_SIMULCAST_STREAM, setting streamConfig will not take effect.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setSimulcastConfigEx()

virtual int agora::rtc::IRtcEngineEx::setSimulcastConfigEx ( const SimulcastConfig simulcastConfig,
const RtcConnection connection 
)
pure virtual

Sets the simulcast video stream configuration.

Since
v4.6.0

This method can be called in scenarios involving multiple channels. You can call the setSimulcastConfig method to set video streams with different resolutions for the same video source. The subscribers can call to select which stream layer to receive. The broadcaster can publish up to four layers of video streams: one main stream (highest resolution) and three additional streams of different quality levels. setRemoteVideoStreamType Applicable scenarios: This method can be called in scenarios involving multiple channels.

Parameters
simulcastConfigThis configuration includes seven layers, from STREAM_LAYER_1 to STREAM_LOW, with a maximum of three layers enabled simultaneously. See SimulcastConfig.
connectionConnection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setHighPriorityUserListEx()

virtual int agora::rtc::IRtcEngineEx::setHighPriorityUserListEx ( uid_t *  uidList,
int  uidNum,
STREAM_FALLBACK_OPTIONS  option,
const RtcConnection connection 
)
pure virtual

Set the high priority user list and their fallback level in weak network condition.

Note
  • This method can be called before and after joining a channel.
  • If a subscriber is set to high priority, this stream only fallback to lower stream after all normal priority users fallback to their fallback level on weak network condition if needed.
Parameters
uidListThe high priority user list.
uidNumThe size of uidList.
optionThe fallback level of high priority users.
connectionAn output parameter which is used to control different connection instances.
Returns
int
  • 0 : Success.
  • <0 : Failure.

◆ takeSnapshotEx() [1/2]

virtual int agora::rtc::IRtcEngineEx::takeSnapshotEx ( const RtcConnection connection,
uid_t  uid,
const char *  filePath 
)
pure virtual

Takes a snapshot of a video stream using connection ID.

This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path. Call timing: Call this method after joinChannelEx. Related callbacks: After a successful call of this method, the SDK triggers the onSnapshotTaken callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.

Note
  • The method is asynchronous, and the SDK has not taken the snapshot when the method call returns.
  • When used for local video snapshots, this method takes a snapshot for the video streams specified in ChannelMediaOptions.
  • If the user's video has been preprocessed, for example, watermarked or beautified, the resulting snapshot includes the pre-processing effect.
Parameters
connectionThe connection information. See RtcConnection.
uidThe user ID. Set uid as 0 if you want to take a snapshot of the local user's video.
filePathThe local path (including filename extensions) of the snapshot. For example:
  • Windows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.jpg
  • iOS: /App Sandbox/Library/Caches/example.jpg
  • macOS: ~/Library/Logs/example.jpg
  • Android: /storage/emulated/0/Android/data/<package name>/files/example.jpg Attention: Ensure that the path you specify exists and is writable.
Returns
  • 0: Success.
  • < 0: Failure.

◆ takeSnapshotEx() [2/2]

virtual int agora::rtc::IRtcEngineEx::takeSnapshotEx ( const RtcConnection connection,
uid_t  uid,
const media::SnapshotConfig config 
)
pure virtual

Gets a video screenshot of the specified observation point using the connection ID.

This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path. Call timing: Call this method after joinChannelEx. Related callbacks: After a successful call of this method, the SDK triggers the onSnapshotTaken callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.

Note
  • The method is asynchronous, and the SDK has not taken the snapshot when the method call returns.
  • When used for local video snapshots, this method takes a snapshot for the video streams specified in ChannelMediaOptions.
  • If the user's video has been preprocessed, for example, watermarked or beautified, the resulting snapshot includes the pre-processing effect.
Parameters
connectionThe connection information. See RtcConnection.
uidThe user ID. Set uid as 0 if you want to take a snapshot of the local user's video.
configThe configuration of the snaptshot. See SnapshotConfig.
Returns
  • 0: Success.
  • < 0: Failure.

◆ enableContentInspectEx()

virtual int agora::rtc::IRtcEngineEx::enableContentInspectEx ( bool  enabled,
const media::ContentInspectConfig config,
const RtcConnection connection 
)
pure virtual

Enables or disables video screenshot and upload.

This method can take screenshots for multiple video streams and upload them. When video screenshot and upload function is enabled, the SDK takes screenshots and uploads videos sent by local users based on the type and frequency of the module you set in ContentInspectConfig. After video screenshot and upload, the Agora server sends the callback notification to your app server in HTTPS requests and sends all screenshots to the third-party cloud storage service. Call timing: This method can be called either before or after joining the channel.

Note
Before calling this method, ensure that you have contacted technical support to activate the video screenshot upload service.
Parameters
enabledWhether to enalbe video screenshot and upload:
  • true: Enables video screenshot and upload.
  • false: Disables video screenshot and upload.
configScreenshot and upload configuration. See ContentInspectConfig.
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ startMediaRenderingTracingEx()

virtual int agora::rtc::IRtcEngineEx::startMediaRenderingTracingEx ( const RtcConnection connection)
pure virtual

Enables tracing the video frame rendering process.

Since
v4.1.1

The SDK starts tracing the rendering status of the video frames in the channel from the moment this method is successfully called and reports information about the event through the onVideoRenderingTracingResult callback. Applicable scenarios: Agora recommends that you use this method in conjunction with the UI settings (such as buttons and sliders) in your app to improve the user experience. For example, call this method when the user clicks the Join Channel button, and then get the time spent during the video frame rendering process through the onVideoRenderingTracingResult callback, so as to optimize the indicators accordingly.

Note
  • If you have not called this method, the SDK tracks the rendering events of the video frames from the moment you call joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) to join the channel. You can call this method at an appropriate time according to the actual application scenario to set the starting position for tracking video rendering events.
  • After the local user leaves the current channel, the SDK automatically tracks the video rendering events from the moment you join a channel.
Parameters
connectionThe connection information. See RtcConnection.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setParametersEx()

virtual int agora::rtc::IRtcEngineEx::setParametersEx ( const RtcConnection connection,
const char *  parameters 
)
pure virtual

Provides the technical preview functionalities or special customizations by configuring the SDK with JSON options.

Since
v4.3.0
Parameters
connectionThe connection information. See RtcConnection.
parametersPointer to the set parameters in a JSON string.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getCallIdEx()

virtual int agora::rtc::IRtcEngineEx::getCallIdEx ( agora::util::AString callId,
const RtcConnection connection 
)
pure virtual

Gets the call ID with the connection ID.

When a user joins a channel on a client, a callId is generated to identify the call from the client. You can call this method to get callId, and pass it in when calling methods such as rate and complain. Call timing: Call this method after joining a channel.

Parameters
callIdOutput parameter, the current call ID.
connectionThe connection information. See RtcConnection.

◆ sendAudioMetadataEx()

virtual int agora::rtc::IRtcEngineEx::sendAudioMetadataEx ( const RtcConnection connection,
const char *  metadata,
size_t  length 
)
pure virtual

send audio metadata

Since
v4.3.1
Parameters
connectionThe RtcConnection object.
metadataThe pointer of metadata
lengthSize of metadata
Returns
  • 0: success
  • <0: failure @technical preview

◆ preloadEffectEx()

virtual int agora::rtc::IRtcEngineEx::preloadEffectEx ( const RtcConnection connection,
int  soundId,
const char *  filePath,
int  startPos = 0 
)
pure virtual

Preloads a specified sound effect to a channel.

Since
v4.6.0

Each time you call this method, you can only preload one sound effect file into memory. If you need to preload multiple sound files, please call this method multiple times. After preloading is complete, you can call playEffect to play the preloaded sound effects, or call playAllEffects to play all preloaded sound effects. Applicable scenarios: This method can be called in scenarios involving multiple channels.

Note
  • To ensure a smooth experience, the size of sound effect files should not exceed the limit.
  • Agora recommends that you call this method before joining a channel.
  • If preloadEffectEx is called before playEffectEx is executed, the file resource will not be closed after playEffectEx. The next time playEffectEx is executed, it will directly seek to play at the beginning.
  • If preloadEffectEx is not called before playEffectEx is executed, the resource will be destroyed after playEffectEx. The next time playEffectEx is executed, it will try to reopen the file and play it from the beginning.
Parameters
connectionOne RtcConnection object. See RtcConnection.
soundIdThe audio effect ID.
filePathThe absolute path of the local file or the URL of the online file. Supported audio formats include: mp3, mp4, m4a, aac, 3gp, mkv and wav.
startPosThe playback position (ms) of the audio effect file.
Returns
  • 0: Success.
  • < 0: Failure.

◆ playEffectEx()

virtual int agora::rtc::IRtcEngineEx::playEffectEx ( const RtcConnection connection,
int  soundId,
const char *  filePath,
int  loopCount,
double  pitch,
double  pan,
int  gain,
bool  publish = false,
int  startPos = 0 
)
pure virtual

Plays a specified sound effect in a channel.

Since
v4.6.0

You can call this method to play a specified sound effect to all users in the channel. Each call to this method can only play one sound effect. To play multiple sound effects simultaneously, please call this method multiple times. This method allows you to set whether to publish sound effects in a channel. In order to play multiple sound files simultaneously, simply call the method multiple times with different soundId and filePath parameters. Applicable scenarios: This method can be called in scenarios involving multiple channels.

Note
  • Agora recommends not playing more than three sound effects at the same time.
  • The sound effect ID and file path in this method must be consistent with those in the preloadEffectEx method.
  • If preloadEffectEx is called before playEffectEx is executed, the file resource will not be closed after playEffectEx. The next time playEffectEx is executed, it will directly seek to play at the beginning.
  • If preloadEffectEx is not called before playEffectEx is executed, the resource will be destroyed after playEffectEx. The next time playEffectEx is executed, it will try to reopen the file and play it from the beginning.
Parameters
connectionOne RtcConnection object. See RtcConnection.
soundIdThe audio effect ID.
filePathThe absolute path of the local file or the URL of the online file. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv and wav.
loopCountNumber of times the sound effect to be looped:
  • -1: Loop infinitely until calling stopEffect or stopAllEffects.
  • 0: Play once.
  • 1: Play twice.
pitchThe pitch of the audio effect. The range is from 0.5 to 2.0, with a default value of 1.0 (original pitch). The lower the value, the lower the pitch.
panThe spatial position of the audio effect. The range of values is from -1.0 to 1.0:
  • -1.0: The audio effect is heard on the left of the user.
  • 0.0: The audio effect is heard in front of the user.
  • 1.0: The audio effect is heard on the right of the user.
gainThe volume of the audio effect. The value range is from 0 to 100, with a default value of 100 (original volume). The smaller the value, the lower the volume.
publishWhether to publish the audio effect in the channel:
  • true: Publish the audio effect in the channel.
  • false: (Default) Do not publish the audio effect in the channel.
startPosThe playback position (ms) of the audio effect file.
Returns
  • 0: Success.
  • < 0: Failure.