NERtc Windows SDK  V4.4.301
Public 成员函数 | 所有成员列表
nertc::IRtcEngineEx类 参考abstract

#include <nertc_engine_ex.h>

类 nertc::IRtcEngineEx 继承关系图:
nertc::IRtcEngine

Public 成员函数

virtual NERtcConnectionStateType getConnectionState ()=0
 
virtual int muteLocalAudioStream (bool mute)=0
 
virtual int setAudioProfile (NERtcAudioProfileType profile, NERtcAudioScenarioType scenario)=0
 
virtual int setAudioEffectPreset (NERtcVoiceChangerType type)=0
 
virtual int setVoiceBeautifierPreset (NERtcVoiceBeautifierType type)=0
 
virtual int setLocalVoicePitch (double pitch)=0
 
virtual int setLocalVoiceEqualization (NERtcVoiceEqualizationBand band_frequency, int band_gain)=0
 
virtual int subscribeRemoteAudioStream (uid_t uid, bool subscribe)=0
 
virtual int setVideoConfig (const NERtcVideoConfig &config)=0
 
virtual int enableDualStreamMode (bool enable)=0
 
virtual int setupLocalSubStreamVideoCanvas (NERtcVideoCanvas *canvas)=0
 
virtual int setLocalRenderMode (NERtcVideoScalingMode scaling_mode)=0
 
virtual int setLocalSubStreamRenderMode (NERtcVideoScalingMode scaling_mode)=0
 
virtual int setLocalVideoMirrorMode (NERtcVideoMirrorMode mirror_mode)=0
 
virtual int setRemoteRenderMode (uid_t uid, NERtcVideoScalingMode scaling_mode)=0
 
virtual int setupRemoteSubStreamVideoCanvas (uid_t uid, NERtcVideoCanvas *canvas)=0
 
virtual int subscribeRemoteVideoSubStream (uid_t uid, bool subscribe)=0
 
virtual int setRemoteSubSteamRenderMode (uid_t uid, NERtcVideoScalingMode scaling_mode)=0
 
virtual int startVideoPreview ()=0
 
virtual int stopVideoPreview ()=0
 
virtual int muteLocalVideoStream (bool mute)=0
 
virtual int setLocalMediaPriority (NERtcMediaPriorityType priority, bool is_preemptive)=0
 
virtual int setParameters (const char *parameters)=0
 
virtual int setRecordingAudioFrameParameters (NERtcAudioFrameRequestFormat *format)=0
 
virtual int setPlaybackAudioFrameParameters (NERtcAudioFrameRequestFormat *format)=0
 
virtual int setMixedAudioFrameParameters (int sample_rate)=0
 
virtual int setAudioFrameObserver (INERtcAudioFrameObserver *observer)=0
 
virtual int startAudioDump ()=0
 
virtual int stopAudioDump ()=0
 
virtual int startAudioMixing (NERtcCreateAudioMixingOption *option)=0
 
virtual int stopAudioMixing ()=0
 
virtual int pauseAudioMixing ()=0
 
virtual int resumeAudioMixing ()=0
 
virtual int setAudioMixingSendVolume (uint32_t volume)=0
 
virtual int getAudioMixingSendVolume (uint32_t *volume)=0
 
virtual int setAudioMixingPlaybackVolume (uint32_t volume)=0
 
virtual int getAudioMixingPlaybackVolume (uint32_t *volume)=0
 
virtual int getAudioMixingDuration (uint64_t *duration)=0
 
virtual int getAudioMixingCurrentPosition (uint64_t *position)=0
 
virtual int setAudioMixingPosition (uint64_t seek_position)=0
 
virtual int playEffect (uint32_t effect_id, NERtcCreateAudioEffectOption *option)=0
 
virtual int stopEffect (uint32_t effect_id)=0
 
virtual int stopAllEffects ()=0
 
virtual int pauseEffect (uint32_t effect_id)=0
 
virtual int resumeEffect (uint32_t effect_id)=0
 
virtual int pauseAllEffects ()=0
 
virtual int resumeAllEffects ()=0
 
virtual int setEffectSendVolume (uint32_t effect_id, uint32_t volume)=0
 
virtual int getEffectSendVolume (uint32_t effect_id, uint32_t *volume)=0
 
virtual int setEffectPlaybackVolume (uint32_t effect_id, uint32_t volume)=0
 
virtual int getEffectPlaybackVolume (uint32_t effect_id, uint32_t *volume)=0
 
virtual int enableLoopbackRecording (bool enabled, const char *device_name)=0
 
virtual int adjustLoopbackRecordingSignalVolume (int volume)=0
 
virtual int enableEarback (bool enabled, uint32_t volume)=0
 
virtual int setEarbackVolume (uint32_t volume)=0
 
virtual int setStatsObserver (IRtcMediaStatsObserver *observer)=0
 
virtual int enableAudioVolumeIndication (bool enable, uint64_t interval)=0
 
virtual int startScreenCaptureByScreenRect (const NERtcRectangle &screen_rect, const NERtcRectangle &region_rect, const NERtcScreenCaptureParameters &capture_params)=0
 
virtual int startScreenCaptureByDisplayId (unsigned int display_id, const NERtcRectangle &region_rect, const NERtcScreenCaptureParameters &capture_params)=0
 
virtual int startScreenCaptureByWindowId (source_id_t window_id, const NERtcRectangle &region_rect, const NERtcScreenCaptureParameters &capture_params)=0
 
virtual int updateScreenCaptureRegion (const NERtcRectangle &region_rect)=0
 
virtual int stopScreenCapture ()=0
 
virtual int pauseScreenCapture ()=0
 
virtual int resumeScreenCapture ()=0
 
virtual int setExcludeWindowList (source_id_t *window_list, int count)=0
 
virtual int setExternalVideoSource (bool enabled)=0
 
virtual int pushExternalVideoFrame (NERtcVideoFrame *frame)=0
 
virtual int setExternalAudioSource (bool enabled, int sample_rate, int channels)=0
 
virtual int pushExternalAudioFrame (NERtcAudioFrame *frame)=0
 
virtual int setExternalAudioRender (bool enabled, int sample_rate, int channels)=0
 
virtual int pullExternalAudioFrame (void *data, int len)=0
 
virtual const char * getVersion (int *build)=0
 
virtual const char * getErrorDescription (int error_code)=0
 
virtual void uploadSdkInfo ()=0
 
virtual int addLiveStreamTask (const NERtcLiveStreamTaskInfo &info)=0
 
virtual int updateLiveStreamTask (const NERtcLiveStreamTaskInfo &info)=0
 
virtual int removeLiveStreamTask (const char *task_id)=0
 
virtual int sendSEIMsg (const char *data, int length, NERtcVideoStreamType type)=0
 
virtual int sendSEIMsg (const char *data, int length)=0
 
virtual int setLocalCanvasWatermarkConfigs (NERtcVideoStreamType type, NERtcCanvasWatermarkConfig &config)=0
 
virtual int setRemoteCanvasWatermarkConfigs (uid_t uid, NERtcVideoStreamType type, NERtcCanvasWatermarkConfig &config)=0
 
virtual int takeLocalSnapshot (NERtcVideoStreamType stream_type, NERtcTakeSnapshotCallback *callback)=0
 
virtual int takeRemoteSnapshot (uid_t uid, NERtcVideoStreamType stream_type, NERtcTakeSnapshotCallback *callback)=0
 
virtual int startAudioRecording (const char *file_path, int sample_rate, NERtcAudioRecordingQuality quality)=0
 
virtual int stopAudioRecording ()=0
 
virtual int adjustUserPlaybackSignalVolume (uid_t uid, int volume)=0
 
virtual int startChannelMediaRelay (NERtcChannelMediaRelayConfiguration *config)=0
 
virtual int updateChannelMediaRelay (NERtcChannelMediaRelayConfiguration *config)=0
 
virtual int stopChannelMediaRelay ()=0
 
virtual int setLocalPublishFallbackOption (int option)=0
 
virtual int setRemoteSubscribeFallbackOption (int option)=0
 
virtual int enableSuperResolution (bool enable)=0
 
virtual int enableEncryption (bool enable, NERtcEncryptionConfig config)=0
 
virtual int setCloudProxy (int proxyType)=0
 
- Public 成员函数 继承自 nertc::IRtcEngine
virtual int initialize (const NERtcEngineContext &context)=0
 
virtual void release (bool sync=true)=0
 
virtual int setClientRole (NERtcClientRole role)=0
 
virtual int setChannelProfile (NERtcChannelProfileType profile)=0
 
virtual int joinChannel (const char *token, const char *channel_name, uid_t uid)=0
 
virtual int switchChannel (const char *token, const char *channel_name)=0
 
virtual int leaveChannel ()=0
 
virtual int queryInterface (NERtcInterfaceIdType iid, void **inter)=0
 
virtual int enableLocalAudio (bool enabled)=0
 
virtual int setupLocalVideoCanvas (NERtcVideoCanvas *canvas)=0
 
virtual int setupRemoteVideoCanvas (uid_t uid, NERtcVideoCanvas *canvas)=0
 
virtual int enableLocalVideo (bool enabled)=0
 
virtual int subscribeRemoteVideoStream (uid_t uid, NERtcRemoteVideoStreamType type, bool subscribe)=0
 

详细描述

RtcEngine class provides main interface-related methods for applications to call.

IRtcEngineEx is the expansion interface of the NERTC SDK. Creates an IRtcEngine object and calls the methods of this object, and you can activate the communication feature the NERTC SDK provides.

成员函数说明

◆ addLiveStreamTask()

virtual int nertc::IRtcEngineEx::addLiveStreamTask ( const NERtcLiveStreamTaskInfo info)
pure virtual

After the method is successfully called, the current user can receive the notification about the status of the live stream.

注解
  • The method is applicable to only live streaming.
  • You can call the method in a room. The method is valid in calls.
  • Only one address for the relayed stream is added in each call. You need to call the method for multiple times if you want to push many streams. An RTC room with the same channelid can create three different streaming tasks.
  • After the method is successfully called, the current user will receive related-status notifications of the live stream.
参数
[in]infoindicates information of live task. For more information, see NERtcLiveStreamTaskInfo.
返回
  • 0: Success.
  • Other values: Failure.

◆ adjustLoopbackRecordingSignalVolume()

virtual int nertc::IRtcEngineEx::adjustLoopbackRecordingSignalVolume ( int  volume)
pure virtual

Adjusts the volume of captured signals of sound cards.

自从
V4.4.0

After calling sound card capturing by calling enableLoopbackRecording, you can call the method to adjust the volume of captured signals of sound cards.

参数
[in]volumeThe captured signals volume through sound cards. Value range: 0 to 100. The default value of 100 represents the original volume.
返回
  • 0: Success.
  • Other values: Failure.

◆ adjustUserPlaybackSignalVolume()

virtual int nertc::IRtcEngineEx::adjustUserPlaybackSignalVolume ( uid_t  uid,
int  volume 
)
pure virtual

Adjusts the volume of local signal playback from a specified remote user.

After you join the room, you can call the method to adjust the volume of local audio playback from different remote users or repeatedly adjust the volume of audio playback from a specified remote user.

注解
  • You can call this method after joining a room.
  • The method is valid in the current call. If a remote user exits the room and rejoins the room again, the setting is still valid until the call ends.
  • The method adjusts the volume of the mixing audio published by a specified remote user. The volume of one remote user can be adjusted. If you want to adjust multiple remote users, you need to call the method for the required times.
参数
uidThe ID of a remote user.
volumePlayback volume: 0 to 100.
  • 0: Mute.
  • 100: The original volume.
返回
  • 0: Success.
  • Other values: Failure.

◆ enableAudioVolumeIndication()

virtual int nertc::IRtcEngineEx::enableAudioVolumeIndication ( bool  enable,
uint64_t  interval 
)
pure virtual

Enables volume indication for the speaker.

The method allows the SDK to report to the app the information about the volume of the user that pushes local streams and the remote user (up to three users) that has the highest instantaneous volume. The information about the current speaker and the volume is reported.

If this method is enabled, when a user joins a room and pushes streams, the SDK triggers onRemoteAudioVolumeIndication based on the preset time intervals.

参数
enablespecifies whether to prompt the speaker volume.
intervalThe time interval at which volume prompt is displayed. Unit: milliseconds. The value must be the multiples of 100 milliseconds.
返回
  • 0: Success.
  • Other values: Failure.

◆ enableDualStreamMode()

virtual int nertc::IRtcEngineEx::enableDualStreamMode ( bool  enable)
pure virtual

Specifies whether to enable or disable the dual stream mode.

The method sets the single-stream mode or dual-stream mode. If the dual-stream mode is enabled, the receiver can choose to receive the high-quality stream or low-quality stream video. The high-quality stream has a high resolution and high bitrate. The low-quality stream has a low resolution and low bitrate.

注解
  • The method applies to camera data only. Video streams from external input and screen sharing are not affected.
  • You can call this method before or after you join a room. After the method is set, it can take effect after restarting the camera.
参数
[in]enablespecifies whether to enable dual-stream mode.
  • true: Enables the dual-stream mode. This is the default value.
  • false: Disables the dual-stream mode.
返回
  • 0: Success.
  • Other values: Failure.

◆ enableEarback()

virtual int nertc::IRtcEngineEx::enableEarback ( bool  enabled,
uint32_t  volume 
)
pure virtual

Enables or disables in-ear monitoring.

注解
  • You can call the method when you are in a room.
  • After in-ear monitoring is enabled, you must wear a headset or earpieces to use the in-ear monitoring feature. We recommend that you listen for changes of playback devices through onAudioDeviceStateChanged and onAudioDefaultDeviceChanged. Only when the device changes to headset, you can enable in-ear monitoring.
参数
[in]enabledEnabled or disabled.
[in]volumeThe volume of ear-monitoring.
返回
  • 0: Success.
  • Other values: Failure.

◆ enableEncryption()

virtual int nertc::IRtcEngineEx::enableEncryption ( bool  enable,
NERtcEncryptionConfig  config 
)
pure virtual

Enables or disables media stream encryption.

自从
V4.4.0

In scenes where high safety is required such as financial sectors, you can set encryption modes of media streams with the method before joining the room.

注解
  • Please calls the method before you join the room. The encryption mode and private key cannot be changed after you join the room. The SDK will automatically disable encryption after users leave the room. If you need to enable encryption again, users need to call the method before joining the room.
  • In the same room, all users who enable media stream encryption must share the same encryption mode and private keys. If not, members who use different private keys will report kNERtcErrEncryptNotSuitable (30113).
  • For safety, we recommend that you use a new private key every time you enable media stream encryption.
参数
enablewhether to enable media stream encryption.
  • true: Enabled.
  • false: Disabled. This is the default value.
configspecifies encryption plan for media streams. For more information, see NERtcEncryptionConfig.
返回
  • 0: Success.
  • Other values: Failure.

◆ enableLoopbackRecording()

virtual int nertc::IRtcEngineEx::enableLoopbackRecording ( bool  enabled,
const char *  device_name 
)
pure virtual

Enables or disables local audio capture through the sound card.

自从
V4.4.0

After the feature is enabled, the audio played by the sound card is integrated into local video streams. In this way, you can publish the audio to the remote side.

注解
  • The method applies to only macOS and Windows.
  • The capture feature is not supported on the macOS by default. If you need to enable the feature, the app needs to enable a virtual sound card and name the sound card as device_name to pass in the SDK. We recommend that you can use Soundflower as virtual sound card to deliver better audio effect.
  • You can call this method before or after you join a room.
参数
[in]enabledSpecifies whether to enable the capture feature through the sound card.
  • true: Enables audio capture through the sound card.
  • false: Disables audio capture through the sound card (default).
[in]device_nameThe device name of the sound card. The name is set as NULL by default, which indicates capturing through the current sound card.
The parameter applies to macOS platform only.
If users use virtual sound cards such as “Soundflower”, you can set the sound card name of virtual card as parameter. In this way, the SDK finds the corresponding device of virtual sound cards and starts capturing.
返回
  • 0: Success.
  • Other values: Failure.

◆ enableSuperResolution()

virtual int nertc::IRtcEngineEx::enableSuperResolution ( bool  enable)
pure virtual

Enables or disables AI super resolution.

自从
V4.4.0
注解
  • Please contact our technical support to enable AI super resolution before you perform the feature.
  • AI super resolution is only valid when you enable the following types of video streams:
  • Video streams that are received from local 360P.
  • High stream video of bigstream that are captured by the camera. AI super resolution is currently unsupported to resume low streams or substreams of screen sharing.
参数
enablespecifies whether to enable AI super resolution. By default, the setting is disabled.
返回
  • 0: Success.
  • Other values: Failure.

◆ getAudioMixingCurrentPosition()

virtual int nertc::IRtcEngineEx::getAudioMixingCurrentPosition ( uint64_t *  position)
pure virtual

Gets the playback position of the music file.

The method gets the playback position of the music file. Unit: milliseconds. You can call the method when you are in a room.

参数
[out]positionThe playback position of the audio mixing file. Unit: milliseconds.
返回
  • 0: Success.
  • Other values: Failure.

◆ getAudioMixingDuration()

virtual int nertc::IRtcEngineEx::getAudioMixingDuration ( uint64_t *  duration)
pure virtual

Gets the duration of the audio mixing.

The method gets the duration of the audio mixing. Unit: milliseconds. You can call the method when you are in a room.

参数
[out]durationThe duration of the audio mixing. Unit: milliseconds.
返回
  • 0: Success.
  • Other values: Failure.

◆ getAudioMixingPlaybackVolume()

virtual int nertc::IRtcEngineEx::getAudioMixingPlaybackVolume ( uint32_t *  volume)
pure virtual

Gets the playback volume of the audio mixing.

The method gets the playback volume of the audio mixing in the audio mixing. You can call the method when you are in a room.

参数
[out]volumeThe volume of the audio mixing.
返回
  • 0: Success.
  • Other values: Failure.

◆ getAudioMixingSendVolume()

virtual int nertc::IRtcEngineEx::getAudioMixingSendVolume ( uint32_t *  volume)
pure virtual

Gets the volume for publishing of audio mixing.

The method gets the volume for publishing of the audio mixing in the audio mixing. You can call the method when you are in a room.

参数
[out]volumeThe volume for publishing of the audio mixing.
返回
  • 0: Success.
  • Other values: Failure.

◆ getConnectionState()

virtual NERtcConnectionStateType nertc::IRtcEngineEx::getConnectionState ( )
pure virtual

Gets the current connection status.

返回
Returns the current network status. NERtcConnectionStateType.

◆ getEffectPlaybackVolume()

virtual int nertc::IRtcEngineEx::getEffectPlaybackVolume ( uint32_t  effect_id,
uint32_t *  volume 
)
pure virtual

Gets the playback volume of the audio effects files.

You can call this method after joining a room.

参数
[in]effect_idThe ID of the specified audio effect. Each audio effect has a unique ID.
[out]volumeThe audio effect playback volume.
返回
  • 0: Success.
  • Other values: Failure.

◆ getEffectSendVolume()

virtual int nertc::IRtcEngineEx::getEffectSendVolume ( uint32_t  effect_id,
uint32_t *  volume 
)
pure virtual

Gets the audio effect volume for publishing.

The method gets the audio effect volume for publishing. You can call the method when you are in a room.

参数
[in]effect_idThe ID of the specified audio effect. Each audio effect has a unique ID.
[out]volumeThe audio effect volume for publishing.
返回
  • 0: Success.
  • Other values: Failure.

◆ getErrorDescription()

virtual const char* nertc::IRtcEngineEx::getErrorDescription ( int  error_code)
pure virtual

Check the error description of specified error codes.

注解
The method is currently invalid. Returns the value of empty only. Please check returned error codes and specific error descriptions in the onError .
参数
[in]error_codeNERtcErrorCode .
返回
Detailed descriptions of error codes.

◆ getVersion()

virtual const char* nertc::IRtcEngineEx::getVersion ( int *  build)
pure virtual

Query the SDK version number.

  • You can call this method before or after you join a room.
参数
[out]buildThe compilation number.
返回
The version of the current SDK, whose format is string such as 1.0.0.

◆ muteLocalAudioStream()

virtual int nertc::IRtcEngineEx::muteLocalAudioStream ( bool  mute)
pure virtual

Enables or disabling publishing the local audio stream. The method is used to enable or disable publishing the local audio stream.

注解
  • This method does not change the state of the audio-recording device because the audio-recording devices are not disabled.
  • The mute state is reset to unmuted after the call ends.
参数
[in]muteMute or Unmute.
  • true: Mutes the local audio stream.
  • false: Unmutes the local audio stream (Default).
返回
  • 0: Success.
  • Other values: Failure.

◆ muteLocalVideoStream()

virtual int nertc::IRtcEngineEx::muteLocalVideoStream ( bool  mute)
pure virtual

Enables or disables publishing the local video stream.

If the method is called Successfully, onUserVideoMute is triggered remotely.

注解
  • When you call the method to disable video streams, the SDK doesn’t send local video streams but the camera is still working.
  • The method can be called before or after a user joins a room.
  • If you stop publishing the local video stream by calling this method, the option is reset to the default state that allows the app to publish the local video stream.
  • enableLocalVideo (false) is different from enableLocalVideo (false). The enableLocalVideo(false) method turns off local camera devices. The muteLocalVideoStreamvideo method does not affect local video capture, or disable cameras, and responds faster.
参数
[in]mute
  • true: Not publishing local video streams.
  • false: Publishing local video streams (default).
返回
  • 0: Success.
  • Other values: Failure.

◆ pauseAllEffects()

virtual int nertc::IRtcEngineEx::pauseAllEffects ( )
pure virtual

Pauses all audio effect files.

You can call the method when you are in a room.

返回
  • 0: Success.
  • Other values: Failure.

◆ pauseAudioMixing()

virtual int nertc::IRtcEngineEx::pauseAudioMixing ( )
pure virtual

Stops playing music files or audio mixing.

The method pauses playing audio mixing. You can call the method when you are in a room.

返回
  • 0: Success.
  • Other values: Failure.

◆ pauseEffect()

virtual int nertc::IRtcEngineEx::pauseEffect ( uint32_t  effect_id)
pure virtual

Pauses playing all audio effects.

You can call the method when you are in a room.

参数
[in]effect_idThe ID of the specified audio effect. Each audio effect has a unique ID.
返回
  • 0: Success.
  • Other values: Failure.

◆ pauseScreenCapture()

virtual int nertc::IRtcEngineEx::pauseScreenCapture ( )
pure virtual

Pauses screen sharing.

返回
  • 0: Success.
  • Other values: Failure.

◆ playEffect()

virtual int nertc::IRtcEngineEx::playEffect ( uint32_t  effect_id,
NERtcCreateAudioEffectOption option 
)
pure virtual

Plays a specified audio effect file.

  • After the method is successfully called, if the playback ends, the onAudioEffectFinished callback is triggered.
  • Supported audio formats: MP3, M4A, AAC, 3GP, WMA, and WAV. Files that are stored in local or online URLs are supported.
注解
  • You can call this method after joining a room.
  • You can call the method for multiple times. You can play multiple audio effect files simultaneously by passing in different effect_ids and options. Various audio effects are mixed. To gain optimal user experience, we recommend you to play no more than three audio effect files at the same time.
参数
[in]effect_idThe ID of the specified audio effect. Each audio effect has a unique ID.
[in]optionThe options of creating audio effect files configurations including types, full path or URL of audio mixing files. For more information, see NERtcCreateAudioEffectOption.
返回
  • 0: Success.
  • Other values: Failure.

◆ pullExternalAudioFrame()

virtual int nertc::IRtcEngineEx::pullExternalAudioFrame ( void *  data,
int  len 
)
pure virtual

Pulls the external audio data.

The method pulls the audio data from the internal audio engine. After you enable the external audio data rendering functionality by calling setExternalAudioRender, you can use pullExternalAudioFrame to get the audio PCM data.

注解
  • This method can be called only if a user joins a room.
  • We recommend that you set the duration of data frames to match a cycle of 10 ms.
  • The method becomes invalid if the audio rendering device is turned off. In this case, no data is returned. For example, calls end, and the speakerphone is shut off before calls.
参数
[out]dataindicates data pointer. The SDK internally copies data into data.
[in]lenThe size of the audio data that are pulled. Unit: bytes.
  • We recommend that the duration of the audio data at least last 10 ms, and the data size cannot exceed 7,680 bytes.
  • Formula: len = sampleRate/1000 × 2 × channels × duration of the audio data in milliseconds.
返回
  • 0: Success.
  • Other values: Failure.

◆ pushExternalAudioFrame()

virtual int nertc::IRtcEngineEx::pushExternalAudioFrame ( NERtcAudioFrame frame)
pure virtual

Pushes the external audio data input.

Pushes the audio frame data captured from the external audio source to the internal audio engine. If you enable the external audio data source by calling setExternalAudioSource, you can use pushExternalAudioFrame to send audio PCM data.

注解
  • This method can be called only if a user joins a room.
  • We recommend that you set the duration of data frames to match a cycle of 10 ms.
  • External input data frame consists of the data duration and call duration.
  • The method becomes invalid if the audio input device is turned off. For example, disable local audio, end calls, and shut off the microphone test before calls.
参数
[in]frameThe data of frame cannot exceed 7680 bytes in length.
  • External input data frame consists of the data duration and call duration.
返回
  • 0: Success.
  • Other values: Failure.

◆ pushExternalVideoFrame()

virtual int nertc::IRtcEngineEx::pushExternalVideoFrame ( NERtcVideoFrame frame)
pure virtual

Pushes the external video frames.

The method actively pushes the data of video frames that are encapsulated with the NERtcVideoFrame class to the SDK. Make sure that you have already called setExternalVideoSource with a value of true before you call this method. Otherwise, an error message is repeatedly prompted if you call the method.

注解
The method enables the internal engine, which is invalid after you call leaveChannel.
参数
[in]frameThe video frame data.
返回
  • 0: Success.
  • Other values: Failure.

◆ removeLiveStreamTask()

virtual int nertc::IRtcEngineEx::removeLiveStreamTask ( const char *  task_id)
pure virtual

Deletes a push task.

注解
  • The method is applicable to only live streaming.
  • You can call the method in a room. The method is valid in calls.
  • When calls stop and all members in the room leave the room, the SDK automatically deletes the streaming task. If some users are still in the room, users who create the streaming task need to delete the streaming task.
参数
[in]task_idThe ID of a live streaming task.
返回
  • 0: Success.
  • Other values: Failure.

◆ resumeAllEffects()

virtual int nertc::IRtcEngineEx::resumeAllEffects ( )
pure virtual

Resumes playing all audio effects files.

You can call the method when you are in a room.

返回
  • 0: Success.
  • Other values: Failure.

◆ resumeAudioMixing()

virtual int nertc::IRtcEngineEx::resumeAudioMixing ( )
pure virtual

Resumes playing the audio mixing.

The method resumes audio mixing, and continues playing the audio mixing. You can call the method when you are in a room.

返回
  • 0: Success.
  • Other values: Failure.

◆ resumeEffect()

virtual int nertc::IRtcEngineEx::resumeEffect ( uint32_t  effect_id)
pure virtual

Resumes playing a specified audio effect.

You can call the method when you are in a room.

参数
[in]effect_idThe ID of the specified audio effect. Each audio effect has a unique ID.
返回
  • 0: Success.
  • Other values: Failure.

◆ resumeScreenCapture()

virtual int nertc::IRtcEngineEx::resumeScreenCapture ( )
pure virtual

Resumes screen sharing.

返回
  • 0: Success.
  • Other values: Failure.

◆ sendSEIMsg() [1/2]

virtual int nertc::IRtcEngineEx::sendSEIMsg ( const char *  data,
int  length 
)
pure virtual

Sends SEI messages.

While the local video stream is pushed, SEI data is also sent to sync some additional information. After SEI data is sent, the receiver can retrieve the content by listening on IRtcEngineEventHandlerEx::onRecvSEIMsg callback.

  • Condition: After the video stream (bigstream) is enabled, the function can be invoked.
  • Data size limits: The SEI data can contain a maximum of 4,096 bytes in size. Sending an SEI message fails if the data exceeds the size limit. If a large amount of data is sent, the video bitrate rises. This degrades the video quality or causes video frames freezes.
  • Frequency limit: we recommend that the maximum video frame rate does not exceed 10 fps.
  • Time to take effect: After the method is called, the SEI data is sent from the next frame in the fastest fashion or after the next 5 frames at the slowest pace.
注解
  • The SEI data is transmitted together with the video stream. Frame loss may occur in poor network connection. The SEI data will also get lost. We recommend that you send the data many times within the transmission frequency limits. In this way, the receiver can get the data.
  • By default, the SEI is transmitted by using the bigstream channel.
参数
dataThe custom SEI frame data.
lengthThe custom SEI data size whose maximum value does not exceed 4096 bytes.
注解
The API is disabled in the audio-only SDK. If you need to use the API, you can download the standard SDK from the official website of YunXin and replace the audio-only SDK.
返回
The value returned. A value of 0 That the operation is successful.
  • Success: Successfully joins the queue to be sent. The data are sent after the closest video frame.
  • Failure: Date are limitedly sent for the high sent frequency, the overloaded queue and the maximum data size exceeding 4k.

◆ sendSEIMsg() [2/2]

virtual int nertc::IRtcEngineEx::sendSEIMsg ( const char *  data,
int  length,
NERtcVideoStreamType  type 
)
pure virtual

Sends SEI messages.

While the local video stream is pushed, SEI data is also sent to sync some additional information. After SEI data is sent, the receiver can retrieve the content by listening on IRtcEngineEventHandlerEx::onRecvSEIMsg callback.

  • Condition: After the video stream (Bigstream) is enabled, the function can be invoked.
  • Data size limits: The SEI data can contain a maximum of 4,096 bytes in size. Sending an SEI message fails if the data exceeds the size limit. If a large amount of data is sent, the video bitrate rises. This degrades the video quality or causes broken video frames.
  • Frequency limit: we recommend that the maximum video frame rate does not exceed 10 fps.
  • Time to take effect: After the method is called, the SEI data is sent from the next frame in the fastest fashion or after the next 5 frames at the slowest pace.
注解
  • The SEI data is transmitted together with the video stream. Frame loss may occur in poor network connection. The SEI data will also get lost. We recommend that you send the data many times within the transmission frequency limits. In this way, the receiver can get the data.
  • By default, the SEI is transmitted by using the bigstream channel.
参数
dataThe custom SEI frame data.
lengthThe custom SEI data size whose maximum value does not exceed 4096 bytes.
typeThe type of the stream channel with which the SEI data is transmitted. For more information, see NERtcVideoStreamType.
返回
The value returned. A value of 0 That the operation is successful.
  • Success: Successfully joins the queue to be sent. The data are sent after the closest video frame.
  • failure: Date are limitedly sent for the high sent frequency and the overloaded queue. Or, the maximum data size exceeds 4k.

◆ setAudioEffectPreset()

virtual int nertc::IRtcEngineEx::setAudioEffectPreset ( NERtcVoiceChangerType  type)
pure virtual

Sets the voice changer effect for the SDK-preset voice.

The method can add multiple preset audio effects to original human voices and change audio profiles.

注解
  • You can call this method either before or after joining a room. By default, the audio effect is disabled after the call ends.
  • The method conflicts with setLocalVoicePitch. After you call this method, the voice pitch is reset to the default value 1.0.
参数
[in]typeThe preset voice changer effect. By default, the audio effect is disabled. For more information, see NERtcVoiceChangerType.
返回
  • 0: Success.
  • Other values: Failure.

◆ setAudioFrameObserver()

virtual int nertc::IRtcEngineEx::setAudioFrameObserver ( INERtcAudioFrameObserver observer)
pure virtual

Registers the audio observer object.

The method is used to set audio capture or play PCM data callbacks. You can use the method to process audios. You need to register callbacks with this method when engine needs to trigger callbacks of onAudioFrameDidRecord or onAudioFrameWillPlayback.

参数
observerThe object instance. If you pass in NULL, you cancel the registration and clear the settings of NERtcAudioFrameRequestFormat.
返回
  • 0: Success.
  • Other values: Failure.

◆ setAudioMixingPlaybackVolume()

virtual int nertc::IRtcEngineEx::setAudioMixingPlaybackVolume ( uint32_t  volume)
pure virtual

Adjusts the playback volume of the audio mixing.

The method adjusts the playback volume of the audio mixing in the audio mixing. You can call the method when you are in a room.

参数
[in]volumeThe volume range of the audio mixing is 0 to 100. The default value of 100 represents the original volume.
返回
  • 0: Success.
  • Other values: Failure.

◆ setAudioMixingPosition()

virtual int nertc::IRtcEngineEx::setAudioMixingPosition ( uint64_t  seek_position)
pure virtual

Sets the playback position of the music file to a different starting position.

The method sets the playback position of the music file to a different starting position. The method allows you to play the music file from the position based on your requirements rather than from the beginning of the music file.

参数
[in]seek_positionThe playback position of the music file. Unit: milliseconds.
返回
  • 0: Success.
  • Other values: Failure.

◆ setAudioMixingSendVolume()

virtual int nertc::IRtcEngineEx::setAudioMixingSendVolume ( uint32_t  volume)
pure virtual

Adjusts the audio mixing volume for publishing.

The method adjusts the volume for publishing of the audio mixing in the audio mixing. You can call the method when you are in a room.

参数
[in]volumeThe audio mixing volume for publishing. Valid values: 0 to 100. The default value of 100 represents the original volume.
返回
  • 0: Success.
  • Other values: Failure.

◆ setAudioProfile()

virtual int nertc::IRtcEngineEx::setAudioProfile ( NERtcAudioProfileType  profile,
NERtcAudioScenarioType  scenario 
)
pure virtual

Sets the audio encoding profile.

注解
  • Sets the method before calling the joinChannel. Otherwise, the setting is invalid after joinChannel.
  • In music scenarios, we recommend you to set the profile as kNERtcAudioProfileHighQuality.
参数
[in]profileSets the sample rate, bitrate, encoding mode, and the number of channels. NERtcAudioProfileType.
[in]scenarioSets the type of an audio application scenario. NERtcAudioScenarioType.
返回
  • 0: Success.
  • Other values: Failure.

◆ setCloudProxy()

virtual int nertc::IRtcEngineEx::setCloudProxy ( int  proxyType)
pure virtual

开启并设置云代理服务。
在内网环境下,如果用户防火墙开启了网络限制,请参考《使用云代理》将指定 IP 地址和端口号加入防火墙白名单,然后调用此方法开启云代理,并将 proxyType 参数设置为 kNERtcTransportTypeUDPProxy(1),即指定使用 UDP 协议的云代理。

  • 成功连接云代理后,SDK 会触发 onConnectionStateChange(kNERtcConnectionStateConnecting, kNERtcReasonConnectionChangedSettingProxyServer) 回调。
  • 如果需要关闭已设置的云代理,请调用 setCloudProxy(kNERtcTransportTypeNoneProxy)
    注解
    请在加入房间前调用此方法。
    参数
    proxyType云代理类型。详细信息请参考 NERtcTransportType 。该参数为必填参数,若未赋值,SDK 会报错。
    返回
    0
    方法调用成功,其他失败。

◆ setEarbackVolume()

virtual int nertc::IRtcEngineEx::setEarbackVolume ( uint32_t  volume)
pure virtual

Sets the volume for in-ear monitoring.

You can call the method when you are in a room.

参数
[in]volumeThe volume of ear-monitoring. Valid values: to 100. The default value is 100.
返回
  • 0: Success.
  • Other values: Failure.

◆ setEffectPlaybackVolume()

virtual int nertc::IRtcEngineEx::setEffectPlaybackVolume ( uint32_t  effect_id,
uint32_t  volume 
)
pure virtual

Sets the playback volume of an audio effect file.

You can call this method after joining a room.

参数
[in]effect_idThe ID of the specified audio effect. Each audio effect has a unique ID.
[in]volumeThe audio effect volume for publishing. Valid values: 0 to 100. The default value is 100.
返回
  • 0: Success.
  • Other values: Failure.

◆ setEffectSendVolume()

virtual int nertc::IRtcEngineEx::setEffectSendVolume ( uint32_t  effect_id,
uint32_t  volume 
)
pure virtual

Adjusts the audio effect volume for publishing.

The method adjusts the audio effect volume for publishing. You can call the method when you are in a room.

参数
[in]effect_idThe ID of the specified audio effect. Each audio effect has a unique ID.
[in]volumeThe audio effect volume. Value range: 0 to 100. The default value of 100 represents the original volume.
返回
  • 0: Success.
  • Other values: Failure.

◆ setExcludeWindowList()

virtual int nertc::IRtcEngineEx::setExcludeWindowList ( source_id_t window_list,
int  count 
)
pure virtual

Sets the window list that need to be blocked in capturing screens. The method can be dynamically called in the capturing.

参数
window_listThe ID of the screen to be blocked.
countThe number of windows that are needed to be blocked.
返回
  • 0: Success.
  • Other values: Failure.

◆ setExternalAudioRender()

virtual int nertc::IRtcEngineEx::setExternalAudioRender ( bool  enabled,
int  sample_rate,
int  channels 
)
pure virtual

Sets external audio rendering.

The method is suitable for scenarios that require personalized audio rendering. By default, the setting is disabled. If you choose an audio playback device or a sudden restart occurs, the setting becomes invalid. After you call the method, you can use pullExternalAudioFrame to get audio PCM data.

注解
  • You can call this method before joining a room.
  • The method enables the internal engine. The virtual component works instead of the physical speaker. The setting remains valid after you call the leaveChannel method. If you want to disable the functionality, you must disable the functionality before the next call starts.
  • After you enable the external audio rendering, some functionalities of the speakerphone supported by the SDK are replaced by the external audio source. Settings that are applied to the speakerphone become invalid or do not take effect in calls. For example, external rendering is required to play the external audio when you use loopback for testing.
参数
[in]enabledSpecifies whether to output external data.
  • true: Enables external data rendering.
  • false: Disables the external data rendering (default).
[in]sample_rateThe sample rate of data. You need to input following data in the same sample rate. Note: If you call the method to disable the functionality, you can pass in a random valid value. In this case, the setting does not take effect.
[in]channelsThe number of data channels. You need to return following data in the same number of channels. Note: If you call the method to disable the functionality, you can pass in a random valid value. In this case, the setting does not take effect. Valid values:
  • 1: Mono sound.
  • 2: Stereo sound.
返回
  • 0: Success.
  • Other values: Failure.

◆ setExternalAudioSource()

virtual int nertc::IRtcEngineEx::setExternalAudioSource ( bool  enabled,
int  sample_rate,
int  channels 
)
pure virtual

Enables or disables the external audio stream source.

After you call the method, the setting becomes invalid if you choose audio input device or a sudden restart occurs. After the method is called, you can call pushExternalAudioFrame to send the pulse-code modulation (PCM) data.

注解
  • You can call this method before joining a room.
  • The method enables the internal engine. After enabled, the virtual component works instead of the physical microphones. The setting remains unchanged after the leaveChannel method is called. If you want to disable the feature, you must disable the setting before next call starts.
  • After you enable the external audio data input, some functionalities of the speakerphone supported by the SDK are replaced by the external audio source. Settings that are applied to the microphones become invalid or do not take effect in calls. For example, you can hear the external data input when you use loopback for testing.
参数
[in]enabledSpecifies whether to input external data.
  • true: Enables external data input.
  • false: Disables the external data input(default).
[in]sample_rateThe sample rate of data. You need to input following data in the same sample rate. Note: If you call the method to disable the functionality, you can pass in a random valid value. In this case, the setting does not take effect.
[in]channelsThe number of channels. You need to input following data in the same number of channels. Note: If you call the method to disable the functionality, you can pass in a random valid value. In this case, the setting does not take effect. Valid values:
  • 1: Mono sound.
  • 2: Stereo sound.
返回
  • 0: Success.
  • Other values: Failure.

◆ setExternalVideoSource()

virtual int nertc::IRtcEngineEx::setExternalVideoSource ( bool  enabled)
pure virtual

Enables or disables the external video source.

When you enable the external video source through the method, you need to set kNERtcExternalVideoDeviceID as the ID of external video source with IVideoDeviceManager::setDevice kNERtcExternalVideoDeviceID method.

注解
The method enables the internal engine, which is still valid after you call leaveChannel.
参数
[in]enabledSpecifies whether input external video source data.
  • true: Enables external video source.
  • false: Disables the external video source (default).
返回
  • 0: Success.
  • Other values: Failure.

◆ setLocalCanvasWatermarkConfigs()

virtual int nertc::IRtcEngineEx::setLocalCanvasWatermarkConfigs ( NERtcVideoStreamType  type,
NERtcCanvasWatermarkConfig config 
)
pure virtual

Adds a watermark image to the local video.

注解
  • The setLocalCanvasWatermarkConfigs method applies to the local video canvas and does not affect the video stream. If the canvas is removed, the watermark will be automatically deleted.
  • Before you set a watermark, you must first set the canvas by calling related methods.
  • Watermark-related methods are currently unsupported on the macOS platform.
参数
typeThe type of video streams. You can set the value to bigstream or substream. For more information, see NERtcVideoStreamType.
configThe configuration of the watermark for the canvas. You can set text watermark, image watermark, and timestamp watermark. A value of null is set to remove the watermark. For more information, see NERtcCanvasWatermarkConfig.
返回
  • 0: Success.
  • Other values: Failure.

◆ setLocalMediaPriority()

virtual int nertc::IRtcEngineEx::setLocalMediaPriority ( NERtcMediaPriorityType  priority,
bool  is_preemptive 
)
pure virtual

Sets the priority of media streams from a local user.

If a user has a high priority, the media stream from the user also has a high priority. In unreliable network connections, the SDK guarantees the quality the media stream from users with a high priority.

注解
  • You must call the method before you call joinChannel.
  • After switching channels, media priority changes to the default value of normal priority.
  • An RTC room has only one user that has a high priority. We recommend that only one user in a room call the setLocalMediaPriority method to set the local media stream a high priority. Otherwise, you need to enable the preempt mode to ensure the high priority of the local media stream.
参数
priorityThe priority of the local media stream. The default value is kNERtcMediaPriorityNormal. For more information, see NERtcMediaPriorityType.
is_preemptivespecifies whether to enable the preempt mode. The default value is false, which indicates that the preempt mode is disabled.
  • If the preempt mode is enabled, the local media stream preempts the high priority over other users. The priority of the media stream whose priority is taken becomes normal. After the user whose priority is taken leaves the room, other users still keep the normal priority.
  • If the preempt mode is disabled, and a user in the room has a high priority. After that, the high priority of the local client remains invalid and is still normal.
返回
  • 0: Success.
  • Other values: Failure.

◆ setLocalPublishFallbackOption()

virtual int nertc::IRtcEngineEx::setLocalPublishFallbackOption ( int  option)
pure virtual

Sets the fallback option for the published local video stream based on the network conditions.

The quality of the published local audio and video streams is degraded with poor quality network connections. After calling this method and setting the option to kNERtcStreamFallbackAudioOnly:

  • With unreliable upstream network connections and the quality of audio and video streams is downgraded, the SDK automatically disables video stream or stops receiving video streams. In this way, the communication quality is guaranteed.
  • The SDK monitors the network performance and recover audio and video streams if the network quality improves.
  • If the locally published audio and video stream falls back to audio stream, or recovers to audio and video stream, the SDK triggers the onLocalPublishFallbackToAudioOnly callback.
    注解
    You must call the method before you call joinChannel.
    自从
    V4.3.0
    参数
    optionThe fallback option of publishing audio and video streams. The fallback kNERtcStreamFallbackAudioOnly is disabled by default. For more information, see RTCStreamFallbackOption.
    返回
    0
    A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ setLocalRenderMode()

virtual int nertc::IRtcEngineEx::setLocalRenderMode ( NERtcVideoScalingMode  scaling_mode)
pure virtual

Sets the local view display mode.

This method is used to set the display mode about the local view. The application can repeatedly call the method to change the display mode.

注解
You must set local secondary canvas before enabling screen shariing.
参数
[in]scaling_modeThe video display mode. NERtcVideoScalingMode.
返回
  • 0: Success.
  • Other values: Failure.

◆ setLocalSubStreamRenderMode()

virtual int nertc::IRtcEngineEx::setLocalSubStreamRenderMode ( NERtcVideoScalingMode  scaling_mode)
pure virtual

Sets the display mode for local substreams video of screen sharing.

This method is used to set the display mode about the local view. The application can repeatedly call the method to change the display mode.

注解
You must set the local canvas for local substreams through setupLocalSubStreamVideoCanvas.
参数
[in]scaling_modeThe video display mode. NERtcVideoScalingMode.
返回
  • 0: Success.
  • Other values: Failure.

◆ setLocalVideoMirrorMode()

virtual int nertc::IRtcEngineEx::setLocalVideoMirrorMode ( NERtcVideoMirrorMode  mirror_mode)
pure virtual

Sets the mirror mode of the local video.

The method is used to set whether to enable the mirror mode for the local video. The mirror code determines whether to flip the screen view right or left.

Mirror mode for local videos only affects what local users view. The views of remote users are not affected. App can repeatedly call this method to modify the mirror mode.

参数
[in]mirror_modeThe video mirror mode. For more information, see NERtcVideoMirrorMode.
返回
  • 0: Success.
  • Other values: Failure.

◆ setLocalVoiceEqualization()

virtual int nertc::IRtcEngineEx::setLocalVoiceEqualization ( NERtcVoiceEqualizationBand  band_frequency,
int  band_gain 
)
pure virtual

Sets the local voice equalization effect. You can customize the center frequencies of the local voice effects.

注解
You can call this method either before or after joining a room. By default, the audio effect is disabled after the call ends.
参数
[in]band_frequencySets the band frequency. Value range: 0 to 9. Those numbers represent the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 250, 500, 1k, 2k, 4k, 8k, and 16k Hz.
[in]band_gainSets the gain of each band (dB). Value range: -15 to 15. The default value is 0.
返回
  • 0: Success.
  • Other values: Failure.

◆ setLocalVoicePitch()

virtual int nertc::IRtcEngineEx::setLocalVoicePitch ( double  pitch)
pure virtual

Sets the voice pitch of a local voice.

The method changes the voice pitch of the local speaker.

注解
  • After the call ends, the setting changes back to the default value 1.0.
  • The method conflicts with setAudioEffectPreset. After you call this method, the preset voice beautifier effect will be removed.
参数
[in]pitchThe voice frequency. Valid values: 0.5 to 2.0. Smaller values have lower pitches. The default value is 1, which That the pitch is not changed.
返回
  • 0: Success.
  • Other values: Failure.

◆ setMixedAudioFrameParameters()

virtual int nertc::IRtcEngineEx::setMixedAudioFrameParameters ( int  sample_rate)
pure virtual

Sets the sample rate of audio mixing stream after the audio is recording and playback.

The method is used to set audio recording format of onMixedAudioFrame .

注解
  • The method can be called before or after a user joins a room.
  • Currently supports setting the sample rate only.
  • If you do not call the interface to set the data format, the sample rate in the callback return the default value set by the SDK.
参数
sample_rateThe sample rate of data returned in onMixedAudioFrame. Only 8000, 16000, 32000, 44100, and 48000 are supported.
返回
  • 0: Success.
  • Other values: Failure.

◆ setParameters()

virtual int nertc::IRtcEngineEx::setParameters ( const char *  parameters)
pure virtual

Sets parameters for audio and video calls. You can configure the SDK through JSON to provide features like technology review and special customization. Publicizes JSON options in a standardized way.

参数
[in]parametersRelated parameters for audio and video calls whose format is the JSON string.
返回
  • 0: Success.
  • Other values: Failure.

◆ setPlaybackAudioFrameParameters()

virtual int nertc::IRtcEngineEx::setPlaybackAudioFrameParameters ( NERtcAudioFrameRequestFormat format)
pure virtual

Sets the audio playback format.

The method is used to set audio recording format of onAudioFrameDidRecord callback.

注解
  • The method can be called or modified before or after a user joins a room.
  • Stops listening and sets the value as empty.
参数
formatThe sample rate and channels of data returned in the onAudioFrameWillPlayback. A value of NULL is allowed. The default value is NULL.
返回
  • 0: Success.
  • Other values: Failure.

◆ setRecordingAudioFrameParameters()

virtual int nertc::IRtcEngineEx::setRecordingAudioFrameParameters ( NERtcAudioFrameRequestFormat format)
pure virtual

Sets the audio recording format.

The method is used to set audio recording format of onAudioFrameDidRecord callback.

注解
  • The method can be called before or after a user joins a room.
  • Stops listening and sets the value as empty.
参数
formatThe sample rate and channels of data returned in the onAudioFrameDidRecord. A value of NULL is allowed. The default value is NULL.
返回
  • 0: Success.
  • Other values: Failure.

◆ setRemoteCanvasWatermarkConfigs()

virtual int nertc::IRtcEngineEx::setRemoteCanvasWatermarkConfigs ( uid_t  uid,
NERtcVideoStreamType  type,
NERtcCanvasWatermarkConfig config 
)
pure virtual

Adds a watermark to the remote video canvas.

注解
  • setRemoteCanvasWatermarkConfigs method applies to the local video canvas and does not affect the video stream. If the canvas is removed, the watermark will be automatically deleted.
  • Before you set a watermark, you must first set the canvas by calling related methods.
  • Watermark-related methods are currently unsupported on the macOS platform.
参数
uidThe ID of a remote user.
typeThe type of video streams. You can set the value to bigstream or substream. For more information, see NERtcVideoStreamType.
configThe configuration of the watermark for the canvas. You can set text watermark, image watermark, and timestamp watermark. A value of null is set to remove the watermark. For more information, see NERtcCanvasWatermarkConfig.
返回
  • 0: Success.
  • Other values: Failure.

◆ setRemoteRenderMode()

virtual int nertc::IRtcEngineEx::setRemoteRenderMode ( uid_t  uid,
NERtcVideoScalingMode  scaling_mode 
)
pure virtual

Sets display mode for remote views.

This method is used to set the display mode for the remote view. App can repeatedly call this method to modify the display mode.

参数
[in]uidThe ID of a remote user.
[in]scaling_modeThe video display mode. NERtcVideoScalingMode.
返回
  • 0: Success.
  • Other values: Failure.

◆ setRemoteSubscribeFallbackOption()

virtual int nertc::IRtcEngineEx::setRemoteSubscribeFallbackOption ( int  option)
pure virtual

Sets the fallback option for the subscribed remote audio and video stream with poor network connections.

The quality of the subscribed audio and video streams is degraded with unreliable network connections. You can use the interface to set the option as kNERtcStreamFallbackVideoStreamLow or kNERtcStreamFallbackAudioOnly.

  • In unreliable downstream network connections, the SDK switches to receive a low-quality video stream or stops receiving video streams. In this way, the communication quality is maintained or improved.
  • The SDK monitors the network quality and resumes the video stream when the network condition improves.
  • If the subscribed remote video stream falls back to audio only, or the audio-only stream switches back to the video stream, the SDK triggers the onRemoteSubscribeFallbackToAudioOnly callback.
注解
You must call the method before you call joinChannel.
自从
V4.3.0
参数
optionThe fallback option for the subscribed remote audio and video stream. With unreliable network connections, the stream falls back to a low-quality video stream of kNERtcStreamFallbackVideoStreamLow. For more information, see RTCStreamFallbackOption.
返回
0
A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ setRemoteSubSteamRenderMode()

virtual int nertc::IRtcEngineEx::setRemoteSubSteamRenderMode ( uid_t  uid,
NERtcVideoScalingMode  scaling_mode 
)
pure virtual

Sets substream video display modes for remote screen sharing.

You can use the method when screen sharing is enabled in substreams on the remote side. The application can repeatedly call the method to change the display mode.

参数
[in]uidThe ID of a remote user.
[in]scaling_modeThe video display mode. NERtcVideoScalingMode.
返回
  • 0: Success.
  • Other values: Failure.

◆ setStatsObserver()

virtual int nertc::IRtcEngineEx::setStatsObserver ( IRtcMediaStatsObserver observer)
pure virtual

Registers a stats observer.

参数
[in]observerThe stats observer.
返回
  • 0: Success.
  • Other values: Failure.

◆ setupLocalSubStreamVideoCanvas()

virtual int nertc::IRtcEngineEx::setupLocalSubStreamVideoCanvas ( NERtcVideoCanvas canvas)
pure virtual

Sets a remote substream canvas.

This method is used to set the display information about the local secondary stream video. The app associates with the video view of local secondary stream by calling this method. During application development, in most cases, before joining a room, you must first call this method to set the local video view after the SDK is initialized.

参数
[in]canvasThe video canvas information.
返回
  • 0: Success.
  • Other values: Failure.

◆ setupRemoteSubStreamVideoCanvas()

virtual int nertc::IRtcEngineEx::setupRemoteSubStreamVideoCanvas ( uid_t  uid,
NERtcVideoCanvas canvas 
)
pure virtual

Sets a remote substream video canvas.

The method associates a remote user with a substream view. You can assign a specified uid to use a corresponding canvas.

注解
  • If the uid is not retrieved, you can set the user ID after the app receives a message delivered when the onUserJoined is triggered.
  • After a user leaves the room, the association between a remote user and the view is cleared.
  • After a user leaves the room, the association between a remote user and the canvas is cleared. The setting is automatically invalid.
参数
[in]uidThe ID of a remote user.
[in]canvasThe video canvas settings.
返回
  • 0: Success.
  • Other values: Failure.

◆ setVideoConfig()

virtual int nertc::IRtcEngineEx::setVideoConfig ( const NERtcVideoConfig config)
pure virtual

Sets local video parameters.

注解
  • You can call this method before or after you join the room.
  • After the setting is configured, the setting takes effect the next time local video is enabled.
  • Each profile has a set of video parameters, such as resolution, frame rate, and bitrate. All the specified values of the parameters are the maximum values in optimal conditions. If the video engine cannot use the maximum value of resolution, due to poor network performance, the value closest to the maximum value is taken.
参数
[in]configSets the video encoding parameters. For more information, see NERtcVideoConfig.
返回
  • 0: Success.
  • Other values: Failure.

◆ setVoiceBeautifierPreset()

virtual int nertc::IRtcEngineEx::setVoiceBeautifierPreset ( NERtcVoiceBeautifierType  type)
pure virtual

Sets an SDK-preset voice beautifier effect.

The method can set a SDK-preset voice beautifier effect for a local user who sends an audio stream.

注解
By default, the method is reset as disabled after the call ends.
参数
[in]typeThe present voice beautifier effect. By default, the voice beautifier effect is disabled. For more information, see NERtcVoiceBeautifierType.
返回
  • 0: Success.
  • Other values: Failure.

◆ startAudioDump()

virtual int nertc::IRtcEngineEx::startAudioDump ( )
pure virtual

Starts recording an audio dump file. Audio dump files can be used to analyze audio issues.

返回
  • 0: Success.
  • Other values: Failure.

◆ startAudioMixing()

virtual int nertc::IRtcEngineEx::startAudioMixing ( NERtcCreateAudioMixingOption option)
pure virtual

Starts playing a music file.

This method mixes the specified local or online audio file with the audio stream captured by the audio devices.

  • Supported audio formats: MP3, M4A, AAC, 3GP, WMA, and WAV. Files that are stored in local or online URLs are supported.
  • After you successfully call the method, if the playback status is changed, the local triggers onAudioMixingStateChanged callbacks.
注解
  • You can call this method after joining a room.
  • Since V4.3.0, if you call this method to play a music file during a call, and manually set the playback volume of the audio mixing and the sent volume, the setting is used when you call the method again during the current call.
参数
[in]optionindicates options of creating audio mixing configurations that include types, full path or URL. For more information, see NERtcCreateAudioMixingOption.
返回
  • 0: Success.
  • Other values: Failure.

◆ startAudioRecording()

virtual int nertc::IRtcEngineEx::startAudioRecording ( const char *  file_path,
int  sample_rate,
NERtcAudioRecordingQuality  quality 
)
pure virtual

Starts an audio recording on a client.

After calling the method, the client records the audio streams that are mixed by all users, and stores the streams in a local file. The onAudioRecording() callback is triggered when the recording starts or ends.

If you specify a type of audio quality, the recording file is saved in different formats.

  • WAV file is large with high quality.
  • AAC file is small with low quality.
注解
  • You must call the method after calling the method after joining a room.
  • A client can only run a recording task. If you repeatedly call the startAudioRecording method, the current recording task stops and a new recording task starts.
  • If the current user leaves the room, the audio recording automatically stops. You can call the stopAudioRecording method to manually stop recording during calls.
参数
file_pathThe absolute path where the recording file is saved. The file name and format must be accurate. For example, sdcard/xxx/audio.aac.
  • Make sure that the specified path is valid and has the write permission.
  • Only WAV or AAC files are supported.
sample_rateThe audio sample rate (Hz). Valid values: 16000, 32000, 44100, and 48000. The default value is 32000.
qualityThe audio quality. The parameter is valid only the audio file is in AAC format. For more information, see NERtcAudioRecordingQuality.
返回
  • 0: Success.
  • Other values: Failure.

◆ startChannelMediaRelay()

virtual int nertc::IRtcEngineEx::startChannelMediaRelay ( NERtcChannelMediaRelayConfiguration config)
pure virtual

Starts relaying media streams. Media streams from up to four rooms can be relayed. A room can receive multiple relayed media streams.

参数
configThe configuration for destination rooms.
返回
A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ startScreenCaptureByDisplayId()

virtual int nertc::IRtcEngineEx::startScreenCaptureByDisplayId ( unsigned int  display_id,
const NERtcRectangle region_rect,
const NERtcScreenCaptureParameters capture_params 
)
pure virtual

Enables screen sharing by specifying the ID of the screen. The content of screen sharing is sent by substreams.

The content of the screen sharing is sent as a substream. If you join a room and call this method to enable the substream, the onUserSubStreamVideoStart callback is remotely triggered.

注解
  • The method applies to only macOS.
  • The method enables video substreams.
参数
display_idThe ID of the screen to be shared. Developers need to specify the screen they share through the parameters.
region_rect(optional) The relative position of shared screen to the full screen.
capture_paramsThe configurations of screen sharing.
返回
  • 0: Success.
  • Other values: Failure.

◆ startScreenCaptureByScreenRect()

virtual int nertc::IRtcEngineEx::startScreenCaptureByScreenRect ( const NERtcRectangle screen_rect,
const NERtcRectangle region_rect,
const NERtcScreenCaptureParameters capture_params 
)
pure virtual

Shares screens through specifying regions. Shares a certain screen or part of region of a screen. Users need to specify the screen region they wants to share in the method.

When calling the method, you need to specify the screen region to be shared, and share the overall frame of the screen or designated regions.

If you join a room and successfully call this method to enable the substream, the onUserSubStreamVideoStart callback is remotely triggered.

注解
  • The method applies to Windows only.
  • The method enables video substreams.
参数
screen_rectThe relative position of the screen to virtual screens that is shared.
region_rect(optional) The relative position of shared screen to the full screen. If you set the shared region beyond the frame of the screen, only content within the screen is shared. If you set the value of width or height as 0, the full screen is shared.
capture_paramsThe configurations of screen sharing.
返回
  • 0: Success.
  • Other values: Failure.

◆ startScreenCaptureByWindowId()

virtual int nertc::IRtcEngineEx::startScreenCaptureByWindowId ( source_id_t  window_id,
const NERtcRectangle region_rect,
const NERtcScreenCaptureParameters capture_params 
)
pure virtual

Enables screen sharing by specifying the ID of the screen. The content of screen sharing is sent by substreams.

Enables screen sharing by specifying the ID of the screen. The content of screen sharing is sent by substreams.

If you join a room and call this method to enable the substream, the onUserSubStreamVideoStart callback is remotely triggered.

注解
  • The method applies to Windows only and macOS.
  • The method enables video substreams.
参数
window_idThe ID of the screen to be shared.
region_rect(optional) The relative position of shared screen to the full screen.
capture_paramsThe configurations of screen sharing.
返回
  • 0: Success.
  • Other values: Failure.

◆ startVideoPreview()

virtual int nertc::IRtcEngineEx::startVideoPreview ( )
pure virtual

Enables video preview.

The method is used to enable local video preview before you join a room. Prerequisites for calling the API:

注解
After the local video preview is enabled, you must first disable the local preview and call stopVideoPreview before joining the room.
返回
  • 0: Success.
  • Other values: Failure.

◆ stopAllEffects()

virtual int nertc::IRtcEngineEx::stopAllEffects ( )
pure virtual

Stops playing all audio effects.

返回
  • 0: Success.
  • Other values: Failure.

◆ stopAudioDump()

virtual int nertc::IRtcEngineEx::stopAudioDump ( )
pure virtual

Finishes recording an audio dump file.

返回
  • 0: Success.
  • Other values: Failure.

◆ stopAudioMixing()

virtual int nertc::IRtcEngineEx::stopAudioMixing ( )
pure virtual

Stops playing music files or audio mixing.

The method stops playing the audio mixing. You can call the method when you are in a room.

返回
  • 0: Success.
  • Other values: Failure.

◆ stopAudioRecording()

virtual int nertc::IRtcEngineEx::stopAudioRecording ( )
pure virtual

Stops the audio recording on the client.

If the local client leaves the room, audio recording automatically stops. You can call the stopAudioRecording method to manually stop recording during calls at any time.

注解
You must call this method before you call leaveChannel.
返回
  • 0: Success.
  • Other values: Failure.

◆ stopChannelMediaRelay()

virtual int nertc::IRtcEngineEx::stopChannelMediaRelay ( )
pure virtual

Stops relaying media streams.

返回
A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ stopEffect()

virtual int nertc::IRtcEngineEx::stopEffect ( uint32_t  effect_id)
pure virtual

Stops playing a specified audio effect file.

You can call the method when you are in a room.

参数
[in]effect_idThe ID of the specified audio effect. Each audio effect has a unique ID.
返回
  • 0: Success.
  • Other values: Failure.

◆ stopScreenCapture()

virtual int nertc::IRtcEngineEx::stopScreenCapture ( )
pure virtual

Stops screen sharing.

If you use the method to disable the substream after joining a room, the onUserSubStreamVideoStop callback is remotely triggered.

返回
  • 0: Success.
  • Other values: Failure.

◆ stopVideoPreview()

virtual int nertc::IRtcEngineEx::stopVideoPreview ( )
pure virtual

Stops video preview.

注解
This method needs to be called before a user joins a room.
返回
  • 0: Success.
  • Other values: Failure.

◆ subscribeRemoteAudioStream()

virtual int nertc::IRtcEngineEx::subscribeRemoteAudioStream ( uid_t  uid,
bool  subscribe 
)
pure virtual

Unsubscribes from or subscribes to audio streams from specified remote users.

After a user joins a channel, audio streams from all remote users are subscribed by default. You can call this method to unsubscribe from or subscribe to audio streams from all remote users.

注解
When the kNERtcKeyAutoSubscribeAudio is enabled by default, users cannot manually modify the state of audio subscription.
参数
[in]uidThe user ID.
[in]subscribe
  • true: Subscribes to specified audio streams (default).
  • false: Unsubscribes from specified audio streams.
返回
  • 0: Success.
  • 30005: State exception that is caused by the invalid interface if users enable the automatic subscription.
  • Other values: Failure.

◆ subscribeRemoteVideoSubStream()

virtual int nertc::IRtcEngineEx::subscribeRemoteVideoSubStream ( uid_t  uid,
bool  subscribe 
)
pure virtual

Subscribes to or unsubscribes from remote substream video from screen sharing. You can receive the substream video data only after you subscribe to remote substream video stream.

注解
  • You must call the method after joining a room.
  • You must first set a remote substream canvas.
参数
[in]uidThe user ID.
[in]subscribe
  • true: Subscribes to or unsubscribes from video streams from specified remote users.
  • false: Unsubscribes from video streams of specified remote users.
返回
  • 0: Success.
  • Other values: Failure.

◆ takeLocalSnapshot()

virtual int nertc::IRtcEngineEx::takeLocalSnapshot ( NERtcVideoStreamType  stream_type,
NERtcTakeSnapshotCallback callback 
)
pure virtual

Takes a local video snapshot.

The takeLocalSnapshot method takes a local video snapshot on the local substream or local bigstream, and call NERtcTakeSnapshotCallback::onTakeSnapshotResult callback to return data of snapshot screen.

注解
  • Before you call the method to capture the snapshot from the bigstream, you must first call startVideoPreview or enableLocalVideo, and joinChannel.
  • Before you call the method to capture the snapshot from the substream, you must first call startScreenCapture, and joinChannel.
  • You can set text, timestamp, and image watermarks at the same time. If different types of watermarks overlap, the layers override previous layers following image, text, and timestamp.
参数
stream_typeThe video stream type of the snapshot. You can set the value to bigstream or substream. For more information, see NERtcVideoStreamType.
callbackThe snapshot callback. For information, see NERtcTakeSnapshotCallback.
返回
  • 0: Success.
  • Other values: Failure.

◆ takeRemoteSnapshot()

virtual int nertc::IRtcEngineEx::takeRemoteSnapshot ( uid_t  uid,
NERtcVideoStreamType  stream_type,
NERtcTakeSnapshotCallback callback 
)
pure virtual

Takes a snapshot of a remote video.

You can call takeRemoteSnapshot to specify the uid of video screen of remote bigstreams and substreams, and returns screenshot data of NERtcTakeSnapshotCallback::onTakeSnapshotResult callback.

注解
  • You need to call takeRemoteSnapshot after receiving callbacks of onUserVideoStart and onUserSubStreamVideoStart.
  • You can set text, timestamp, and image watermarks at the same time. If different types of watermarks overlap, the layers override previous layers following image, text, and timestamp.
参数
uidThe ID of a remote user.
stream_typeThe video stream type of the snapshot. You can set the value to bigstream or substream. For more information, see NERtcVideoStreamType.
callbackThe snapshot callback. For information, see NERtcTakeSnapshotCallback.
返回
  • 0: Success.
  • Other values: Failure.

◆ updateChannelMediaRelay()

virtual int nertc::IRtcEngineEx::updateChannelMediaRelay ( NERtcChannelMediaRelayConfiguration config)
pure virtual

Updates the information of the destination room that relays media stream.

参数
configThe configuration for destination rooms.
返回
A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ updateLiveStreamTask()

virtual int nertc::IRtcEngineEx::updateLiveStreamTask ( const NERtcLiveStreamTaskInfo info)
pure virtual

Updates and modifies a push task in a room.

注解
  • The method is applicable to only live streaming.
  • You can call the method in a room. The method is valid in calls.
参数
[in]infoindicates information of live task. For more information, see NERtcLiveStreamTaskInfo.
返回
  • 0: Success.
  • Other values: Failure.

◆ updateScreenCaptureRegion()

virtual int nertc::IRtcEngineEx::updateScreenCaptureRegion ( const NERtcRectangle region_rect)
pure virtual

When sharing a screen or window, updates the shared region.

参数
region_rect(optional) The relative position of shared screen to the full screen. If you set the shared region beyond the frame of the screen, only content within the screen is shared. If you set width or height as 0, the full screen is shared.
返回
  • 0: Success.
  • Other values: Failure.

◆ uploadSdkInfo()

virtual void nertc::IRtcEngineEx::uploadSdkInfo ( )
pure virtual

Uploads the SDK information. You can call the method only after joining a room. The data that is published contains the log file and the audio dump file.

返回
void

该类的文档由以下文件生成: