Event Callback

Callback List

  • IThunderEventHandler

public member functionsFunction Name
virtual voidonJoinRoomSuccess(const char* roomId, const char* uid, int elapsed) = 0
virtual voidonLeaveRoom() = 0
virtual voidonPlayVolumeIndication(const AudioVolumeInfo* speakers, int speakerCount, int totalVolume) = 0
virtual voidonInputVolume(unsigned volume) = 0
virtual voidonOutputVolume(unsigned volume) = 0
virtual voidonBizAuthResult(bool bPublish, AUTH_RESULT result) = 0
virtual voidonSdkAuthResult(AUTH_RESULT result) = 0
virtual voidonTokenWillExpire(const char* token) = 0
virtual voidonTokenRequest() = 0
virtual voidonUserBanned(bool status) = 0
virtual voidonNetworkQuality(const char* uid, NetworkQuality txQuality, NetworkQuality rxQuality) = 0
virtual voidonFirstLocalVideoFrameSent(int elapsed) = 0
virtual voidonFirstLocalAudioFrameSent(int elapsed) = 0
virtual voidonRemoteAudioStopped(const char* uid, bool stop) = 0
virtual voidonConnectionStatus(ThunderConnectionStatus status) = 0
virtual voidonConnectionLost() = 0
virtual voidonRemoteVideoStopped(const char* uid, bool stop) = 0
virtual voidonVideoSizeChanged(const char* uid, int width, int height, int rotation) = 0
virtual voidonRemoteVideoPlay(const char* uid, int width, int height, int elapsed) = 0
virtual voidonNetworkTypeChanged(ThunderNetworkType type) = 0
virtual voidonAudioCaptureStatus(ThunderAudioDeviceStatus type) = 0
virtual voidonPublishStreamToCDNStatus(const char* url, ThunderPublishCDNErrorCode errorCode) = 0
virtual voidonRoomStats(RoomStats stats) = 0
virtual voidonRecvUserAppMsgData(const char* uid, const char* msgData) = 0
virtual voidonSendAppMsgDataFailedStatus(int status) = 0
virtual voidonVideoCaptureStatus(int status) = 0
virtual voidonLocalVideoStats(const LocalVideoStats stats) = 0
virtual voidonLocalAudioStats(const LocalAudioStats stats) = 0
virtual voidonRemoteVideoStatsOfUid(const char* uid, const RemoteVideoStats stats) = 0
virtual voidonRemoteAudioStatsOfUid(const char* uid, const RemoteAudioStats stats) = 0
virtual voidonRemoteAudioPlay(const char* uid, int elapsed)
virtual voidonLocalAudioStatusChanged(LOCAL_AUDIO_STREAM_STATUS status, LOCAL_AUDIO_STREAM_ERROR_REASON errorReason)
virtual voidonLocalVideoStatusChanged(LOCAL_VIDEO_STREAM_STATUS status, LOCAL_VIDEO_STREAM_ERROR_REASON error)
virtual voidonRemoteAudioStateChangedOfUid(const char* uid, REMOTE_AUDIO_STATE state, REMOTE_AUDIO_REASON reason, int elapsed)
virtual voidonRemoteVideoStateChangedOfUid(const char* uid, REMOTE_VIDEO_STATE state, REMOTE_VIDEO_REASON reason, int elapsed)
virtual voidonDeviceStats(const DeviceStats& stats)
virtual voidonCaptureVolumeIndication(int totalVolume, int cpt, int micVolume)
virtual voidonAudioDeviceVolumeChanged(int deviceType, int volume, bool muted)
virtual voidonVideoDeviceStateChanged(const char* deviceId, MEDIA_DEVICE_TYPE deviceType, MEDIA_DEVICE_STATE_TYPE deviceState)
virtual voidonHowlingDetectResult(bool bHowling)
virtual voidonEchoDetectResult(bool bEcho)
virtual voidonWarning
  • IAudioFrameObserver

public member functionsFunction Name
virtual boolonRecordAudioFrame(AudioFrame& audioFrame) = 0
virtual boolonPlaybackAudioFrame(AudioFrame& audioFrame) = 0
virtual boolonPlaybackAudioFrameBeforeMixing(char* uid, AudioFrame& audioFrame) = 0
  • IThunderAudioPlayerNotify

public member functionsFunction Name
virtual voidonAudioFileVolume(unsigned int volume, unsigned int currentMs, unsigned int totalMs) = 0
virtual voidonAudioFilePlayEnd() = 0
virtual voidonAudioFileStateChange(ThunderAudioFilePlayerEvent event, ThunderAudioFilePLayerErrorCode errorCode)
  • IVideoFrameObserver

public member functionsFunction Name
virtual boolonPreviewVideoFrame(VideoFrame& videoFrame) = 0
virtual boolonRenderVideoFrame(const char* uid, VideoFrame& videoFrame) = 0
  • IVideoCaptureObserver

public member functionsFunction Name
virtual boolonCaptureVideoFrame(VideoFrame& videoFrame) = 0
  • IThunderMediaExtraInfoObserver

public member functionsFunction Name
virtual voidonSendMediaExtraInfoFailedStatus(int status) = 0
virtual voidonRecvMediaExtraInfo(const char* uid, const char* pData, int dataLen) = 0
virtual boolonRecvMixAudioInfo(const char* uid, MixAudioInfoList& infos) = 0
virtual boolonRecvMixVideoInfo(const char* uid, MixVideoInfoList& infos) = 0

Callback Details

IThunderEventHandler

IThunderEventHandler::onJoinRoomSuccess

virtual void Thunder::IThunderEventHandler::onJoinRoomSuccess(const char* roomName, const char* uid, int elapsed);

Called when a user joins a channel.

Note:

If you receive this callback after calling IThunderEngine::joinRoom means, connection to the server succeeds. In this case, you can call interfaces that are allowed only after entering room successfully.

Parameter
ParameterTypeDescription
roomNameOUTRoom name
uidOUTUser ID
elapsedOUTTTime elapsed from the user calling the IThunderEngine::joinRoom until the SDK triggers this callback, unit: ms

IThunderEventHandler::onLeaveRoom

virtual void Thunder::IThunderEventHandler::onLeaveRoom();

Called when a user leaves the channel.

Note:

This callback notifies that a user leaves the room if you the application calls leaveRoom.


IThunderEventHandler::onPlayVolumeIndication

virtual void Thunder::IThunderEventHandler::onPlayVolumeIndication(const AudioVolumeInfo* speakers, int speakerCount, int totalVolume);

Report which users are speaking, the speakers' volume.

Note:

Once setAudioVolumeIndication is enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not.

Parameter
ParameterTypeDescription
speakersOUTSpeaker (array). For details, see AudioVolumeInfo.
speakerCountOUTTotal number of speakers.
totalVolumeOUTTotal volume after audio mixing, range: [0-100]

IThunderEventHandler::onInputVolume

virtual void Thunder::IThunderEventHandler::onInputVolume(unsigned volume);

Reports the input volume for audition.

Note:

This callback is received if startInputDeviceTest is called. The call frequency is 120 ms.

Parameter
ParameterTypeDescription
volumeOUTVolume value [0-100]

IThunderEventHandler::onOutputVolume

virtual void Thunder::IThunderEventHandler::onOutputVolume(unsigned volume);

Reports the input volume for audition.

Note:

This callback is received if startOutputDeviceTestis called. The call frequency is 150 ms.

Parameter
ParameterTypeDescription
volumeOUTVolume value [0-100]

IThunderEventHandler::onBizAuthResult

virtual void Thunder::IThunderEventHandler::onBizAuthResult(bool bPublish, AUTH_RESULT result);

Callback on service authentication results.

Note:

  • For returned results to be authenticated by the service, Jocloud will transfer the authentication request to the service authentication server and pass through and return authentication results.
  • This callback is received if service authentication is mandatory for services and there is media stream in the uplink.
Parameter
ParameterTypeDescription
bPublishOUTtrue: publishing authentication false: playing authentication
resultOUTAuthentication results 0: pass
Other values: fail.

IThunderEventHandler::onSdkAuthResult

virtual void Thunder::IThunderEventHandler::onSdkAuthResult(AUTH_RESULT result);

Callback of SDK authentication result.

Note:

  • Reports authentication result if IThunderEngine::joinRoom is called and there is uplink and downlink media data.
Parameter
ParameterTypeDescription
resultOUTFor details about the authentication result, see AUTH_RESULT

IThunderEventHandler::onTokenWillExpire

virtual void Thunder::IThunderEventHandler::onTokenWillExpire(const char* token);

This callback is received if the user’s token is to expire.

Parameter
ParameterTypeDescription
tokenOUTtoken expired

IThunderEventHandler::onTokenRequest

virtual void Thunder::IThunderEventHandler::onTokenRequest();

This callback is received if the user’s token has expired.


IThunderEventHandler::onUserBanned

virtual void Thunder::IThunderEventHandler::onUserBanned(bool status);

This callback is received if the user’s banning status has changed.

Parameter
ParameterTypeDescription
statusOUTtrue: banned; false: unbanned

IThunderEventHandler::onUserJoined

virtual void Thunder::IThunderEventHandler::onUserJoined(const char* uid, int elapsed);

Called when a user/anchor joins the room.

Note:

  • This API is deprecated from V2.8.0.
  • This callback is valid only in audio-only mode and will be triggered when other users enter the room where the local user has entered.
Parameter
ParameterTypeDescription
uidOUTUser ID
elapsedOUTTime delay from the local user calling joinRoom until the SDK triggers this callback, uint: ms

IThunderEventHandler::onUserOffline

virtual void Thunder::IThunderEventHandler::onUserOffline(const char* uid, USER_OFFLINE_REASON_TYPE reason);

Callback when the user exits the current room.

Note:

  • This API is deprecated from V2.8.0.
  • This callback is valid only in audio-only mode and is returned when other users leave the room where the local user has entered.
Parameter
ParameterTypeDescription
uidOUTUser ID
reasonOUTOffline reason. For details, see USER_OFFLINE_REASON_TYPE.

IThunderEventHandler::onNetworkQuality

virtual void Thunder::IThunderEventHandler::onNetworkQuality(const char* uid, NetworkQuality txQuality, NetworkQuality rxQuality);

Reporting user network uplink/downlink quality.

Parameter
ParameterTypeDescription
uidOUTUser ID
txQualityOUTUplink network quality of this user. For details, see NetworkQuality.
rxQualityOUTDownlink network quality of this user. For details, see NetworkQuality.

IThunderEventHandler::onFirstLocalVideoFrameSent

virtual void Thunder::IThunderEventHandler::onFirstLocalVideoFrameSent(int elapsed);

Called when the first local video frame is sent.

Parameter
ParameterTypeDescription
elapsedOUTTime elapsed (ms) from the local user calling the IThunderEngine::joinRoom until the SDK triggers this callback

IThunderEventHandler::onFirstLocalAudioFrameSent

virtual void Thunder::IThunderEventHandler::onFirstLocalAudioFrameSent(int elapsed);

Called when the first local audio frame is sent.

Parameter
ParameterTypeDescription
elapsedOUTTime elapsed (ms) from the local user calling the IThunderEngine::joinRoom until the SDK triggers this callback

IThunderEventHandler::onRemoteAudioStopped

virtual void Thunder::IThunderEventHandler::onRemoteAudioStopped(const char* uid, bool stopped);

Callback on enabling/disabling remote user’s audio stream. This callback is received if IThunderEngine::joinRoom is called and status of existing and subsequent audio streams in the room changes.

Parameter
ParameterTypeDescription
uidOUTRemote user ID
muteOUTtrue: Audio streams disabled;
false: Audio streams enabled

IThunderEventHandler::onConnectionStatus

virtual void Thunder::IThunderEventHandler::onConnectionStatus(ThunderConnectionStatus status);

Reporting status of connection with server network. This callback is received if IThunderEngine::joinRoom is called and SDK connection with server network changes.

Parameter
ParameterTypeDescription
statusOUTNetwork connection status. For details, see ThunderConnectionStatus.

IThunderEventHandler::onConnectionLost

virtual void Thunder::IThunderEventHandler::onConnectionLost();

Callback on disconnection with server network. This callback is received if IThunderEngine::joinRoom is called and SDK connection with server network is interrupted.


IThunderEventHandler::onRemoteVideoStopped

virtual void Thunder::IThunderEventHandler::onRemoteVideoStopped(const char* uid, bool stopped);

Callback on stopping/starting remote user video streaming. This callback is received if IThunderEngine::joinRoom is called and status of existing and subsequent video streams in the room change.

Parameter
ParameterTypeDescription
uidOUTRemote user Id
muteOUTtrue: Video streams disabled; false: Video streams enabled

IThunderEventHandler::onVideoSizeChanged

virtual void Thunder::IThunderEventHandler::onVideoSizeChanged(const char* uid, int width, int height, int rotation);

Callback on change in local or remote video resolution. This callback is received if IThunderEngine::joinRoom is called and video resolution changes.

Parameter
ParameterTypeDescription
uidOUTUser ID
widthOUTWidth
heightOUTHigh
rotationOUTReserved

IThunderEventHandler::onRemoteVideoPlay

virtual void Thunder::IThunderEventHandler::onRemoteVideoPlay(const char* uid, int width, int height, int elapsed);

Callback on displayed first remote video frame. Used to calculate the video speed. This callback is received after setRemoteVideoCanvas is called and video streams are received and displayed in the window.

Parameter
ParameterTypeDescription
uidOUTUser id
widthOUTWidth
heightOUTHigh
elapsedOUTTime (ms) consumed from calling IThunderEngine::joinRoom to event callback

IThunderEventHandler::onNetworkTypeChanged

virtual void Thunder::IThunderEventHandler::onNetworkTypeChanged(ThunderNetworkType type);

Callback on network status change. This callback is received if initialization (initialize) is complete and network type changes.

Parameter
ParameterTypeDescription
typeOUTNetwork connection type. For details, see ThunderNetworkType.

IThunderEventHandler::onAudioCaptureStatus

virtual void Thunder::IThunderEventHandler::onAudioCaptureStatus(ThunderAudioDeviceStatus type);

Callback on changes in audio device capture status. Enable audio capture. When device for audio capture changes in status, this notification will be received.

Parameter
ParameterTypeDescription
typeOUTCollection status of the audio device. For details, see ThunderAudioDeviceStatus.

IThunderEventHandler::onPublishStreamToCDNStatus

virtual void Thunder::IThunderEventHandler::onPublishStreamToCDNStatus(const char* url, ThunderPublishCDNErrorCode errorCode);

Callback on CDN stream publishing result. This callback is received if the user has called addPublishOriginStreamUrl or addPublishTranscodingStreamUrl for stream publishing and the stream publishing status changes.

Parameter
ParameterTypeDescription
urlOUTURL for stream publishing
errorCodeOUTError code for stream publishing. For details, see ThunderPublishCDNErrorCode.

IThunderEventHandler::onRoomStats

virtual void Thunder::IThunderEventHandler::onRoomStats(RoomStats stats);

Callback on uplink/downlink traffic (periodic callback at an interval of 2 seconds). This callback is received when the user enters a channel.

Parameter
ParameterTypeDescription
statsOUTSpecific status. For details, see RoomStats.

IThunderEventHandler::onRecvUserAppMsgData

virtual void Thunder::IThunderEventHandler::onRecvUserAppMsgData(const char* uid, const char* msgData);

Callback custom broadcast message of service This callback is received by users entering the channel if the anchor sends data through sendUserAppMsgData.

Parameter
ParameterTypeDescription
uidOUTuid of the user that sends the message
msgDataOUTReceived customized broadcast message

IThunderEventHandler::onSendAppMsgDataFailedStatus

virtual void Thunder::IThunderEventHandler::onSendAppMsgDataFailedStatus(ThunderSendAppMsgDataFailedStatus status);

This callback is received if the anchor fails to send data by calling sendUserAppMsgData.

Parameter
ParameterTypeDescription
statusOUTCauses for failure in sending customized broadcast messages. For details, see ThunderSendAppMsgDataFailedStatus.

IThunderEventHandler::onVideoCaptureStatus

virtual void Thunder::IThunderEventHandler::onVideoCaptureStatus(ThunderCaptureStatus status);

Callback on changes in camera capture status. This callback is received when camera collection starts and the collection status of the camera changes.

Parameter
ParameterTypeDescription
statusOUTCamera collection status. For details, see ThunderCaptureStatus.

IThunderEventHandler::onLocalVideoStats

virtual void Thunder::IThunderEventHandler::onLocalVideoStats(const LocalVideoStats stats);

The statistics of sending of video stream by local device is described during this callback. Callback time: 1. immediate callback when the publishing interface is called; 2. immediate callback on bracket change during the publishing; and 3. periodical callback at an interval of 2s.

Parameter
ParameterTypeDescription
statsOUTStatistical data on local video. For details, see LocalVideoStats.

IThunderEventHandler::onLocalAudioStats

virtual void Thunder::IThunderEventHandler::onLocalAudioStats(const LocalAudioStats stats);

The statistics of sending of video stream by local device is described during this callback. Callback time: periodical callback at an interval of 2s.

Parameter
ParameterTypeDescription
statsOUTStatistical data on local audio. For details, see LocalAudioStats.

IThunderEventHandler::onRemoteVideoStatsOfUid

virtual void Thunder::IThunderEventHandler::onRemoteVideoStatsOfUid(const char* uid, const RemoteVideoStats stats);

The end-to-end video stream status in calling of remote users is described during this callback, which is triggered once 2s for each remote user/anchor. In case multiple users/anchors exist remotely at the same time, this callback will be triggered multiple times every 2 seconds.

Parameter
ParameterTypeDescription
uidOUTId of remote user/anchor
statsOUTStatistical data on remote video. For details, see RemoteVideoStats.

IThunderEventHandler::onRemoteAudioStatsOfUid

virtual void Thunder::IThunderEventHandler::onRemoteAudioStatsOfUid(const char* uid, const RemoteAudioStats stats);

This callback describes end-to-end video streaming status of remote user during the call. It is triggered every 2s for each remote user/anchor. In case multiple users/anchors exist remotely at the same time, this callback will be triggered multiple times every 2 seconds.

Parameter
ParameterTypeDescription
uidOUTId of remote user/anchor
statsOUTStatistical data on remote audio. For details, see RemoteAudioStats.

IThunderEventHandler::onRemoteAudioPlay

virtual void onRemoteAudioPlay(const char* uid, int elapsed);

Callback about first frame of played remote videos.

Parameter
ParameterTypeDescription
uidOUTRemote user ID (anchor ID)
elapsedOUTPeriod from the the user calls joinRoom to the event occurs, unit: milliseconds

IThunderEventHandler::onLocalAudioStatusChanged

virtual void onLocalAudioStatusChanged(LOCAL_AUDIO_STREAM_STATUS status, LOCAL_AUDIO_STREAM_ERROR_REASON errorReason);

Local audio status change callback.

Parameter
ParameterTypeDescription
statusOUTLocal audio status, see details in LOCAL_AUDIO_STREAM_STATUS
errorReasonOUTCause of local audio error, see details in LOCAL_AUDIO_STREAM_ERROR_REASON

IThunderEventHandler::onLocalVideoStatusChanged

virtual void onLocalVideoStatusChanged(LOCAL_VIDEO_STREAM_STATUS status, LOCAL_VIDEO_STREAM_ERROR_REASON error);

Local video status change callback.

Parameter
ParameterTypeDescription
statusOUTLocal video status, see details in LOCAL_VIDEO_STREAM_STATUS
errorOUTCause of local video error, see details in LOCAL_VIDEO_STREAM_ERROR_REASON

IThunderEventHandler::onRemoteAudioStateChangedOfUid

virtual void onRemoteAudioStateChangedOfUid(const char* uid,
                                            REMOTE_AUDIO_STATE state,
	                                        REMOTE_AUDIO_REASON reason,
	                                        int elapsed);

Callback about audio status change of remote users.

Parameter
ParameterTypeDescription
uidOUTRemote user ID (anchor ID)
stateOUTAudio stream status, see details in REMOTE_AUDIO_STATE
reasonOUTCause of audio stream change, see details in REMOTE_AUDIO_REASON
elapsedOUTPeriod from the the user calls joinRoom to the event occurs, unit: milliseconds

IThunderEventHandler::onRemoteVideoStateChangedOfUid

virtual void onRemoteVideoStateChangedOfUid(const char* uid,
	                                        REMOTE_VIDEO_STATE state,
	                                        REMOTE_VIDEO_REASON reason,
	                                        int elapsed);

Callback about video status change of remote users.

Parameter
ParameterTypeDescription
uidOUTRemote user ID (anchor ID)
stateOUTVideo stream status, see details in REMOTE_VIDEO_STATE
reasonOUTCause of video stream change, see details in REMOTE_VIDEO_REASON
elapsedOUTPeriod from the the user calls joinRoom to the event occurs, unit: milliseconds

IThunderEventHandler::onDeviceStats

virtual void onDeviceStats(const DeviceStats& stats);

CPU or memory usage satus.

Parameter
ParameterTypeDescription
statsOUTCPU or memory usage satus, see details in DeviceStats

IThunderEventHandler::onCaptureVolumeIndication

virtual void onCaptureVolumeIndication(int totalVolume, int cpt, int micVolume);

Volume capture callback, which is disable by default and can be enabled by calling enableCaptureVolumeIndication.

Parameter
ParameterTypeDescription
totalVolumeOUTVolume, range: [0-100]
cptOUTCapture time
micVolumeOUTVolume captured by microphone, range: [0-100]

IThunderEventHandler::onAudioDeviceVolumeChanged

virtual void onAudioDeviceVolumeChanged(int deviceType, int volume, bool muted);

Volume change of playback or recording device, or audio player apllication.

Parameter
ParameterTypeDescription
deviceTypeOUTDevice type,see details in MEDIA_DEVICE_TYPE
volumeOUTVolume
mutedOUTWhether to mute: 0-no, 1-yes

IThunderEventHandler::onVideoDeviceStateChanged

virtual void onVideoDeviceStateChanged(const char* deviceId, MEDIA_DEVICE_TYPE deviceType, MEDIA_DEVICE_STATE_TYPE deviceState);

Callback of video device status change. For example, plug cameras.

Parameter
ParameterTypeDescription
deviceIdOUTVideo device ID,which corresponds to VideoDeviceInfo.index
deviceTypeOUTDevice type, see details in MEDIA_DEVICE_TYPE
deviceStateOUTVideo device status, see details in MEDIA_DEVICE_STATE_TYPE

IThunderEventHandler::onHowlingDetectResult

virtual void onHowlingDetectResult(bool bHowling);

Callback of howling detection results.

Note:

  • The callback is received when the enableHowlingDetector is enabled and the microphone is on.
  • The callback is called when the echo detection status changes.
  • The callback will be recevied when the enableHowlingDetector is enabled and the microphone status changes.
  • This callback will be received once from enableHowlingDetector(false) to enableHowlingDetector(true) when the microphone is on.
Parameter
ParameterTypeDescription
bHowlingOUTDetection result: "true"-detected, "false"-not detected

IThunderEventHandler::onEchoDetectResult

virtual void onEchoDetectResult(bool bEcho);

Callback of echo detection results.

Note:

  • The callback is received when the enableEchoDetector is enabled and the microphone is on.
  • The callback is called when the echo detection status changes.
  • The callback will be recevied when the enableEchoDetector is enabled and the microphone status changes.
  • This callback will be received once from enableEchoDetector(false) to enableEchoDetector(true) when the microphone is on.
Parameter
ParameterTypeDescription
bEchoOUTDetection result: "true"-detected, "false"-not detected

IThunderEventHandler::onWarning

virtual void onWarning(ThunderWarningCode warnCode, const char *msg);

Inform the business layer of SDK warnings.

| Parameter | Type | Description | | :--- | :--- | | :--- | | warnCode | OUT | Warning code, see details in ThunderWaringCode | | msg | OUT | Warning details |


IAudioFrameObserver

IAudioFrameObserver::onRecordAudioFrame

virtual void Thunder::IAudioFrameObserver::onRecordAudioFrame(AudioFrame& audioFrame);

Callback on raw audio capture data.

  • The user has called the registerAudioFrameObserver interface and has registered IAudioFrameObserver.
  • Meanwhile, when the user starts capture, this callback will be received.
Parameter
ParameterTypeDescription
audioFrameOUTFor original audio data, see AudioFrame for details

IAudioFrameObserver::onPlaybackAudioFrame

virtual void Thunder::IAudioFrameObserver::onPlaybackAudioFrame(AudioFrame& audioFrame);

Callback on raw audio play data.

  • The user has called the registerAudioFrameObserver interface and has registered IAudioFrameObserver.
  • Meanwhile, when there’s audio data being played, this callback will be received.
Parameter
ParameterTypeDescription
audioFrameOUTFor original audio data, see AudioFrame for details

IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing

virtual void Thunder::IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing(char* uid, AudioFrame& audioFrame);

Callback of original data decoded by remote user can differentiate users through different uids.

  • The user has called the registerAudioFrameObserver interface and has registered IAudioFrameObserver.
  • Meanwhile, when there’s remote audio data being played, this callback will be received.
Parameter
ParameterTypeDescription
uidOUTRemote user uid
audioFrameOUTFor original audio data, see AudioFrame for details

IThunderAudioPlayerNotify

IThunderAudioPlayerNotify::onAudioFileVolume

virtual void Thunder::IThunderAudioPlayerNotify::onAudioFileVolume(unsigned int volume, unsigned int currentMs, unsigned int totalMs);

Callback on progress information of audio player.

  • Call the IThunderAudioPlayer::SetFilePlayerNotify interface with IThunderAudioPlayerNotify set as the monitoring object.
Parameter
ParameterTypeDescription
volumeOUTVolume range: [0-100]
currentMsOUTCurrent play progress, unit: ms
totalMsOUTTotal duration of the audio file, unit: ms

IThunderAudioPlayerNotify::onAudioFilePlayEnd

Note:

virtual void Thunder::IThunderAudioPlayerNotify::onAudioFilePlayEnd();

The audio player plays and then calls back.

  • Call the IThunderAudioPlayer::SetFilePlayerNotify interface with IThunderAudioPlayerNotify set as the monitoring object.

IThunderAudioPlayerNotify::onAudioFileStateChange

virtual void onAudioFileStateChange(ThunderAudioFilePlayerEvent event, ThunderAudioFilePLayerErrorCode errorCode);

Playback status.

  • Set IThunderAudioPlayerNotify as a callback listening object by calling the API IThunderAudioPlayer::SetFilePlayerNotify.
Parameter
ParameterTypeDescription
eventOUTPlayback description, see details in ThunderAudioFilePlayerEvent
errorCodeOUTError codes, see details in ThunderAudioFilePLayerErrorCode

IVideoFrameObserver

IVideoFrameObserver::onPreviewVideoFrame

virtual bool Thunder::IVideoFrameObserver::onPreviewVideoFrame(VideoFrame& videoFrame);

The local video preview data is called back. The current data format is YUV420.

Parameter
ParameterTypeDescription
videoFrameOUTLocal preview video data. For details, see VideoFrame.

IVideoFrameObserver::onRenderVideoFrame

virtual bool Thunder::IVideoFrameObserver::onRenderVideoFrame(const char* uid, VideoFrame& videoFrame);

The rendering video data of other users is called back. The data format is YUV420.

Parameter
ParameterTypeDescription
uidOUTUser id
videoFrameOUTUser rending video data. For details, see VideoFrame.

IVideoCaptureObserver

IVideoCaptureObserver::onCaptureVideoFrame

virtual bool Thunder::IVideoCaptureObserver::onCaptureVideoFrame(VideoFrame& videoFrame);

The local video capture data is called back. The current data format is BGRA.

Parameter
ParameterTypeDescription
videoFrameOUTLocal collection video data. For details, see VideoFrame.

IThunderMediaExtraInfoObserver

IThunderMediaExtraInfoObserver::onSendMediaExtraInfoFailedStatus

virtual void Thunder::IThunderMediaExtraInfoObserver::onSendMediaExtraInfoFailedStatus(int status);

Callback on failure in sending media extra information.

Parameter
ParameterTypeDescription
statusOUTError code for failure. See ThunderSendMediaExtraInfoFailedStatus for details.

IThunderMediaExtraInfoObserver::onRecvMediaExtraInfo

virtual void Thunder::IThunderMediaExtraInfoObserver::onRecvMediaExtraInfo(const char* uid, const char* pData, int dataLen);

Callback on media extra information received.

Parameter
ParameterTypeDescription
uidOUTUser id
pDataOUTMedia extra information
dataLenOUTLength of media extra information

IThunderMediaExtraInfoObserver::onRecvMixAudioInfo

virtual bool Thunder::IThunderMediaExtraInfoObserver::onRecvMixAudioInfo(const char* uid, MixAudioInfoList& infos);

Callback on extra information of mixed audio streams received.

Parameter
ParameterTypeDescription
uidOUTUser id
infosOUTList of information about mixed audio stream

IThunderMediaExtraInfoObserver::onRecvMixVideoInfo

virtual bool Thunder::IThunderMediaExtraInfoObserver::onRecvMixVideoInfo(const char* uid, MixVideoInfoList& infos);

Callback on extra information of mixed video streams received.

Parameter
ParameterTypeDescription
uidOUTUser id
infosOUTList of information about mixed video streams

Enumeration & Structure

AudioVolumeInfo

#define MAX_THUNDER_UID_LEN 65 // UID length

struct AudioVolumeInfo
{
  char uid[MAX_THUNDER_UID_LEN]; // User id
  int volume; // Volume
};

Information about playing volume


AUTH_RESULT

enum Thunder::AUTH_RESULT

Authentication result

MemberDescrpition
AUTHRES_SUCCUSS(0)Authentication succeeded
AUTHRES_ERR_SERVER_INTERNAL(10000)Server internal error, try again
AUTHRES_ERR_NO_TOKEN(10001)token not carried. updateToken needs to be called.
AUTHRES_ERR_TOKEN_ERR(10002)Token authentication failed (incorrect digital signature), which may be caused by incorrect appSecret
AUTHRES_ERR_APPID(10003)appid in token is inconsistent with appid when execute authentication
AUTHRES_ERR_UID(10004)uid in token is inconsistent with uid when execute authentication
AUTHRES_ERR_TOKEN_EXPIRE(10005)token has expired
AUTHRES_ERR_NO_APP(10006)App does not exist, which is not registered in the management background
AUTHRES_ERR_TOKEN_WILL_EXPIRE(10007)token is about to expire. Callback is returned 30s in advance.
AUTHRES_ERR_NO_BAND(10008)The user is baned

USER_OFFLINE_REASON_TYPE

enum Thunder::USER_OFFLINE_REASON_TYPE

Causes for user going offline

MemberDescrpition
USER_OFFLINE_QUIT(1)The user is offline actively
USER_OFFLINE_DROPPED(2)The packet could not be received for long time, lost connection due to timeout. Note: Because SDK uses unreliable channel, the counterpart may leave our side actively. So it is misjudged as timeout offline
USER_OFFLINE_BECOME_AUDIENCE(3)User status is switched from anchor to audience (live mode)

NetworkQuality

enum Thunder::NetworkQuality

Network quality

MemberDescrpition
THUNDER_QUALITY_UNKNOWN(0)Unknown quality
THUNDER_QUALITY_EXCELLENT(1)Excellent network quality
THUNDER_QUALITY_GOOD(2)Good network quality
THUNDER_QUALITY_POOR(3)The network quality is poor, but the communication is not affected even the user can feel its defects.
THUNDER_QUALITY_BAD(4)The network quality is bad, and the communication can be barely made but is not smooth
THUNDER_QUALITY_VBAD(5)The network quality is very bad, the communication cannot be made basically
THUNDER_QUALITY_DOWN(6)Network disconnected and communication failed.

ThunderConnectionStatus

enum Thunder::ThunderConnectionStatus

Server connection status

MemberDescrpition
THUNDER_CONNECTION_STATUS_CONNECTING(0)Connecting
THUNDER_CONNECTION_STATUS_CONNECTED(1)Connected
THUNDER_CONNECTION_STATUS_DISCONNECTED(2)Disconnected

ThunderNetworkType

enum Thunder::ThunderConnectionStatus

Network type

MemberDescrpition
THUNDER_NETWORK_TYPE_UNKNOWN(0)Unknown network connection type
THUNDER_NETWORK_TYPE_DISCONNECTED(1)The network has been disconnected
THUNDER_NETWORK_TYPE_CABLE(2)Cable network
THUNDER_NETWORK_TYPE_WIFI(3)Wi-Fi (hotspot included)
THUNDER_NETWORK_TYPE_MOBILE(4)Mobile network. 2G, 3G and 4G network cannot be differentiated
THUNDER_NETWORK_TYPE_MOBILE_2G(5)2G mobile network
THUNDER_NETWORK_TYPE_MOBILE_3G(6)3G mobile network
THUNDER_NETWORK_TYPE_MOBILE_4G(7)4G mobile network

ThunderAudioDeviceStatus

enum Thunder::ThunderConnectionStatus

Audio device status

MemberDescrpition
THUNDER_AUDIO_DEVICE_STATUS_INIT_CAPTURE_SUCCESS(0)Callback on successful initialization of audio capture device
THUNDER_AUDIO_DEVICE_STATUS_INIT_CAPTURE_ERROR_OR_NO_PERMISSION(1)Callback on initialization failure of audio capture. It may be caused by no permission
THUNDER_AUDIO_DEVICE_STATUS_RELEASE_CAPTURE_SUCCESS(2)Callback on successful release of audio capture device

ThunderPublishCDNErrorCode

enum Thunder::ThunderPublishCDNErrorCode

Error codes for CDN stream publishing

MemberDescrpition
THUNDER_PUBLISH_CDN_ERR_SUCCESS(0)Stream publishing succeeded
THUNDER_PUBLISH_CDN_ERR_TOCDN_FAILED(1)Publishing stream to external server (CDN) is failed. 1. Check whether url is correct. 2. Check whether the token in the URL is valid (generally, token is required during cdn stream publishing and can be ignored if it doe not exist).
THUNDER_PUBLISH_CDN_ERR_THUNDERSERVER_FAILED(2)Publish the stream to thunder internal server is failed. 1. Check the anchor uplink network. 2. Contact us to locate internal transmission faults.
THUNDER_PUBLISH_CDN_ERR_THUNDERSERVER_STOP(3)Stop stream publishing

RoomStats

struct Thunder::RoomStats
{
  int totalDuration; // Total call duration, unit: second
  int txBitrate; // Chain sending bit rate (unit: bps)
  int rxBitrate; // Chain receiving bit rate (unit: bps)
  int txBytes; // Total sent bytes
  int rxBytes; // Total received bytes
  int txAudioBytes; // Total sent audio bytes
  int rxAudioBytes; // Total received audio bytes
  int txVideoBytes; // Total sent video bytes
  int rxVideoBytes; // Total received video bytes
  int txAudioBitrate; // Audio packet sending bit rate (unit: bps)
  int rxAudioBitrate; // Audio packet receiving bit rate (unit: bps)
  int txVideoBitrate; // Video packet sending bit rate (unit: bps)
  int rxVideoBitrate; // Video packet receiving bit rate (unit: bps)
  int lastmileDelay;  // Local client-to-edge server delay (unit: milliseconds)
};

Information about uplink and downlink traffic in the room


ThunderSendAppMsgDataFailedStatus

enum Thunder::ThunderSendAppMsgDataFailedStatus

Causes for failure in sending user-defined messages

MemberDescrpition
THUNDER_SEND_APP_DATA_HIGHT_FREQUENCY(1)Excessively high sending frequency. Fewer than twice each second is recommended.
THUNDER_SEND_APP_DATA_LARGE_MSG_DATA(2)Excessively large size of sent data each time. It is recommended that data sent each time does not exceed 200 bytes.
THUNDER_SEND_APP_DATA_NO_PUBLISH_SUCCESS(3)Publishing failed

ThunderCaptureStatus

enum Thunder::ThunderCaptureStatus

Camera collection status

MemberDescrpition
THUNDER_VIDEO_CAPTURE_STATUS_SUCCESS(0)Succeeded
THUNDER_VIDEO_CAPTURE_STATUS_AUTHORIZED(1)Permission not granted to users yet (not supported on PCs temporarily)
THUNDER_VIDEO_CAPTURE_STATUS_NOT_DETERMINED(2)Permission not granted yet (not supported on PCs temporarily)
THUNDER_VIDEO_CAPTURE_STATUS_RESTRICTED(3)Occupied
THUNDER_VIDEO_CAPTURE_STATUS_DENIED(4)No permission
THUNDER_VIDEO_CAPTURE_STATUS_DENIED(5)Close
THUNDER_VIDEO_CAPTURE_STATUS_LOST(6)The device is removed.
THUNDER_VIDEO_CAPTURE_STATUS_RESUME(7)The device is removed and inserted again.

QUALITY_ADAPT_INDICATION

enum Thunder::QUALITY_ADAPT_INDICATION

Adaption of video quality

MemberDescrpition
ADAPT_NONE(0)The quality of local video is constant
ADAPT_UP_BANDWIDTH(1)The quality of local video has been improved because of higher network bandwidth
ADAPT_DOWN_BANDWIDTH(2)The quality of local video becomes worse because of lower network bandwidth

VIDEO_CODEC_TYPE

enum Thunder::QUALITY_ADAPT_INDICATION

Video encoding type

MemberDescrpition
VIDEO_CODEC_UNKNOW(0)Unknown type
VIDEO_CODEC_VP8(1)Standard VP8
VIDEO_CODEC_H264(2)Standard H264
VIDEO_CODEC_H265(3)Standard H265
VIDEO_CODEC_EVP(4)Enhanced VP8
VIDEO_CODEC_E264(5)Enhanced H264

VIDEO_ENCODED_TYPE

enum Thunder::VIDEO_ENCODED_TYPE

Video coding mode.

MemberDescription
VIDEO_ENCODED_TYPE_UNKNOWN(0)Unknown type
VIDEO_ENCODED_TYPE_HARD(1)Hard-coding
VIDEO_ENCODED_TYPE_SOFT(2)Soft-coding

LocalVideoStats

struct Thunder::LocalVideoStats
{
  int sendBitrate;// Actual sending bit rate (unit: Kbps), with the exception of sending bit rate of reloaded videos after packet loss
  int sendFrameRate;// Actual sending frame rate (unit: fps), with the exception of sending frame rate of reloaded videos after packet loss
  int encoderOutputFrameRate;// Output frame rate of local encoder (unit: fps)
  int rendererOutputFrameRate;// Output frame rate of local preview (unit: fps)
  int targetBitrate;// Target encoding bit rate of current encoder (unit: Kbps). This bit rate is a value estimated by this SDK in accordance with current network status.
  int targetFrameRate;// Target encoding frame rate of current encoder (unit: fps). This frame rate is a value estimated by this SDK in accordance with current network status.
  QUALITY_ADAPT_INDICATION qualityAdaptIndication;//Quality adaptability of local videos since last statistics (based on target frame rate and target bit rate)
  int encodedBitrate;//Bit rate of video encoding (Kbps). This parameter includes no encoding bit rate of reloaded videos after packet loss.
  int encodedFrameWidth;// Encoded video width (px)
  int encodedFrameHeight;// Encoded video height (px)
  int encodedFrameCount;// Number of frames sent by video, an accumulated value
  VIDEO_ENCODED_TYPE encodedType;// Encoding mode
  VIDEO_CODEC_TYPE codecType;// Encoding type of videos
  int configBitRate;//Configured bit rate (kbps)
  int configFrameRate;// Configured frame rate
  int configWidth;// Configured encoding width
  int configHeight;// Configured encoding height
};

Statistics on video streams sent from the local device, among which:


LocalAudioStats

struct LocalAudioStats
{
  int encodeBitrate; // Code rate (unit: kbps) 
  int numChannels;    // Number of channels
  int sendSampleRate; // Sampling rate sent (unit: Hz)
  int sendBitrate;    // Average value of bit rate of sent data (unit: Kbps)
  int enableVad; // Whether to enable VAD when sending audios: 0-disable, 1-enable
};

Statistics on audio streams sent from the local device


REMOTE_VIDEO_STREAM_TYPE

enum Thunder::REMOTE_VIDEO_STREAM_TYPE

High/Low stream type

MemberDescrpition
REMOTE_VIDEO_STREAM_HIGH(0)High stream
REMOTE_VIDEO_STREAM_LOW(1)Low stream

RemoteVideoStats

struct RemoteVideoStats
{
  int delay; // Delay from publishing remote video stream to playback
  int width; // Width of remote video stream
  int height; // Height of remote video stream
  int receivedBitrate; // Receiving bit rate (unit: Kbps)
  int decoderOutputFrameRate; // Output frame rate of remote video decoder (unit: fps)
  int rendererOutputFrameRate; // Output frame rate of remote video renderer (unit: fps)
  int packetLossRate; // Packet loss rate (%) of remote video after network confrontation
  REMOTE_VIDEO_STREAM_TYPE rxStreamType; // Types of video stream, including large stream and small stream
  int totalFrozenTime; // The accumulated time (ms) from the time when a remote user joins a channel to the time of video freezing
  int frozenRate; // The percentage (%) of the accumulated time (from the time when a remote user joins a channel to the time of video freezing) accounting for total effective time of videos
};

Status of end-to-end video streams of remote users in a call. Among which:


RemoteAudioStats

struct RemoteAudioStats
{
    int quality;// Quality of audio streams sent by remote users. 0: Unknown; 1: Excellent; 2: Good; 3: Poor, flawed but does not affect communication; 4: Bad, communication can be made but not smoothly; 5: Very Bad, communication can barely be made; 6: Disconnected, communication can not be made at all 
    int networkTransportDelay;// Network delay from an audio sending end to an audio receiving end
    int jitterBufferDelay;// Delay from a receiving end to network jitter buffer
	int totalDelay;// Total delay from capturing the host audio to audience playing the audio, unit: millisecond
    int frameLossRate;// Frame loss rate (%) of remote audio streams
    int numChannels;// Number of channels
    int receivedSampleRate;// Sampling rate (Hz) of remote audios
    int receivedBitrate;// Average bit rate of remote audios within a statistical period
    int totalFrozenTime;// The accumulated time (ms) from the time when a remote user joins a channel to the time of audio freezing
    int frozenRate;// The percentage (%) of the accumulated time (from the time when a remote user joins a channel to the time of audio freezing) accounting for total effective time of audios
};

Status of end-to-end audio streams of remote users in a call.


AUDIO_FRAME_TYPE

enum IAudioFrameObserver::AUDIO_FRAME_TYPE

Audio frame type

MemberDescrpition
FRAME_TYPE_PCM16(0)PCM 16bit little endian

AudioFrame

struct IAudioFrameObserver::AudioFrame
{
  AUDIO_FRAME_TYPE type;
  int samples; // Sample quantity of the frame
  int bytesPerSample; // Bytes per sample: PCM (16 digits) contains two types
  int channels; // Number of channels (crossed data for stereo); 1: single track, 2: dual track
  int samplesPerSec; // Sampling rate
  void* buffer; // data buffer
  long long renderTimeMs; // Not used momentarily
  int avsync_type; // Not used momentarily
};

Detailed information about audio data. For details about audio frame type, see AUDIO_FRAME_TYPE.


VIDEO_FRAME_TYPE

enum Thunder::VIDEO_FRAME_TYPE

Video frame type

MemberDescrpition
FRAME_TYPE_YUV420(0)YUV420
FRAME_TYPE_BGRA(1)BGRA

VideoFrame

#define MAX_THUNDER_VIDEO_BUFFER_PLANE 8 // Maximum plane number of video frames (I420: 3, RGB: 1)

struct VideoFrame
{
  void* dataPtr[MAX_THUNDER_VIDEO_BUFFER_PLANE]; // Pointer to each plane data in video frame
  int dataLength[MAX_THUNDER_VIDEO_BUFFER_PLANE]; // Length of each plane data in video frame
  int dataStride[MAX_THUNDER_VIDEO_BUFFER_PLANE]; // Step size of each plane data in video frame
  int width; // Width of video frame
  int height; // Width and height of video frame
  VIDEO_FRAME_TYPE type; // Type of video frame
  int rotation; // Rotation angle
  __int64 timeStamp; // Presentation timestamp
};

Detailed information about video data. For details about video frame type, see VIDEO_FRAME_TYPE.


ThunderSendMediaExtraInfoFailedStatus

enum IThunderMediaExtraInfoObserver::ThunderSendMediaExtraInfoFailedStatus

Causes for failure in sending media extra information.

MemberDescrpition
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_DATA_EMPTY(1)Extra information is null.
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_DATA_TOO_LARGE(2)Excessively large size of sent data each time
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_FREQUENCY_TOO_HIGHT(3)Excessively high sending frequency
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_NOT_IN_ANCHOR_SYSTEM(4)Not an anchor system
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_NO_JOIN_MEDIA(5)Channel not to be joined
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_NO_PUBLISH_SUCCESS(6)Publishing failed

MixAudioInfo

  struct MixAudioInfo // Information about mixed audio stream
  {
    char uid[MAX_THUNDER_UID_LEN]; // User id
    int volume;    // Volume of mixed audio stream [0,100]
  };

Information about mixed audio stream


MixAudioInfoList

  struct MixAudioInfoList // List of information about mixed audio stream
  {
    int count; // Number of lists of information about mixed audio stream
    MixAudioInfo mixAudio[MAX_THUNDER_MIX_AUDIO_COUNT]; // Specific information about mixed audio stream
  };

List of information about mixed audio stream


MixVideoInfo

  struct MixVideoInfo
  {
    char uid[MAX_THUNDER_UID_LEN]; // User id
    int width; // Original width of this user's video
    int height; // Original height of this user's video
    int cropX; // X coordinate of the begin point used to crop the original video in video mixing
    int cropY; // Y coordinate of the begin point used to crop the original video in video mixing
    int cropW; // Width of the original video to be cropped in video mixing
    int cropH; // Height of the original video to be cropped in video mixing
    int layoutX; // X coordinate of the begin point of this user's video in video mixing canvas
    int layoutY; // Y coordinate of the begin point of this user's video in video mixing canvas
    int layoutW; // Width of this user's video in video mixing canvas
    int layoutH; // Height of this user's video in video mixing canvas
    int zOrder; // Layer number of this user's video frame in video mixing. The value range is the integer in [0, 100], and the minimum value is 0, indicating that the image in this region is at the lowest level
    float alpha; // Transparency of this user's video frame in video mixing.
                 // The value range is [0.0, 1.0]. 0.0 indicates that the image in this region is completely transparent, while 1.0 indicates completely opaque
  };

Information about mixed video streams


MixVideoInfoList

  struct MixVideoInfoList // List of information about mixed video streams
  {
    int count; // Number of lists of information about mixed video stream
    MixVideoInfo mixVideo[MAX_THUNDER_MIX_VIDEO_COUNT]; // Specific information about mixed video stream
  };

List of information about mixed video streams


ThunderAudioFilePlayerEvent

enum Thunder::ThunderAudioFilePlayerEvent

Local file playback status.

MemberDescription
AUDIO_PLAY_EVENT_OPEN(1)Open file
AUDIO_PLAY_EVENT_PLAY(2)Start playback
AUDIO_PLAY_EVENT_STOP(3)Stop playback
AUDIO_PLAY_EVENT_PAUSE(4)Pause
AUDIO_PLAY_EVENT_RESUME(5)Resume playback
AUDIO_PLAY_EVENT_END(6)Playback finished
AUDIO_PLAY_EVENT_SEEK_COMPLETE(7)Speed playback

ThunderAudioFilePLayerErrorCode

enum Thunder::ThunderAudioFilePLayerErrorCode

Error codes of local file playback.

MemberDescription
AUDIO_PLAYER_OPEN_FILE_PATH_ERROR(-4)Incorrect file path
AUDIO_PLAYER_OPEN_FILE_FORMAT_NOT_SUPPORT(-3)Incorrect file format
AUDIO_PLAYER_OPEN_FILE_DECODER_FAILED(-2)Decoding file format failed
AUDIO_PLAYER_CREATE_FILE_DECODER_FAILED(-1)Parsing file format failed
AUDIO_PLAYER_STATUS_SUCCESS(0)Succeeded

LOCAL_AUDIO_STREAM_STATUS

enum Thunder::LOCAL_AUDIO_STREAM_STATUS

Local audios stream status

MemberDescription
THUNDER_LOCAL_AUDIO_STREAM_STATUS_STOPPED(0)Default initialization status
THUNDER_LOCAL_AUDIO_STREAM_STATUS_CAPTURING(1)Enabling the recording device succeeded
THUNDER_LOCAL_AUDIO_STREAM_STATUS_ENCODING(2)Coding the first frame of local audios succeeded
THUNDER_LOCAL_AUDIO_STREAM_STATUS_SENDING(3)Sending the first frame of local audios succeeded
THUNDER_LOCAL_AUDIO_STREAM_STATUS_FAILED(4)Enabling local audios failed

LOCAL_AUDIO_STREAM_ERROR_REASON

enum Thunder::LOCAL_AUDIO_STREAM_ERROR_REASON

Cuase of local audios change

MemberDescription
THUNDER_LOCAL_AUDIO_STREAM_ERROR_OK(0)Normal
THUNDER_LOCAL_AUDIO_STREAM_ERROR_UNKOWN(1)Unknown reason
THUNDER_LOCAL_AUDIO_STREAM_ERROR_CAPTURE_FAILURE(2)Capturing local audios failed
THUNDER_LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE(3)Coding local audios failed

LOCAL_VIDEO_STREAM_STATUS

enum Thunder::LOCAL_VIDEO_STREAM_STATUS

Local video stream status

MemberDescription
THUNDER_LOCAL_VIDEO_STREAM_STATUS_STOPPED(0)Default initialization status
THUNDER_LOCAL_VIDEO_STREAM_STATUS_CAPTURING(1)Enabling the recording device succeeded
THUNDER_LOCAL_VIDEO_STREAM_STATUS_PREVIEWING(2)Previewing local video succeeded
THUNDER_LOCAL_VIDEO_STREAM_STATUS_ENCODING(3)Coding the first frame of local videos succeeded
THUNDER_LOCAL_VIDEO_STREAM_STATUS_SENDING(4)Sending the first frame of local videos succeeded
THUNDER_LOCAL_VIDEO_STREAM_STATUS_FAILED(5)Enabling local videos failed

LOCAL_VIDEO_STREAM_ERROR_REASON

enum Thunder::LOCAL_VIDEO_STREAM_ERROR_REASON

Cause of local video acquisition failure.

MemberDescription
THUNDER_LOCAL_VIDEO_STREAM_ERROR_OK(0)Normal
THUNDER_LOCAL_VIDEO_STREAM_ERROR_FAILURE(1)Unknown error
THUNDER_LOCAL_VIDEO_STREAM_ERROR_DEVICE_DENIED(2)No permission to enable the capture device
THUNDER_LOCAL_VIDEO_STREAM_ERROR_DEVICE_RESTRICTED(3)The capture device is in use
THUNDER_LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE(4)Capturing local videos failed. Please whether the capture device is working properly
THUNDER_LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE(5)Coding failure of local video

REMOTE_AUDIO_STATE

enum Thunder::REMOTE_AUDIO_STATE

Remote audio stream status.

MemberDescription
THUNDER_REMOTE_AUDIO_STATE_STOPPED(0)Default initialization sataus, which may be reported under the conditions of THUNDER_REMOTE_AUDIO_REASON_LOCAL_STOPPED(4) or THUNDER_REMOTE_AUDIO_REASON_REMOTE_STOPPED(6)
THUNDER_REMOTE_AUDIO_STATE_STARTING(1)The local user has accepted the first package of remote audio stream
THUNDER_REMOTE_AUDIO_STATE_DECODING(2)Decoding, playback normal
THUNDER_REMOTE_AUDIO_STATE_FROZEN(3)The reomte audio is freezing, which will be reported under the condition of THUNDER_REMOTE_AUDIO_REASON_NETWORK_CONGESTION(2)

REMOTE_AUDIO_REASON

enum Thunder::REMOTE_AUDIO_REASON

Cause of remote video stream status change.

MemberDescription
THUNDER_REMOTE_AUDIO_REASON_OK(0)Normal
THUNDER_REMOTE_AUDIO_REASON_INTERNAL(1)Internal reason
THUNDER_REMOTE_AUDIO_REASON_NETWORK_CONGESTION(2)Network blocked
THUNDER_REMOTE_AUDIO_REASON_NETWORK_RECOVERY(3)Network back to normal
THUNDER_REMOTE_AUDIO_REASON_LOCAL_STOPPED(4)The local user stops receiving reomte audios or disables the audio module
THUNDER_REMOTE_AUDIO_REASON_LOCAL_STARTED(5)The local user resumes receiving the remote audio stream or enables the audio module
THUNDER_REMOTE_AUDIO_REASON_REMOTE_STOPPED(6)The remote user stops sending the audio stream or disables the audio module
THUNDER_REMOTE_AUDIO_REASON_REMOTE_STARTED(7)The remote user resumes sending the remote audio stream or enables the audio module

REMOTE_VIDEO_STATE

enum Thunder::REMOTE_VIDEO_STATE

Remote video stream status.

MemberDescription
THUNDER_REMOTE_VIDEO_STATE_STOPPED(0)Default initialization status, which will be reported under the conditions of THUNDER_REMOTE_VIDEO_REASON_LOCAL_STOPPED(4) or THUNDER_REMOTE_VIDEO_REASON_REMOTE_STOPPED(6)
THUNDER_REMOTE_VIDEO_STATE_STARTING(1)The local user has accepted the first package of the reomte video
THUNDER_REMOTE_VIDEO_STATE_DECODING(2)The remote video is being decoded
THUNDER_REMOTE_VIDEO_STATE_RENDERING(3)The remote video is being renderred
THUNDER_REMOTE_VIDEO_STATE_FROZEN(4)Remote video is freezing, which will be reported under the conditions of THUNDER_REMOTE_VIDEO_REASON_NETWORK_CONGESTION(2)

REMOTE_VIDEO_REASON

enum Thunder::REMOTE_VIDEO_REASON

Cause of remote audio stream status change.

MemberDescription
THUNDER_REMOTE_VIDEO_REASON_OK(0)Normal
THUNDER_REMOTE_VIDEO_REASON_INTERNAL(1)Internal reason
THUNDER_REMOTE_VIDEO_REASON_NETWORK_CONGESTION(2)Network blocked
THUNDER_REMOTE_VIDEO_REASON_NETWORK_RECOVERY(3)Network back to normal
THUNDER_REMOTE_VIDEO_REASON_LOCAL_STOPPED(4)The local user stops receiving reomte audios or disables the audio module
THUNDER_REMOTE_VIDEO_REASON_LOCAL_STARTED(5)The local user resumes receiving the remote audio stream or enables the audio module
THUNDER_REMOTE_VIDEO_REASON_REMOTE_STOPPED(6)The remote user stops sending the audio stream or disables the audio module
THUNDER_REMOTE_VIDEO_REASON_REMOTE_STARTED(7)The remote user resumes sending the remote audio stream or enables the audio module

MEDIA_DEVICE_TYPE

enum Thunder::MEDIA_DEVICE_TYPE

Media device type.

MemberDescription
UNKNOWN_AUDIO_DEVICE(-1)Unknown device
AUDIO_PLAYOUT_DEVICE(0)Audio player
AUDIO_RECORDING_DEVICE(1)Audio recoring device
VIDEO_RENDER_DEVICE(2)Video rendering device
VIDEO_CAPTURE_DEVICE(3)Video capture device
AUDIO_APPLICATION_PLAYOUT_DEVICE(4)Audio player application

MEDIA_DEVICE_STATE_TYPE

enum Thunder::MEDIA_DEVICE_STATE_TYPE

Media device status.

MemberDescription
MEDIA_DEVICE_STATE_ACTIVE(1)The device is available
MEDIA_DEVICE_STATE_DISABLED(2)The device is not available
MEDIA_DEVICE_STATE_NOT_PRESENT(4)The device does not exist
MEDIA_DEVICE_STATE_UNPLUGGED(8)The device is unplugged

ThunderWaringCode

enum Thunder::ThunderWaringCode

Warning code

Enumeration ValueDescription
THUNDER_PACK_AUDIO_WARING(3001)The capture volume of the audio capture device is too low

DeviceStats

CPU/memory usage status

struct Thunder::DeviceStats
{
  double cpuTotalUsage; // Current system CPU usage (%)
  double cpuAppUsage; // CPU usage of the current application (%)
  double memoryAppUsage; // Memory usage of the current application (%)
  double memoryTotalUsage; // Current system memory usage (%)
};

Was this page helpful?

Helpful Not helpful
Submitted! Your feedback would help us improve the website.
Feedback
Top