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

#include <nertc_engine_event_handler_ex.h>

类 nertc::IRtcEngineEventHandlerEx 继承关系图:
nertc::IRtcEngineEventHandler

Public 成员函数

virtual void onUserSubStreamVideoStart (uid_t uid, NERtcVideoProfileType max_profile)
 
virtual void onUserSubStreamVideoStop (uid_t uid)
 
virtual void onScreenCaptureStatus (NERtcScreenCaptureStatus status)
 
virtual void onUserVideoProfileUpdate (uid_t uid, NERtcVideoProfileType max_profile)
 
virtual void onUserAudioMute (uid_t uid, bool mute)
 
virtual void onUserVideoMute (uid_t uid, bool mute)
 
virtual void onAudioDeviceStateChanged (const char device_id[kNERtcMaxDeviceIDLength], NERtcAudioDeviceType device_type, NERtcAudioDeviceState device_state)
 
virtual void onAudioDefaultDeviceChanged (const char device_id[kNERtcMaxDeviceIDLength], NERtcAudioDeviceType device_type)
 
virtual void onVideoDeviceStateChanged (const char device_id[kNERtcMaxDeviceIDLength], NERtcVideoDeviceType device_type, NERtcVideoDeviceState device_state)
 
virtual void onFirstAudioDataReceived (uid_t uid)
 
virtual void onFirstVideoDataReceived (uid_t uid)
 
virtual void onFirstAudioFrameDecoded (uid_t uid)
 
virtual void onFirstVideoFrameDecoded (uid_t uid, uint32_t width, uint32_t height)
 
virtual void onCaptureVideoFrame (void *data, NERtcVideoType type, uint32_t width, uint32_t height, uint32_t count, uint32_t offset[kNERtcMaxPlaneCount], uint32_t stride[kNERtcMaxPlaneCount], NERtcVideoRotation rotation)
 
virtual void onAudioMixingStateChanged (NERtcAudioMixingState state, NERtcAudioMixingErrorCode error_code)
 
virtual void onAudioMixingTimestampUpdate (uint64_t timestamp_ms)
 
virtual void onAudioEffectFinished (uint32_t effect_id)
 
virtual void onLocalAudioVolumeIndication (int volume)
 
virtual void onRemoteAudioVolumeIndication (const NERtcAudioVolumeInfo *speakers, unsigned int speaker_number, int total_volume)
 
virtual void onAddLiveStreamTask (const char *task_id, const char *url, int error_code)
 
virtual void onUpdateLiveStreamTask (const char *task_id, const char *url, int error_code)
 
virtual void onRemoveLiveStreamTask (const char *task_id, int error_code)
 
virtual void onLiveStreamState (const char *task_id, const char *url, NERtcLiveStreamStateCode state)
 
virtual void onAudioHowling (bool howling)
 
virtual void onRecvSEIMsg (uid_t uid, const char *data, uint32_t dataSize)
 
virtual void onAudioRecording (NERtcAudioRecordingCode code, const char *file_path)
 
virtual void onMediaRelayStateChanged (NERtcChannelMediaRelayState state, const char *channel_name)
 
virtual void onMediaRelayEvent (NERtcChannelMediaRelayEvent event, const char *channel_name, NERtcErrorCode error)
 
virtual void onLocalPublishFallbackToAudioOnly (bool is_fallback, NERtcVideoStreamType stream_type)
 
virtual void onRemoteSubscribeFallbackToAudioOnly (uid_t uid, bool is_fallback, NERtcVideoStreamType stream_type)
 
- Public 成员函数 继承自 nertc::IRtcEngineEventHandler
virtual void onError (int error_code, const char *msg)
 
virtual void onWarning (int warn_code, const char *msg)
 
virtual void onReleasedHwResources (NERtcErrorCode result)
 
virtual void onJoinChannel (channel_id_t cid, uid_t uid, NERtcErrorCode result, uint64_t elapsed)
 
virtual void onReconnectingStart (channel_id_t cid, uid_t uid)
 
virtual void onConnectionStateChange (NERtcConnectionStateType state, NERtcReasonConnectionChangedType reason)
 
virtual void onRejoinChannel (channel_id_t cid, uid_t uid, NERtcErrorCode result, uint64_t elapsed)
 
virtual void onLeaveChannel (NERtcErrorCode result)
 
virtual void onDisconnect (NERtcErrorCode reason)
 
virtual void onClientRoleChanged (NERtcClientRole oldRole, NERtcClientRole newRole)
 
virtual void onUserJoined (uid_t uid, const char *user_name)
 
virtual void onUserLeft (uid_t uid, NERtcSessionLeaveReason reason)
 
virtual void onUserAudioStart (uid_t uid)
 
virtual void onUserAudioStop (uid_t uid)
 
virtual void onUserVideoStart (uid_t uid, NERtcVideoProfileType max_profile)
 
virtual void onUserVideoStop (uid_t uid)
 

详细描述

IRtcEngineEventHandlerEx callback interface class is used to send callback event notifications to the app from SDK. The app gets event notifications from the SDK through inheriting the interface class.

All methods in this interface class have their (empty) default implementations, and the application can inherit only some of the required events instead of all of them. When calling a callback method, the application must not implement time-consuming operations or call blocking-triggered APIs. For example, if you want to enable audio and video, the SDK may be affected in the runtime.

成员函数说明

◆ onAddLiveStreamTask()

virtual void nertc::IRtcEngineEventHandlerEx::onAddLiveStreamTask ( const char *  task_id,
const char *  url,
int  error_code 
)
inlinevirtual

Notifies to add the result of live stream.

The callback asynchronously returns the callback result of addLiveStreamTask. For information about actual pushing state, see onLiveStreamState.

参数
task_idThe ID of a stream-push task.
urlTask ID.
error_codeThe result.
  • 0: Success.
  • Other values: Failure.

◆ onAudioDefaultDeviceChanged()

virtual void nertc::IRtcEngineEventHandlerEx::onAudioDefaultDeviceChanged ( const char  device_id[kNERtcMaxDeviceIDLength],
NERtcAudioDeviceType  device_type 
)
inlinevirtual

Occurs when the default audio devices changes.

参数
device_idDevice ID.
device_typeThe type of the device.

◆ onAudioDeviceStateChanged()

virtual void nertc::IRtcEngineEventHandlerEx::onAudioDeviceStateChanged ( const char  device_id[kNERtcMaxDeviceIDLength],
NERtcAudioDeviceType  device_type,
NERtcAudioDeviceState  device_state 
)
inlinevirtual

Occurs when the state of the audio device changes.

参数
device_idDevice ID.
device_typeThe type of the device. For more information, see NERtcAudioDeviceType.
device_stateThe state of the audio device.

◆ onAudioEffectFinished()

virtual void nertc::IRtcEngineEventHandlerEx::onAudioEffectFinished ( uint32_t  effect_id)
inlinevirtual

Occurs when the playback of a music file ends.

After the audio effect ends the playback, the callback is triggered.

参数
effect_idThe ID of the specified audio effect. Each audio effect has a unique ID.

◆ onAudioHowling()

virtual void nertc::IRtcEngineEventHandlerEx::onAudioHowling ( bool  howling)
inlinevirtual

Occurs when howling is detected.

When the distance between the sound source and the PA equipment is too close, howling may occur. The NERTC SDK supports the howling detection. When a howling signal is detected, the callback is automatically triggered until the howling stops. The application layer can prompt the user to mute the microphone or directly mute the microphone when the app receives the howling information returned by the callback.

注解
Howling detection is used in audio-only scenarios, such as audio chat rooms or online meetings. We recommend that you do not use howling detection in entertainment scenes that include background music.
参数
howlingspecifies whether a howling occurs.
  • true: Howling occurs.
  • false: Normal state.

◆ onAudioMixingStateChanged()

virtual void nertc::IRtcEngineEventHandlerEx::onAudioMixingStateChanged ( NERtcAudioMixingState  state,
NERtcAudioMixingErrorCode  error_code 
)
inlinevirtual

Occurs when the playback state of a local music file changes.

If you call the startAudioMixing method to play a mixing music file and the playback state changes, the callback is triggered.

  • If the playback of the music file ends normally, the state parameter returned in the response contains the corresponding status code kNERtcAudioMixingStateFinished, and the error_code parameter contains kNERtcAudioMixingErrorOK.
  • If an error occurs in the playback, the kNERtcAudioMixingStateFailed status code is returned, and the error_code parameter returned contains the corresponding reason.
  • If the local music file does not exist, the file format is not supported, or the URL of the online music file cannot be accessed, the error_code parameter returned contains kNERtcAudioMixingErrorCanNotOpen.
参数
stateThe playback state of the music file. For more information, see NERtcAudioMixingState.
error_codeThe error code. For more information, see NERtcAudioMixingErrorCode.

◆ onAudioMixingTimestampUpdate()

virtual void nertc::IRtcEngineEventHandlerEx::onAudioMixingTimestampUpdate ( uint64_t  timestamp_ms)
inlinevirtual

Occurs when the playback position of a local music file changes.

If you call the startAudioMixing method to play a mixing music file and the position of the playing operation changes, the callback is triggered.

参数
timestamp_msThe position of the music file playing. Unit: milliseconds.

◆ onAudioRecording()

virtual void nertc::IRtcEngineEventHandlerEx::onAudioRecording ( NERtcAudioRecordingCode  code,
const char *  file_path 
)
inlinevirtual

Returns the audio recording state.

参数
codeThe status code of the audio recording. For more information, see NERtcAudioRecordingCode.
file_pathThe path based on which the recording file is stored.

◆ onCaptureVideoFrame()

virtual void nertc::IRtcEngineEventHandlerEx::onCaptureVideoFrame ( void *  data,
NERtcVideoType  type,
uint32_t  width,
uint32_t  height,
uint32_t  count,
uint32_t  offset[kNERtcMaxPlaneCount],
uint32_t  stride[kNERtcMaxPlaneCount],
NERtcVideoRotation  rotation 
)
inlinevirtual

Occurs when video data are captured.

参数
dataThe video frame data.
typeThe type of the video data.
widthThe width of the video frame.
heightThe height of the video frame.
countVideo plane count.
offsetVideo offset.
strideVideo stride.
rotationThe video rotation angle.

◆ onFirstAudioDataReceived()

virtual void nertc::IRtcEngineEventHandlerEx::onFirstAudioDataReceived ( uid_t  uid)
inlinevirtual

Occurs when the first audio frame from a remote user is received.

参数
uidThe ID of a remote user whose audio streams are sent.

◆ onFirstAudioFrameDecoded()

virtual void nertc::IRtcEngineEventHandlerEx::onFirstAudioFrameDecoded ( uid_t  uid)
inlinevirtual

Occurs when the first audio frame from a remote user is decoded.

参数
uidThe ID of a remote user whose audio streams are sent.

◆ onFirstVideoDataReceived()

virtual void nertc::IRtcEngineEventHandlerEx::onFirstVideoDataReceived ( uid_t  uid)
inlinevirtual

Occurs when the first video frame from a remote user is displayed.

If the first video frame from a remote user is displayed in the view, the callback is triggered.

参数
uidThe ID of a user whose audio streams are sent.

◆ onFirstVideoFrameDecoded()

virtual void nertc::IRtcEngineEventHandlerEx::onFirstVideoFrameDecoded ( uid_t  uid,
uint32_t  width,
uint32_t  height 
)
inlinevirtual

Occurs when the remote video is received and decoded.

If the engine receives the first frame of remote video streams, the callback is triggered.

参数
uidThe ID of a user whose audio streams are sent.
widthThe width of video streams (px).
heightThe height of video streams(px).

◆ onLiveStreamState()

virtual void nertc::IRtcEngineEventHandlerEx::onLiveStreamState ( const char *  task_id,
const char *  url,
NERtcLiveStreamStateCode  state 
)
inlinevirtual

Notifies the status in live stream-pushing.

注解
The callback is valid in a call.
参数
task_idThe ID of a task.
urlThe URL for the streaming task.
stateNERtcLiveStreamStateCode The state of live stream-pushing.
  • 505: Pushing.
  • 506: Pushing fails.
  • 511: Pushing ends.

◆ onLocalAudioVolumeIndication()

virtual void nertc::IRtcEngineEventHandlerEx::onLocalAudioVolumeIndication ( int  volume)
inlinevirtual

Occurs when the system prompts current local audio volume.

This callback is disabled by default. You can enable the callback by calling the enableAudioVolumeIndication method.

After the callback is enabled, if a local user speaks, the SDK triggers the callback based on the time interval specified in the enableAudioVolumeIndication method.

If a local user sets a mute by calling muteLocalAudioStream, the SDK sets the value of volume as 0, and calls back to the application layer.

参数
volumeThe volume of audio mixing. Value range: 0 to 100.

◆ onLocalPublishFallbackToAudioOnly()

virtual void nertc::IRtcEngineEventHandlerEx::onLocalPublishFallbackToAudioOnly ( bool  is_fallback,
NERtcVideoStreamType  stream_type 
)
inlinevirtual

Occurs when the published local media stream falls back to an audio-only stream due to poor network conditions or switches back to audio and video stream after the network conditions improve.

If you call setLocalPublishFallbackOption and set option to kNERtcStreamFallbackAudioOnly, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink network conditions, or when the audio stream switches back to the audio and video stream after the uplink network conditions improve.

自从
V4.3.0
参数
is_fallbackThe locally published stream falls back to audio-only mode or switches back to audio and video stream.
  • true: The published stream from a local client falls back to audio-only mode due to poor uplink network conditions.
  • false: The audio stream switches back to the audio and video stream after the upstream network condition improves.
stream_typeThe type of the video stream, such as bigstream and substream.

◆ onMediaRelayEvent()

virtual void nertc::IRtcEngineEventHandlerEx::onMediaRelayEvent ( NERtcChannelMediaRelayEvent  event,
const char *  channel_name,
NERtcErrorCode  error 
)
inlinevirtual

Occurs when events related to media stream relay are triggered.

参数
eventThe media stream relay event.
channel_nameThe name of the destination room where the media streams are relayed.
errorSpecific error codes.

◆ onMediaRelayStateChanged()

virtual void nertc::IRtcEngineEventHandlerEx::onMediaRelayStateChanged ( NERtcChannelMediaRelayState  state,
const char *  channel_name 
)
inlinevirtual

Occurs when the state of the media stream is relayed.

参数
stateThe state of the media stream.
channel_nameThe name of the destination room where the media streams are relayed.

◆ onRecvSEIMsg()

virtual void nertc::IRtcEngineEventHandlerEx::onRecvSEIMsg ( uid_t  uid,
const char *  data,
uint32_t  dataSize 
)
inlinevirtual

Occurs when the content of remote SEI is received.

After a remote client successfully sends SEI, the local client receives a message returned by the callback.

参数
[in]uidThe ID of the user who sends the SEI.
[in]dataThe received SEI data.
[in]dataSizeThe size of received SEI data.

◆ onRemoteAudioVolumeIndication()

virtual void nertc::IRtcEngineEventHandlerEx::onRemoteAudioVolumeIndication ( const NERtcAudioVolumeInfo speakers,
unsigned int  speaker_number,
int  total_volume 
)
inlinevirtual

Occurs when the system prompts the active speaker and the audio volume.

By default, the callback is disabled. You can enable the callback by calling the enableAudioVolumeIndication method. After the callback is enabled, if a local user speaks, the SDK triggers the callback based on the time interval specified in the enableAudioVolumeIndication method.

In the array of speakers returned:

  • If a uid is contained in the array returned in the last response but not in the array returned in the current response. The remote user with the uid does not speak by default.
  • If the volume is 0, the user does not speak.
  • If the array is empty, the remote user does not speak.
参数
speakersThe array that contains the information about user IDs and volumes is NERtcAudioVolumeInfo.
speaker_numberThe size of speakers array, which indicates the number of speakers.
total_volumeThe total volume (after audio mixing). Value range: 0 to 100.

◆ onRemoteSubscribeFallbackToAudioOnly()

virtual void nertc::IRtcEngineEventHandlerEx::onRemoteSubscribeFallbackToAudioOnly ( uid_t  uid,
bool  is_fallback,
NERtcVideoStreamType  stream_type 
)
inlinevirtual

Occurs when the subscribed remote media stream falls back to an audio-only stream due to poor network conditions or switches back to the audio and video stream after the network condition improves.

If you call setLocalPublishFallbackOption and set option to kNERtcStreamFallbackAudioOnly, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink network conditions, or when the audio stream switches back to the audio and video stream after the uplink network condition improves.

自从
V4.3.0
参数
uidThe ID of a remote user.
is_fallbackThe subscribed remote media stream falls back to audio-only mode or switches back to the audio and video stream.
  • true: The subscribed remote media stream falls back to audio-only mode due to poor downstream network conditions.
  • false: The subscribed remote media stream switches back to the audio and video stream after the downstream network condition improves.
stream_typeThe type of the video stream, such as bigstream and substream.

◆ onRemoveLiveStreamTask()

virtual void nertc::IRtcEngineEventHandlerEx::onRemoveLiveStreamTask ( const char *  task_id,
int  error_code 
)
inlinevirtual

Notifies to delete the result of live stream.

The callback asynchronously returns the callback result of ref IRtcEngineEx::addLiveStreamTask "addLiveStreamTask". For information about actual pushing state, see onLiveStreamState.

参数
task_idThe ID of a task.
error_codeThe result.
  • 0: Success.
  • Other values: Failure.

◆ onScreenCaptureStatus()

virtual void nertc::IRtcEngineEventHandlerEx::onScreenCaptureStatus ( NERtcScreenCaptureStatus  status)
inlinevirtual

Occurs when screen sharing is paused/resumed/started/ended.

◆ onUpdateLiveStreamTask()

virtual void nertc::IRtcEngineEventHandlerEx::onUpdateLiveStreamTask ( const char *  task_id,
const char *  url,
int  error_code 
)
inlinevirtual

Notifies to Updates the result of live stream.

The callback asynchronously returns the callback result of ref IRtcEngineEx::addLiveStreamTask "addLiveStreamTask". For information about actual pushing state, see onLiveStreamState.

参数
task_idThe ID of a stream-push task.
urlThe URL for the streaming task.
error_codeThe result.
  • 0: Success.
  • Other values: Failure.

◆ onUserAudioMute()

virtual void nertc::IRtcEngineEventHandlerEx::onUserAudioMute ( uid_t  uid,
bool  mute 
)
inlinevirtual

Callbacks that specify whether to mute remote users.

参数
uidThe ID of a remote user.
muteindicates whether to unmute the remote user.

◆ onUserSubStreamVideoStart()

virtual void nertc::IRtcEngineEventHandlerEx::onUserSubStreamVideoStart ( uid_t  uid,
NERtcVideoProfileType  max_profile 
)
inlinevirtual

Occurs when a remote user enables screen sharing by using the substream.

参数
uidThe ID of a remote user.
max_profileThe largest resolution of the remote video.

◆ onUserSubStreamVideoStop()

virtual void nertc::IRtcEngineEventHandlerEx::onUserSubStreamVideoStop ( uid_t  uid)
inlinevirtual

Occurs when a remote user stops screen sharing by using the substream.

参数
uidThe ID of a remote user.

◆ onUserVideoMute()

virtual void nertc::IRtcEngineEventHandlerEx::onUserVideoMute ( uid_t  uid,
bool  mute 
)
inlinevirtual

Occurs when a remote user stops or resumes sending video streams.

参数
uidThe ID of a remote user.
mutespecifies whether to disable video streams.

◆ onUserVideoProfileUpdate()

virtual void nertc::IRtcEngineEventHandlerEx::onUserVideoProfileUpdate ( uid_t  uid,
NERtcVideoProfileType  max_profile 
)
inlinevirtual

Occurs when video configurations of remote users are updated.

/** Occurs when video configurations of remote users are updated.

参数
uidThe ID of a remote user.
max_profileThe resolution of video encoding measures the encoding quality.

◆ onVideoDeviceStateChanged()

virtual void nertc::IRtcEngineEventHandlerEx::onVideoDeviceStateChanged ( const char  device_id[kNERtcMaxDeviceIDLength],
NERtcVideoDeviceType  device_type,
NERtcVideoDeviceState  device_state 
)
inlinevirtual

Occurs when the state of the video device is changed.

参数
device_idDevice ID.
device_typeThe type of the video device.
device_stateThe state of the video device.

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