Public Callback Function | Function Name |
---|---|
void | onError(int error) |
void | onJoinRoomSuccess(String room, String uid, int elapsed) |
void | onLeaveRoom(ThunderEventHandler.RoomStats status) |
void | onBizAuthResult(boolean bPublish, int result) |
void | onSdkAuthResult(int result) |
void | onUserBanned(boolean status) |
void | onTokenWillExpire(byte[] token) |
void | onTokenRequested() |
void | onNetworkQuality(String uid, int txQuality, int rxQuality) |
void | onRoomStats(ThunderNotification.RoomStats stats) |
void | onPlayVolumeIndication(ThunderEventHandler.AudioVolumeInfo[] speakers, int totalVolume) |
void | onCaptureVolumeIndication(int totalVolume, int cpt, int micVolume) |
void | onConnectionLost() |
void | onAudioPlaySpectrumData(byte[] data) |
void | onRecvUserAppMsgData(byte[] data, String uid) |
void | onSendAppMsgDataFailedStatus(int status) |
void | onRemoteAudioStopped(String uid, boolean stop) |
void | onRemoteVideoStopped(String uid, boolean stop) |
void | onRemoteVideoPlay(String uid, int width, int height, int elapsed) |
void | onVideoSizeChanged(String uid, int width, int height, int rotation) |
void | onFirstLocalAudioFrameSent(int elapsed) |
void | onFirstLocalVideoFrameSent(int elapsed) |
void | onPublishStreamToCDNStatus(String url, int errorCode) |
void | onNetworkTypeChanged(int type) |
void | onConnectionStatus(int status) |
void | onAudioCaptureStatus(int status) |
void | onVideoCaptureStatus(int status) |
void | onLocalVideoStats(ThunderEventHandler.LocalVideoStats stats) |
void | onLocalAudioStats(ThunderEventHandler.LocalAudioStats stats) |
void | onRemoteVideoStatsOfUid(String uid, ThunderEventHandler.RemoteVideoStats stats) |
void | onRemoteAudioStatsOfUid(String uid, ThunderEventHandler.RemoteAudioStats stats) |
void | onRemoteAudioPlay(String uid, int elapsed) |
void | onLocalVideoStatusChanged(int status, int errorReason) |
void | onLocalAudioStatusChanged(int status, int errorReason) |
void | onRemoteVideoStateChangedOfUid(String uid, int state, int reason, int elapsed) |
void | onRemoteAudioStateChangedOfUid(String uid, int state, int reason, int elapsed) |
void | onDeviceStats(ThunderEventHandler.DeviceStats stats) |
void | onAudioRouteChanged(int routing) |
void | onHowlingDetectResult(boolean bHowling) |
void | onEchoDetectResult(boolean bEcho) |
Public Callback Function | Function Name |
---|---|
boolean | onRecordAudioFrame(ByteBuffer samples, int numOfSamples, int bytesPerSample, int channels, int samplesPerSec) |
boolean | onPlaybackAudioFrame(ByteBuffer samples, int numOfSamples, int bytesPerSample, int channels, int samplesPerSec) |
boolean | onPlaybackAudioFrameBeforeMixing(String uid, ByteBuffer samples, int numOfSamples, int bytesPerSample, int channels, int samplesPerSec) |
boolean | onMixedAudioFrame(ByteBuffer samples, int numOfSamples, int bytesPerSample, int channels, int samplesPerSec, long timeStamp) |
Public Callback Function | Function Name |
---|---|
void | onInit(int textureTarget, int outputWidth, int outputHeight) |
void | onDestroy() |
void | onDraw(final int textureId, final FloatBuffer cubeBuffer,final FloatBuffer textureBuffer, float[] texMatrix) |
void | onOutputSizeChanged(final int width, final int height) |
Public callback function | Function Name |
---|---|
void | onCaptureVideoFrame(int width, int height, byte[] data, int length, int imageFormat) |
Public Callback Function | Function Name |
---|---|
void | onVideoDecodeFrame(String uid, int w, int h, byte[] data, int dateLen, long renderTimeMs) |
Public Callback Function | Function Name |
---|---|
boolean | onInitialize(ThunderVideoFrameConsumer consumer) |
boolean | onStart |
boolean | onStop |
boolean | onDispose |
Public Callback Function | Function Name |
---|---|
void | consumeByteArrayFrame(byte[] data, int format, int width, int height, int rotation, long timestamp) |
void | consumeTextureFrame(int textureID, int textureFormat, int width, int height, int rotation, long timeStamp,float[] transform) |
Public Callback Function | Function Name |
---|---|
void | onThunderLogWithLevel(int level, String tag, String msg) |
Public Callback Function | Function Name |
---|---|
void | onSendMediaExtraInfoFailedStatus(int status) |
void | onRecvMediaExtraInfo(int status) |
void | onRecvMixAudioInfo(int status) |
void | onRecvMixVideoInfo(int status) |
Note:
This callback class is deprecated from V2.7.0, you can call IThunderAudioFilePlayerEventCallback.
Public Callback Function | Function Name |
---|---|
void | onAudioFilePlayError(int errorCode) |
void | onAudioFileVolume(long volume, long currentMs, long totalMs) |
void | onAudioFileSeekComplete(int millisecond) |
void | onAudioFilePlaying() |
void | onAudioFilePause() |
void | onAudioFileResume() |
void | onAudioFileStop() |
void | onAudioFilePlayEnd() |
Public Callback Function | Function Name |
---|---|
void | onAudioFileVolume(long volume, long currentMs, long totalMs) |
void | onAudioFileStateChange(int event, int errorCode) |
public void onError(int error)
Report the SDK error message.
Parameter | Description |
---|---|
error | Error message code |
public void onJoinRoomSuccess(String room, String uid, int elapsed)
Report the user of uid joining room successfully.
After calling ThunderEngine.joinRoom, receiving such a notification indicates that connection with server is normal, and the interface that can only be called after joining room successfully may be called.
Parameter | Description |
---|---|
room | Room No. |
uid | User ID |
elapsed | Time elapsed from the user calling ThunderEngine.joinRoom until this callback is triggered, unit: ms |
public void onLeaveRoom(ThunderEventHandler.RoomStats status)
Called when a user exits a room.
After calling ThunderEngine.leaveRoom, this callback will be received when leaving room normally.
Parameter | Description |
---|---|
RoomStats | Reserved parameters. See details in ThunderEventHandler.RoomStats |
public void onBizAuthResult(boolean bPublish, int result)
Report business authentication results.
Results of service authentication. Jocloud forwards authentication requests to business authentication server, and returns authentication results to developer through this interface.
Parameter | Description |
---|---|
bPublish | true: publishing authentication false: playing authentication |
result | Authentication results 0: pass Other values: fail. Subject to developer customization. SDK simply passes-through |
public void onSdkAuthResult(int result)
Report SDK authentication results.
Results of SDK authentication. After calling ThunderEngine.joinRoom, once uplink/downlink media data is available, the authentication results of SDK will be reported.
Parameter | Description |
---|---|
result | Authentication results. For detailed meaning of the values, refer to ThunderRtcConstant.AuthResult |
public void onUserBanned(boolean status)
Notification of user banned.
This callback notification will be received when user banning status changes
Parameter | Description |
---|---|
status | Banning status: true: banned false: unbanned |
public void onUserJoined(String uid, int elapsed)
Note:
- This callback is deprecated from V2.8.0.
Called when a remote user/anchor joining a room (valid for audio-only mode only).
This callback will be triggered in the following circumstances
Parameter | Description |
---|---|
uid | ID of remote user/anchor who joined room recently |
elapsed | Delay (in millisecond) from local user calling ThunderEngine.joinRoom to triggering callback |
public void onUserOffline(String uid, int reason)
Note:
- This callback is deprecated from V2.8.0.
Called when a remote user/anchor exiting a room (valid for audio-only mode only).
It prompts that a remote user/anchor has left the room (or is offline). There are two reasons that user leaves a room, regular leave or timeout.
Parameter | Description |
---|---|
uid | ID of the user or host who exitss the room |
reason | The offline reason, see details in ThunderRtcConstant.UserOfflineReason |
public void onTokenWillExpire(byte[] token)
Called when the token expires in 30 seconds.
Parameter | Description |
---|---|
token | Expiring token |
public void onTokenRequested()
Called when the token expires.
public void onNetworkQuality(String uid, int txQuality, int rxQuality)
Report the uplink and downlink network quality of each user.
Parameter | Description |
---|---|
uid | For each callback, network quality of user corresponding to the uid is reported. If uid is 0, network quality of local user is reported |
txQuality | Network uplink quality, refer to ThunderRtcConstant.NetworkQuality |
rxQuality | Network downlink quality, refer to ThunderRtcConstant.NetworkQuality |
public void onRoomStats(ThunderNotification.RoomStats stats)
Notification for uplink/downlink traffic (periodic notification sent once every 2 seconds). After joining room ThunderEngine.joinRoom, user will receive this callback.
Parameter | Description |
---|---|
stats | Upstream and downstream traffic data of the room, see ThunderNotification.RoomStats class for details |
public void onPlayVolumeIndication(ThunderEventHandler.AudioVolumeInfo[] speakers, int totalVolume)
Report which users are speaking and the speakers' volume, and whether the local user is speaking.
Once ThunderEngine.setAudioVolumeIndication is enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not.
Parameter | Description |
---|---|
speakers | Audio volume information array. Each speaker includes: uid: speaker's uid. volume: speaker's volume. pts: capture timestamp, refer to ThunderEventHandler.AudioVolumeInfo for detail |
totalVolume | Total volume after audio mixing, range: [0-100] |
public void onCaptureVolumeIndication(int totalVolume, int cpt, int micVolume)
Report the cpature volume
This callback will be received after calling ThunderEngine.enableCaptureVolumeIndication is enabled.
Parameter | Description |
---|---|
totalVolume | Total volume of capture (including microphone capture and file playback) [0-100] |
cpt | The timestamp of microphone capture (ms) |
micVolume | The volume of microphone capture only , range: [0-100] |
public void onConnectionLost(){}
Called when the SDK cannot reconnect to Jocloud server 10 seconds after its connection to the server is interrupted.
After calling joinRoom, the SDK triggers this callback when it cannot connect to the server 10 seconds regardless of whether it is in the room or not. Before calling leaveRoom, SDK will be automatically reconnect to the room.
public void onAudioPlaySpectrumData(byte[] data)
Report the audio playback spectrum data.
This callback will be received after calling ThunderEngine.enableAudioPlaySpectrum is enabled.
Parameter | Description |
---|---|
Date | Audio spectrum data |
public void onRecvUserAppMsgData(byte[] data, String uid)
Callback when received developer's custom broadcast messages.
Parameter | Description |
---|---|
Date | Pass-through message received |
uid | uid of user who sends the message |
public void onSendAppMsgDataFailedStatus(int status)
Callback when failure in sending deveploper's custom broadcast messages.
Parameter | Description |
---|---|
status | Failure status 1: Frequency is too high 2: Data sent is too large 3: Publishing is not started successfully |
public void onRemoteAudioStopped(String uid, boolean stop)
Callback when the remote user's audio stream starts or stops.
After calling ThunderEngine.joinRoom, this callback will be received when there are changes in existing audio streams in the room and subsequent audio stream status.
Parameter | Description |
---|---|
uid | uid of remote user |
Stop | true: Remote user audio stream has stopped false: Remote user audio stream has started |
public void onRemoteVideoStopped(String uid, boolean stop)
Callback when the remote user's video stream starts or stops.
After calling ThunderEngine.joinRoom, this callback will be received when there are changes in existing video streams in the room and subsequent video stream status.
Parameter | Description |
---|---|
uid | uid of remote user |
Stop | true: Remote user video stream has stopped false: Remote user video stream has started |
public void onRemoteVideoPlay(String uid, int width, int height, int elapsed)
Callback when displaying the first frame of remote video.
After calling ThunderEngine.setRemoteVideoCanvas, this callback will be received when remote video stream is received and the first frame is displayed
Parameter | Description |
---|---|
uid | uid of remote user |
width | Remote video resolution width |
height | Remote video resolution height |
elapsed | Time elapsed (ms) from calling ThunderEngine.joinRoom to calling back the event |
public void onVideoSizeChanged(String uid, int width, int height, int rotation)
Callback of remote video (host video) resolution change.
After calling ThunderEngine.joinRoom, this callback will be received when the resolution of local or remote video changes.
Parameter | Description |
---|---|
uid | User id. uid is 0 when callback is received by user as an anchor; uid is anchor uid when callback is received by user a viewer |
width | Remote video resolution width after change. |
height | Remote video resolution height after change. |
rotation | Reserved. |
public void onFirstLocalAudioFrameSent(int elapsed)
Callback when first local audio frame sent successfully. (As an anchor, this callback is received after the first audio frame is successfully uploaded)
Parameter | Description |
---|---|
elapsed | Time elapsed (in milliseconds) from local user calling ThunderEngine.joinRoom to triggering this callback |
public void onFirstLocalVideoFrameSent(int elapsed)
Callback when first local video frame sent successfully. (As an anchor, this callback is received after the first video frame is successfully uploaded)
Parameter | Description |
---|---|
elapsed | Time elapsed (in milliseconds) from local user calling ThunderEngine.joinRoom to triggering this callback |
public void onPublishStreamToCDNStatus(String url, int errorCode)
Report the result of pushing stream to the CDN. This callback will be triggered when stream pushing status changes.
This callback will be received after user calling ThunderEngine.addPublishOriginStreamUrl or ThunderEngine.addPublishTranscodingStreamUrl to pushing stream.
Parameter | Description |
---|---|
url | The URL to which the stream will be pushed |
errorCode | The status code of stream pushing results, referring to ThunderRtcConstant.ThunderPublishCDNErrorCode |
public void onNetworkTypeChanged(int type)
Callback when the network type changes.
After creating and initializing engine, this callback will be received when network type changes.
Parameter | Description |
---|---|
type | Network type, referring to ThunderRtcConstant.ThunderNetworkType |
public void onConnectionStatus(int status)
Report the connection status with the server.
After calling ThunderEngine.joinRoom, this callback will be received when network connection status between SDK and server (service and avp) changes.
Parameter | Description |
---|---|
status | The connection status code with server, refer to ThunderRtcConstant.ThunderConnectionStatus |
public void onAudioCaptureStatus(int status)
Callback when the audio device capture status changes.
Start audio capture. This callback will be received in case of changes in audio device capture status.
Parameter | Description |
---|---|
status | The audio device capture status, refer to ThunderRtcConstant.ThunderAudioDeviceStatus |
public void onVideoCaptureStatus(int status)
Callback when the video device capture status changes.
Start camera capture. This callback will be received when there are changes in camera device capture status.
Parameter | Description |
---|---|
status | The video device (camera) capture status, refer to ThunderRtcConstant.ThunderVideoCaptureStatus |
public void onLocalVideoStats(ThunderEventHandler.LocalVideoStats stats)
Report statistics of local video streams.
This callback describes statistics of video streams sent locally. Callback timing is as follows:
Parameter | Description |
---|---|
stats | The statistics of local video, refer to ThunderEventHandler.LocalVideoStats |
public void onLocalAudioStats(ThunderEventHandler.LocalAudioStats stats)
Report the statistics of the local audio stream.
This callback describes statistics of audio streams sent locally. Callback timing: periodic callback at an interval of 2s
Parameter | Description |
---|---|
stats | The statistics of local audio , refer to ThunderEventHandler.LocalAudioStats |
public void onRemoteVideoStatsOfUid(String uid, ThunderEventHandler.RemoteVideoStats stats)
Report status message of remote video stream during the call.
This callback describes end-to-end video streaming status of remote user during the call. For each remote user (anchor), it is triggered once every 2 seconds. In case multiple remote users (anchors) exist at the same time, this callback will be triggered multiple times every 2 seconds
Parameter | Description |
---|---|
uid | The uid of remote user (anchor) |
stats | The statistics of remote videos , refer to ThunderEventHandler.RemoteVideoStats |
public void onRemoteAudioStatsOfUid(String uid, ThunderEventHandler.RemoteAudioStats stats)
Report status message of remote audio stream during the call.
This callback describes end-to-end audio streaming status of remote user during the call. For each remote user (anchor), it is triggered once every 2 seconds. In case multiple remote users (anchors) exist at the same time, this callback will be triggered multiple times every 2 seconds
Parameter | Description |
---|---|
uid | The uid of remote user (anchor) |
stats | The statistics of remote audio, refer to ThunderEventHandler.RemoteAudioStats |
public void onRemoteAudioPlay(String uid, int elapsed)
Callback about first frame of played remote videos.
Parameter | Description |
---|---|
uid | Remote user ID ( anchor ID) |
elapsed | Period from the the user calls joinRoom to the event occurs, unit: milliseconds |
public void onLocalVideoStatusChanged(int status, int errorReason)
Local video status change callback. When the system status of the local video changes, the SDK calls back the current local video status and the cause of the change.
Parameter | Description |
---|---|
status | Local video status, see details in ThunderRtcConstant.LocalVideoStreamStatus |
errorReason | Cause of local video error, see details in ThunderRtcConstant.LocalVideoStreamErrorReason |
public void onLocalAudioStatusChanged(int status, int errorReason)
Local audio status callback. When the system status of the local audio changes, the SDK calls back the current local auido status and the cause of the change.
Parameter | Description |
---|---|
status | Local audio status, see details in ThunderRtcConstant.LocalAudioStreamStatus |
errorReason | Cause of local audio error, see details in ThunderRtcConstant.LocalAudioStreamErrorReason |
public void onRemoteVideoStateChangedOfUid(String uid, int state, int reason, int elapsed)
Callback about video status change of remote users.
Parameter | Description |
---|---|
uid | Remote user ID (anchor ID) |
state | Video stream status, see details in ThunderRtcConstant.RemoteVideoState |
reason | Cause of video stream change, see details in ThunderRtcConstant.RemoteVideoReason |
elapsed | Period from the the user calls joinRoom to the event occurs, unit: milliseconds |
public void onRemoteAudioStateChangedOfUid(String uid, int state, int reason, int elapsed)
Callback about audio status change of remote users.
Parameter | Description |
---|---|
uid | Remote user ID ( anchor ID) |
state | Audio stream status, see details in ThunderRtcConstant.RemoteAudioState |
reason | Cause of audio stream change, see details in ThunderRtcConstant.RemoteAudioReason |
elapsed | Period from the the user calls joinRoom to the event occurs, unit: milliseconds |
public void onDeviceStats(ThunderEventHandler.DeviceStats stats)
CPU or memory usage satus. Called every 2 seconds after joining rooms by calling ThunderEngine.joinRoom .
Parameter | Description |
---|---|
stats | CPU or memory usage status, see details in ThunderEventHandler.DeviceStats |
public void onAudioRouteChanged(int routing)
Called when the audio routing changes.
Parameter | Description |
---|---|
routing | The current audio routing, see details in ThunderRtcConstant.ThunderAudioFilePLayerErrorCode |
public void onHowlingDetectResult(boolean bHowling)
Callback of howling detection results.
Parameter | Description |
---|---|
bHowling | Detection result: "true"-detected, "false"-not detected |
public void onEchoDetectResult(boolean bEcho)
Callback of echo detection results, which will be called when the echo is detected.
Parameter | Description |
---|---|
bEcho | Detection result: "true"-detected, "false"-not detected |
boolean onRecordAudioFrame(ByteBuffer samples,
int numOfSamples,
int bytesPerSample,
int channels,
int samplesPerSec)
Report the raw audio capture data.
Parameter | Description |
---|---|
samples | Sample data of this frame |
numOfSamples | Number of samples |
bytesPerSample | Bytes per sample: For PCM, 16 bits are used in general, that is, two bytes |
channels | Number of channels (crossed data for stereo); 1: single track, 2: dual track |
samplesPerSec | Sampling rate, SamplesPerCall = (int)(SampleRate × sampleInterval); where, sample ≥ 0.01, in seconds |
boolean onPlaybackAudioFrame(ByteBuffer samples,
int numOfSamples,
int bytesPerSample,
int channels,
int samplesPerSec)
Report the raw audio play data.
Parameter | Description |
---|---|
samples | Sample data of this frame |
numOfSamples | Number of samples |
bytesPerSample | Bytes per sample: For PCM, 16 bits are used in general, that is, two bytes |
channels | Number of channels (crossed data for stereo); 1: single track, 2: dual track |
samplesPerSec | Sampling rate, SamplesPerCall = (int)(SampleRate × sampleInterval); where, sample ≥ 0.01, in seconds |
boolean onPlaybackAudioFrameBeforeMixing(String uid,
ByteBuffer samples,
int numOfSamples,
int bytesPerSample,
int channels,
int samplesPerSec)
Report the raw decoded audio data of remote user.
Parameter | Description |
---|---|
uid | Remote user uid |
samples | Sample data of this frame |
numOfSamples | Number of samples |
bytesPerSample | Bytes per sample: For PCM, 16 bits are used in general, that is, two bytes |
channels | Number of channels (crossed data for stereo); 1: single track, 2: dual track |
samplesPerSec | Sampling rate, SamplesPerCall = (int)(SampleRate × sampleInterval); where, sample ≥ 0.01, in seconds |
public boolean onMixedAudioFrame(ByteBuffer samples, int numOfSamples, int bytesPerSample, int channels, int samplesPerSec, long timeStamp);
Callback of the audio data mixed with the captured data and the playback data.
Parameter | Description |
---|---|
samples | Samples in the audio frame |
numOfSamples | The number of samples per channel in the audio frame |
bytesPerSample | The number of bytes per audio sample, which is usually 16-bit (2-byte) for PCM |
channels | The number of audio channels; 1-Mono, 2-Stereo (the data is interleaved) |
samplesPerSec | Sample rate, SamplesPerCall = (int)(SampleRate × sampleInterval), sample ≥ 0.01, unit: seconds |
timeStamp | Timestamp |
void onInit(int textureTarget, int outputWidth, int outputHeight)
Allow developers to use third-party special effects.
Including "Update texture type" and “Use shader in OES texture".
Parameter | Description |
---|---|
textureTarget | Texture type ( GL_TEXTURE_EXTERNAL_OES / GL_TEXTURE_2D ) |
outputWidth | Texture width |
outputHeight | Texture height |
void onDestroy()
Destroying resources of special effects.
void onDraw(final int textureId,
final FloatBuffer cubeBuffer,
final FloatBuffer textureBuffer,
float[] texMatrix)
Process every frame.
Parameter | Description |
---|---|
textureId | Texture ID |
cubeBuffer | Vertex coordinates |
textureBuffer | Texture coordinates |
texMatrix | Texture matrix |
void onOutputSizeChanged(final int width, final int height)
Callback when the texture size update.
Parameter | Description |
---|---|
width | Updated texture width |
height | Updated texture height |
void onCaptureVideoFrame(int width, int height, byte[] data, int length, int imageFormat)
Callback original yuv (NV21) data captured by camera to developer.
Parameter | Description |
---|---|
width | Video frame width |
height | Video frame height |
Date | NV21 data of video frame |
length | Video frame length |
imageFormat | Video image format. For the optional value, refer to class android.graphics.ImageFormat |
void onVideoDecodeFrame(String uid, int w, int h, byte[] data, int dateLen, long renderTimeMs)
Callback decoded video data for rendering (I420) to developer
Parameter | Description |
---|---|
uid | uid of user to whom video frame belongs |
w | Video frame width |
h | Video frame height |
Date | I420 data of video frame |
dateLen | Video frame length |
renderTimeMs | Current rendering timestamp |
boolean onInitialize(ThunderVideoFrameConsumer consumer)
Initialize video source.
In this callback function, external video stream is pushed by calling consumer.consumeByteArrayFrame.
Parameter | Description |
---|---|
consumer | The interface object for pushing external video stream, refer to ThunderVideoFrameConsumer |
boolean onStart()
Start video source.
boolean onStop()
Stop video source.
boolean onDispose()
Dispose video source.
void consumeByteArrayFrame(byte[] data, int format, int width, int height, int rotation, long timestamp)
Receive video frames of type ByteArray.
Call this function to transmit video frame of type ByteArray to SDK, and SDK will push this video frame out.
Parameter | Description |
---|---|
Date | Byte Array type of video data |
format | Pixel format. For optional values, refer to ThunderRtcConstant.ExternalVideoPixelFormat |
width | Video frame width |
height | Video frame height |
rotation | Clockwise rotation angle for video frame. If rotation angle is defined, media engine will rotate image. You may set angle value to 0, 90, 180 or 270 degrees as needed. If it is set to other values, the system will automatically ignore |
timestamp | Timestamp of incoming video frame. Developer must set a timestamp for each video frame |
consumeTextureFrame(int textureID, int textureFormat, int width, int height, int rotation, long timeStamp,float[] transform)
Push video frames in texture to SDK.
Parameter | Description |
---|---|
textureID | Texture ID |
textureFormat | Pixel format of the video frame: GLES20.GL_TEXTURE_2D or GLES11Ext.GL_TEXTURE_EXTERNAL_OES |
width | Texture width |
height | Texture height |
rotation | Clockwise rotating angle |
timestamp | Timestamp of the video frame (ms), incorrect timestamp may cause unsynchronized audio and vide |
transform | A 4×4 matrix of the texture, a unit matrix is recommended |
void onThunderLogWithLevel(int level, String tag, String msg)
Report the log information.
After setting this callback, log messages will be called back through this interface.
Parameter | Description |
---|---|
level | Log level, refer to ThunderRtcConstant.ThunderLogLevel |
tag | Log tag |
msg | Log content |
void onSendMediaExtraInfoFailedStatus(int status)
Callback when failure in sending media extra information.
Parameter | Description |
---|---|
status | Failure error code, refer to ThunderRtcConstant.ThunderSendMediaExtraInfoFailedStatus |
void onRecvMediaExtraInfo(java.lang.String uid,
java.nio.ByteBuffer data,
int dataLen)
Callback when received media extra information.
Parameter | Description |
---|---|
uid | Anchor uid |
Date | Received media extra information |
dataLen | Length of media extra information |
void onRecvMixAudioInfo(java.lang.String uid, ArrayList<ThunderEventHandler.MixAudioInfo> infos)
Callback when received extra information of mixed audio stream.
Parameter | Description |
---|---|
uid | Mixed audio stream uid |
infos | Raw stream data of mixed audio stream, identifying which streams contribute to this mixed audio stream, refer to ThunderEventHandler.MixAudioInfo |
void onRecvMixVideoInfo(java.lang.String uid, ArrayList<ThunderEventHandler.MixVideoInfo> infos)
Callback when received extra information of mixed video stream.
Parameter | Description |
---|---|
uid | Mixed video stream uid |
infos | Raw stream data of mixed video stream, identifying which streams contribute to this mixed video stream and stream, refer to ThunderEventHandler.MixVideoInfo |
Cuation:
- This callback is deprecated from V2.8.0, and it is recommended to call IThunderAudioFilePlayerEventCallback.onAudioFileStateChange
void onAudioFilePlayError(int errorCode)
Callback when audio file playing occur error
Parameter | Description |
---|---|
errorCode | Audio file playback error codes |
Meaning of error codes:
Error code | Meaning |
---|---|
0 | File opened successfully |
-1 | Error parsing file format |
-2 | Error decoding file format |
-3 | File format is not supported |
-4 | File path not in existence |
Note:
- This callback is deprecated from V2.8.0, and it is recommended to call IThunderAudioFilePlayerEventCallback.onAudioFileVolume
void onAudioFileVolume(long volume, long currentMs, long totalMs)
Report the volume of the playing audio file.
Parameter | Description |
---|---|
volume | Volume value [0-100] |
currentMs | play progress (in milliseconds) |
totalMs | Total file length (in milliseconds) |
Note:
- This callback is deprecated from V2.8.0, and it is recommended to call IThunderAudioFilePlayerEventCallback.onAudioFileStateChange
void onAudioFileSeekComplete(int millisecond)
Callback when the audio file seeking is completed.
Parameter | Description |
---|---|
millisecond | Actual fast forward progress |
Note:
- This callback is deprecated from V2.8.0, and it is recommended to call IThunderAudioFilePlayerEventCallback.onAudioFileStateChange
void onAudioFilePlaying()
Callback when start playback.
Note:
- This callback is deprecated from V2.8.0, and it is recommended to call IThunderAudioFilePlayerEventCallback.onAudioFileStateChange
void onAudioFilePause()
Callback when pause playback.
Note:
- This callback is deprecated from V2.8.0, and it is recommended to call IThunderAudioFilePlayerEventCallback.onAudioFileStateChange
void onAudioFileResume()
Callback when resume playback.
Note:
- This callback is deprecated from V2.8.0, and it is recommended to call IThunderAudioFilePlayerEventCallback.onAudioFileStateChange
void onAudioFileStop()
Callback when playback being stopped by user.
Note:
- This callback is deprecated from V2.8.0, and it is recommended to call IThunderAudioFilePlayerEventCallback.onAudioFileStateChange
void onAudioFilePlayEnd()
Callback when end playback.
public void onAudioFileVolume(long volume, long currentMs, long totalMs)
Playback volume callback1.
Parameter | Description |
---|---|
volume | Volume, range: [0-100] |
currentMs | Playback prpgress, unit: millisecond |
totalMs | File size, unit: millisecond |
public void onAudioFileStateChange(int event, int errorCode)
Player status callback.
Parameter | Description |
---|---|
event | Playback status, see details in ThunderRtcConstant.ThunderAudioFilePlayerEvent |
errorCode | Error code of playback status, see details in ThunderRtcConstant.ThunderAudioFilePLayerErrorCode |
Speaker volume information class
public static class AudioVolumeInfo {
public String uid;//Speaker uid
public int volume;//Speaker volume
public int pts;//Capture timestamp
}
Audio stream information for audio mixing.
public static class MixAudioInfo {
public String uid;//User uid to which the audio stream belongs
public int volume;//Volume value of audio stream [0,100]
}
Video stream information for video mixing (including video stream layout)
public static class MixVideoInfo {
public String uid; //User id
public int width; //Original width of this user's video
public int height; //Original height of this user's video
public int cropX; //X coordinate of the begin point used to crop the original video in video mixing
public int cropY; //Y coordinate of the begin point used to crop the original video in video mixing
public int cropW; //Width of the original video to be cropped in video mixing
public int cropH; //Height of the original video to be cropped in video mixing
public int layoutX; //X coordinate of the begin point of this user's video in video mixing canvas
public int layoutY; //Y coordinate of the begin point of this user's video in video mixing canvas
public int layoutW; //Width of this user's video in video mixing canvas
public int layoutH; //Height of this user's video in video mixing canvas
public 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
public 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.
}
Local video statistics class
public static class LocalVideoStats {
public int sentBitrate; // Actual sending bit rate (unit: Kbps), with the exception of sending bit rate of reloaded videos after packet loss
public int sentFrameRate; // Actual sending frame rate (unit: fps), with the exception of sending frame rate of reloaded videos after packet loss
public int renderOutputFrameRate; // Output frame rate of local preview (unit: fps)
public 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.
public int targetFrameRate; // Target encoding frame rate of current coder (unit: fps)
public int qualityAdaptIndication; // Quality adaptability of local videos since last statistics (based on target frame rate and target bit rate), see ThunderRtcConstant.ThunderVideoQualityAdapt for detailed definition
public int encoderOutputFrameRate; // Output frame rate of local encoder (unit: fps)
public int encodedBitrate; // Bit rate of video encoding (Kbps). This parameter includes no encoding bit rate of reloaded videos after packet loss.
public int encodedFrameWidth; // Encoded video width (px)
public int encodedFrameHeight; // Encoded video height (px)
public int encodedFrameCount; // Number of frames sent by video, an accumulated value
public int encodedType; // Encoding mode, see details in ThunderRtcConstant.ThunderVideoEncodedType
public int codecType; // Encoding type, see ThunderRtcConstant.ThunderVideoCodecType for detailed definition
public int configBitRate; // Bit rate configured in the background, kbps
public int configFrameRate; // Frame rate configured in the background
public int configWidth; // Video width configured in the background
public int configHeight; // Video height configured in the background
}
Local audio statistics class
public static class LocalAudioStats {
public int encodedBitrate; // Code rate, unit: Kbps
public int numChannels; // Number of channels
public int sendSampleRate; // Sampling rate sent (unit: Hz)
public int sendBitrate; // Average value of bit rate of sent data (unit: Kbps)
public int enableVad; // Whether to enbale VAD for sending audio streams: 0-disable, 1-enable
}
Remote video statistics class
public static class RemoteVideoStats {
public int delay; // Captured play delay
public int width; // Width of remote video stream
public int height; // Height of remote video stream
public int receivedBitrate; // Receiving bit rate (unit: Kbps)
public int decoderOutputFrameRate; // Output frame rate of remote video decoder (unit: fps)
public int rendererOutputFrameRate; // Output frame rate of remote video renderer (unit: fps)
public int packetLossRate; // Packet loss rate (%) of remote video after network confrontation
public int rxStreamType; // Types of video stream, including large stream and small stream
public int totalFrozenTime; // The accumulated time (ms) from the time when a remote user joins a channel to the time of video freezing
public 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
}
Remote audio statistics class
public static class RemoteAudioStats {
public 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
public int networkTransportDelay; // Network delay from an audio sending end to an audio receiving end, unit: millisecond
public int jitterBufferDelay; // Delay from a receiving end to network jitter buffer, unit: millisecond
public int totalDelay; // Total delay from capturing the host audio to audience playing the audio, unit: millisecond
public int frameLossRate; // Frame loss rate (%) of remote audio streams
public int numChannels; // Number of channels
public int receivedSampleRate; // Sampling rate (Hz) of remote audios
public int receivedBitrate; // Average bit rate of remote audios within a statistical period
public int totalFrozenTime; // The accumulated time (ms) from the time when a remote user joins a channel to the time of audio freezing; during one statistical period, an audio frame loss rate of 4% is recorded as a single freeze
// totalFrozenTime = number of times of audio freezing * 2 * 1000 (ms)
public 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
}
Uplink/downlink traffic data in the room class
public static class RoomStats {
public int totalDuration; // Total call duration, unit: second
public int txBitrate; //Chain sending bit rate (unit: bps)
public int rxBitrate; //Chain receiving bit rate (unit: bps)
public int txBytes; // Total sent bytes
public int rxBytes; // Total received bytes
public int txAudioBytes; // Total sent audio bytes
public int rxAudioBytes; // Total received audio bytes
public int txVideoBytes; // Total sent video bytes
public int rxVideoBytes; // Total received video bytes
public int txAudioBitrate; //Audio packet sending bit rate (unit: bps)
public int rxAudioBitrate; //Audio packet receiving bit rate (unit: bps)
public int txVideoBitrate; //Video packet sending bit rate (unit: bps)
public int rxVideoBitrate; //Video packet receiving bit rate (unit: bps)
public int lastmileDelay; // Local client-to-edge server delay (unit: milliseconds)
}
CPU/memory usage status
public static class DeviceStats {
public double cpuTotalUsage; // Current system CPU usage (%)
public double cpuAppUsage; // CPU usage of the current application (%)
public double memoryAppUsage; // Memory usage of the current application (%)
public double memoryTotalUsage; // Current system memory usage (%)
}