继承自 agora::rtc::IRtcEngine .

Public 成员函数

virtual IChannelcreateChannel (const char *channelId)=0
 
- Public 成员函数 继承自 agora::rtc::IRtcEngine
virtual int initialize (const RtcEngineContext &context)=0
 
virtual int setChannelProfile (CHANNEL_PROFILE_TYPE profile)=0
 
virtual int setClientRole (CLIENT_ROLE_TYPE role)=0
 
virtual int joinChannel (const char *token, const char *channelId, const char *info, uid_t uid)=0
 
virtual int switchChannel (const char *token, const char *channelId)=0
 
virtual int leaveChannel ()=0
 
virtual int renewToken (const char *token)=0
 
virtual int queryInterface (INTERFACE_ID_TYPE iid, void **inter)=0
 
virtual int registerLocalUserAccount (const char *appId, const char *userAccount)=0
 
virtual int joinChannelWithUserAccount (const char *token, const char *channelId, const char *userAccount)=0
 
virtual int getUserInfoByUserAccount (const char *userAccount, UserInfo *userInfo)=0
 
virtual int getUserInfoByUid (uid_t uid, UserInfo *userInfo)=0
 
virtual int startEchoTest ()=0
 
virtual int startEchoTest (int intervalInSeconds)=0
 
virtual int stopEchoTest ()=0
 
virtual int enableVideo ()=0
 
virtual int disableVideo ()=0
 
virtual int setVideoProfile (VIDEO_PROFILE_TYPE profile, bool swapWidthAndHeight)=0
 
virtual int setVideoEncoderConfiguration (const VideoEncoderConfiguration &config)=0
 
virtual int setCameraCapturerConfiguration (const CameraCapturerConfiguration &config)=0
 
virtual int setupLocalVideo (const VideoCanvas &canvas)=0
 
virtual int setupRemoteVideo (const VideoCanvas &canvas)=0
 
virtual int startPreview ()=0
 
virtual int setRemoteUserPriority (uid_t uid, PRIORITY_TYPE userPriority)=0
 
virtual int stopPreview ()=0
 
virtual int enableAudio ()=0
 
virtual int enableLocalAudio (bool enabled)=0
 
virtual int disableAudio ()=0
 
virtual int setAudioProfile (AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario)=0
 
virtual int muteLocalAudioStream (bool mute)=0
 
virtual int muteAllRemoteAudioStreams (bool mute)=0
 
virtual int setDefaultMuteAllRemoteAudioStreams (bool mute)=0
 
virtual int adjustUserPlaybackSignalVolume (unsigned int uid, int volume)=0
 
virtual int muteRemoteAudioStream (uid_t userId, bool mute)=0
 
virtual int muteLocalVideoStream (bool mute)=0
 
virtual int enableLocalVideo (bool enabled)=0
 
virtual int muteAllRemoteVideoStreams (bool mute)=0
 
virtual int setDefaultMuteAllRemoteVideoStreams (bool mute)=0
 
virtual int muteRemoteVideoStream (uid_t userId, bool mute)=0
 
virtual int setRemoteVideoStreamType (uid_t userId, REMOTE_VIDEO_STREAM_TYPE streamType)=0
 
virtual int setRemoteDefaultVideoStreamType (REMOTE_VIDEO_STREAM_TYPE streamType)=0
 
virtual int enableAudioVolumeIndication (int interval, int smooth, bool report_vad)=0
 
virtual int startAudioRecording (const char *filePath, AUDIO_RECORDING_QUALITY_TYPE quality)=0
 
virtual int startAudioRecording (const char *filePath, int sampleRate, AUDIO_RECORDING_QUALITY_TYPE quality)=0
 
virtual int stopAudioRecording ()=0
 
virtual int startAudioMixing (const char *filePath, bool loopback, bool replace, int cycle)=0
 
virtual int stopAudioMixing ()=0
 
virtual int pauseAudioMixing ()=0
 
virtual int resumeAudioMixing ()=0
 
virtual int setHighQualityAudioParameters (bool fullband, bool stereo, bool fullBitrate)=0
 
virtual int adjustAudioMixingVolume (int volume)=0
 
virtual int adjustAudioMixingPlayoutVolume (int volume)=0
 
virtual int getAudioMixingPlayoutVolume ()=0
 
virtual int adjustAudioMixingPublishVolume (int volume)=0
 
virtual int getAudioMixingPublishVolume ()=0
 
virtual int getAudioMixingDuration ()=0
 
virtual int getAudioMixingCurrentPosition ()=0
 
virtual int setAudioMixingPosition (int pos)=0
 
virtual int setAudioMixingPitch (int pitch)=0
 
virtual int getEffectsVolume ()=0
 
virtual int setEffectsVolume (int volume)=0
 
virtual int setVolumeOfEffect (int soundId, int volume)=0
 
virtual int enableFaceDetection (bool enable)=0
 
virtual int playEffect (int soundId, const char *filePath, int loopCount, double pitch, double pan, int gain, bool publish=false)=0
 
virtual int stopEffect (int soundId)=0
 
virtual int stopAllEffects ()=0
 
virtual int preloadEffect (int soundId, const char *filePath)=0
 
virtual int unloadEffect (int soundId)=0
 
virtual int pauseEffect (int soundId)=0
 
virtual int pauseAllEffects ()=0
 
virtual int resumeEffect (int soundId)=0
 
virtual int resumeAllEffects ()=0
 
virtual int enableSoundPositionIndication (bool enabled)=0
 
virtual int setRemoteVoicePosition (uid_t uid, double pan, double gain)=0
 
virtual int setLocalVoicePitch (double pitch)=0
 
virtual int setLocalVoiceEqualization (AUDIO_EQUALIZATION_BAND_FREQUENCY bandFrequency, int bandGain)=0
 
virtual int setLocalVoiceReverb (AUDIO_REVERB_TYPE reverbKey, int value)=0
 
virtual int setLocalVoiceChanger (VOICE_CHANGER_PRESET voiceChanger)=0
 
virtual int setLocalVoiceReverbPreset (AUDIO_REVERB_PRESET reverbPreset)=0
 
virtual int setLogFile (const char *filePath)=0
 
virtual int setLogFilter (unsigned int filter)=0
 
virtual int setLogFileSize (unsigned int fileSizeInKBytes)=0
 
virtual int setLocalRenderMode (RENDER_MODE_TYPE renderMode)=0
 
virtual int setLocalRenderMode (RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0
 
virtual int setRemoteRenderMode (uid_t userId, RENDER_MODE_TYPE renderMode)=0
 
virtual int setRemoteRenderMode (uid_t userId, RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode)=0
 
virtual int setLocalVideoMirrorMode (VIDEO_MIRROR_MODE_TYPE mirrorMode)=0
 
virtual int enableDualStreamMode (bool enabled)=0
 
virtual int setExternalAudioSource (bool enabled, int sampleRate, int channels)=0
 
virtual int setExternalAudioSink (bool enabled, int sampleRate, int channels)=0
 
virtual int setRecordingAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0
 
virtual int setPlaybackAudioFrameParameters (int sampleRate, int channel, RAW_AUDIO_FRAME_OP_MODE_TYPE mode, int samplesPerCall)=0
 
virtual int setMixedAudioFrameParameters (int sampleRate, int samplesPerCall)=0
 
virtual int adjustRecordingSignalVolume (int volume)=0
 
virtual int adjustPlaybackSignalVolume (int volume)=0
 
virtual int enableWebSdkInteroperability (bool enabled)=0
 
virtual int setVideoQualityParameters (bool preferFrameRateOverImageQuality)=0
 
virtual int setLocalPublishFallbackOption (STREAM_FALLBACK_OPTIONS option)=0
 
virtual int setRemoteSubscribeFallbackOption (STREAM_FALLBACK_OPTIONS option)=0
 
virtual int switchCamera ()=0
 
virtual int setDefaultAudioRouteToSpeakerphone (bool defaultToSpeaker)=0
 
virtual int setEnableSpeakerphone (bool speakerOn)=0
 
virtual int enableInEarMonitoring (bool enabled)=0
 
virtual int setInEarMonitoringVolume (int volume)=0
 
virtual bool isSpeakerphoneEnabled ()=0
 
virtual int setAudioSessionOperationRestriction (AUDIO_SESSION_OPERATION_RESTRICTION restriction)=0
 
virtual int enableLoopbackRecording (bool enabled, const char *deviceName=NULL)=0
 
virtual int startScreenCaptureByDisplayId (unsigned int displayId, const Rectangle &regionRect, const ScreenCaptureParameters &captureParams)=0
 
virtual int startScreenCaptureByScreenRect (const Rectangle &screenRect, const Rectangle &regionRect, const ScreenCaptureParameters &captureParams)=0
 
virtual int startScreenCaptureByWindowId (view_t windowId, const Rectangle &regionRect, const ScreenCaptureParameters &captureParams)=0
 
virtual int setScreenCaptureContentHint (VideoContentHint contentHint)=0
 
virtual int updateScreenCaptureParameters (const ScreenCaptureParameters &captureParams)=0
 
virtual int updateScreenCaptureRegion (const Rectangle &regionRect)=0
 
virtual int stopScreenCapture ()=0
 
virtual int startScreenCapture (WindowIDType windowId, int captureFreq, const Rect *rect, int bitrate)=0
 
virtual int updateScreenCaptureRegion (const Rect *rect)=0
 
virtual bool setVideoSource (IVideoSource *source)=0
 
virtual int getCallId (agora::util::AString &callId)=0
 
virtual int rate (const char *callId, int rating, const char *description)=0
 
virtual int complain (const char *callId, const char *description)=0
 
virtual const char * getVersion (int *build)=0
 
virtual int enableLastmileTest ()=0
 
virtual int disableLastmileTest ()=0
 
virtual int startLastmileProbeTest (const LastmileProbeConfig &config)=0
 
virtual int stopLastmileProbeTest ()=0
 
virtual const char * getErrorDescription (int code)=0
 
virtual int setEncryptionSecret (const char *secret)=0
 
virtual int setEncryptionMode (const char *encryptionMode)=0
 
virtual int enableEncryption (bool enabled, const EncryptionConfig &config)=0
 
virtual int registerPacketObserver (IPacketObserver *observer)=0
 
virtual int createDataStream (int *streamId, bool reliable, bool ordered)=0
 
virtual int sendStreamMessage (int streamId, const char *data, size_t length)=0
 
virtual int addPublishStreamUrl (const char *url, bool transcodingEnabled)=0
 
virtual int removePublishStreamUrl (const char *url)=0
 
virtual int setLiveTranscoding (const LiveTranscoding &transcoding)=0
 
virtual int addVideoWatermark (const RtcImage &watermark)=0
 
virtual int addVideoWatermark (const char *watermarkUrl, const WatermarkOptions &options)=0
 
virtual int clearVideoWatermarks ()=0
 
virtual int setBeautyEffectOptions (bool enabled, BeautyOptions options)=0
 
virtual int addInjectStreamUrl (const char *url, const InjectStreamConfig &config)=0
 
virtual int startChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0
 
virtual int updateChannelMediaRelay (const ChannelMediaRelayConfiguration &configuration)=0
 
virtual int stopChannelMediaRelay ()=0
 
virtual int removeInjectStreamUrl (const char *url)=0
 
virtual bool registerEventHandler (IRtcEngineEventHandler *eventHandler)=0
 
virtual bool unregisterEventHandler (IRtcEngineEventHandler *eventHandler)=0
 
virtual int sendCustomReportMessage (const char *id, const char *category, const char *event, const char *label, int value)=0
 
virtual CONNECTION_STATE_TYPE getConnectionState ()=0
 
virtual int registerMediaMetadataObserver (IMetadataObserver *observer, IMetadataObserver::METADATA_TYPE type)=0
 
virtual int setParameters (const char *parameters)=0
 

额外继承的成员函数

- Public 类型 继承自 agora::rtc::IRtcEngine
typedef unsigned int WindowIDType
 
typedef HWND WindowIDType
 
- 静态 Public 成员函数 继承自 agora::rtc::IRtcEngine
static AGORA_CPP_API void release (bool sync=false)
 
- Protected 成员函数 继承自 agora::rtc::IRtcEngine
virtual ~IRtcEngine ()
 

详细描述

自从
v3.0.0

IRtcEngine2

成员函数说明

◆ createChannel()

virtual IChannel* agora::rtc::IRtcEngine2::createChannel ( const char *  channelId)
pure virtual

创建并获取一个 IChannel 对象。

你可以多次调用该方法,创建多个 IChannel 对象,再调用各 IChannel 对象中的 joinChannel 方法,实现同时加入多个频道。

加入多个频道后,你可以同时订阅各个频道的音、视频流;但是同一时间只能在一个频道发布一路音、视频流。

参数
channelId能标识频道的频道名,长度在 64 字节以内的字符。以下为支持的字符集范围(共 89 个字符):
  • 26 个小写英文字母 a~z;
  • 26 个大写英文字母 A~Z;
  • 10 个数字 0~9;
  • 空格;
  • "!"、"#"、"$"、"%"、"&"、"("、")"、"+"、"-"、":"、";"、"<"、"="、"."、">"、"?"、"@"、"["、"]"、"^"、"_"、" {"、"}"、"|"、"~"、","。
注解
  • 该参数没有默认值,请确保对参数设值。
  • 请勿将该参数设为空字符 "",否则 SDK 会返回 ERR_REFUSED(5)
返回
  • 方法调用成功,返回 IChannel 对象的指针
  • 方法调用失败,返回一个空指针 NULL
  • 如果将 channelId 设为空字符 "",SDK 会返回 ERR_REFUSED(5)