Data types
This topic describes the data types for the Ohos software development kit (SDK).
Contents
Data type | Description | Minimum supported version |
Device type. | 3.0 | |
Reason why a user goes offline. | 3.0 | |
OnBye type. | 3.0 | |
Network connection status. | 3.0 | |
Reason for a network connection status change. | 3.0 | |
Network quality. | 3.0 | |
Log level. | 3.0 | |
SDK error code. | 3.0 | |
View display mode. | 3.0 | |
Video window mirror mode. | 3.0 | |
Video aspect ratio. | 3.0 | |
Video rotation angle. | 3.0 | |
Audio track type. | 3.0 | |
Video track type. | 3.0 | |
Video stream type. | 3.0 | |
Subscription state. | 3.0 | |
Video output orientation. | 3.0 | |
Video mirror mode. | 3.0 | |
Publishing state. | 3.0 | |
Audio encoding profile. | 3.0 | |
Audio scenario. | 3.0 | |
User authentication information. | 3.0 | |
Video display window settings. | 3.0 | |
Video encoding properties for the camera stream. | 3.0 | |
Encoding properties for the screen sharing stream. | 3.0 | |
Local video statistics. | 3.0 | |
Local audio statistics. | 3.0 | |
Remote video statistics. | 3.0 | |
Remote audio statistics. | 3.0 | |
Audio volume information. | 3.0 |
Details
RtcEngineDeviceType: The device type.
Enumeration name
Description
RtcEngineTypeUnknown
Unknown type.
RtcEngineTypeAudioRecording
Audio capture device.
RtcEngineTypeAudioPlayout
Audio playback device.
RtcEngineTypeVideoCapture
Video capture device.
RtcEngineUserOfflineReason: The reason why a user goes offline.
Enumeration Name
Description
RtcEngineUserOfflineQuit
The user left the channel.
RtcEngineUserOfflineDropped
The user is dropped due to a timeout. This occurs when no data packets are received from the user for an extended period.
RtcEngineOnByeType: The OnBye type.
Enumeration Name
Description
RtcEngineOnByeBeKickedOut
The current user is kicked out of the channel.
RtcEngineOnByeChannelTerminated
The channel is closed. You must leave the meeting.
RtcEngineOnByeUserReplaced
The user with the same user ID joins the channel from another device. The current device is forced to go offline.
RtcEngineOnByeNeedRelogin
The signaling service failed to automatically reconnect. The user must manually retry.
RtcEngineConnectionStatus: The network connection status.
Enumeration Name
Description
RtcEngineConnectionInit
Initialization is complete.
RtcEngineConnectionDisconnected
The network connection is disconnected.
RtcEngineConnectionConnecting
Connecting to the network.
RtcEngineConnectionConnected
The network is connected.
RtcEngineConnectionReconnecting
Reconnecting to the network.
RtcEngineConnectionFailed
The network connection failed.
RtcEngineConnectionStatusChangeReason: The reason for a network connection status change.
Enumeration
Description
RtcEngineConnectionChangedDummyReason
Unknown reason.
RtcEngineConnectionSignalingHeartbeatTimeout
Heartbeat timeout.
RtcEngineConnectionSignalingHeartbeatAlive
Heartbeat recovered.
RtcEngineConnectionSignalingJoinChannelFailure
Failed to join the channel.
RtcEngineConnectionSignalingJoinChannelSuccess
Joined the channel.
RtcEngineConnectionSignalingLeaveChannel
Left the channel.
RtcEngineConnectionSignalingConnecting
Establishing a signaling connection.
RtcEngineConnectionMediaLinkChange
The media link changed.
RtcEngineConnectionChangedNetworkInterrupted
The network connection is interrupted.
RtcEngineConnectionChangedNetworkRecovery
The network connection is recovered.
RtcEngineNetworkQuality: The network quality.
Enumeration
Description
RtcEngineNetworkQualityGood
The network quality is good.
RtcEngineNetworkQualityPoor
The network quality is poor.
RtcEngineNetworkQualityDisconnect
The network is disconnected.
RtcEngineNetworkQualityUnknown
Unknown.
RtcEngineLogLevel: The log level.
Enumeration name
Description
RtcEngineLogLevelInfo
Outputs logs at the RtcEngineLogLevelInfo level and higher.
RtcEngineLogLevelWarn
Outputs logs at the RtcEngineLogLevelWarn level and higher.
RtcEngineLogLevelError
Outputs logs at the RtcEngineLogLevelError level and higher.
RtcEngineLogLevelNone
Does not output logs.
RtcEngineErrorCode: The SDK error code.
Enumeration name
Description
RtcEngineErrorJoinBadAppId
The AppId does not exist. Create an application in the console.
RtcEngineErrorJoinInvalidAppId
The AppId is invalid. Re-enable the application in the console.
RtcEngineErrorJoinBadChannel
The channel does not exist. Try to join the channel again. This can happen if the meeting organizer joins and then quickly leaves, and another user tries to join afterward.
RtcEngineErrorJoinInvalidChannel
The channel is invalid. The channel is valid for 48 hours. Generate a new token.
RtcEngineErrorJoinBadToken
The token is invalid. Generate a new token.
RtcEngineErrorJoinTimeout
A timeout occurred when joining the channel. Check your network connection.
RtcEngineErrorJoinBadParam
An invalid parameter was used. A field in RtcEngineAuthInfo is empty or the timestamp is less than or equal to 0. Check if all fields are complete.
RtcEngineErrorJoinChannelFailed
Failed to join the channel.
RtcEngineErrorLogRootPathError
The root path for the log module is incorrect. Check if the path exists and has write permissions.
RtcEngineErrorMicOpenFail
Failed to initialize the capture device. The media service for the capture device is abnormal, or the audio device is occupied. On macOS and Windows, check if the energy bar for the audio device is active in System Settings. On iOS and Android, check if the device is occupied by another application. If everything is normal, restart the device.
RtcEngineErrorSpeakerOpenFail
Failed to initialize the playback device. The media service for the playback device is abnormal, or the audio device is occupied. On macOS and Windows, check if the energy bar for the audio device is active in System Settings. On iOS and Android, check if the device is occupied by another application. If everything is normal, restart the device.
RtcEngineErrorMicInterrupt
Insufficient system performance. The media service for the capture device is abnormal, or the audio device is occupied. Restart the application or the device.
RtcEngineErrorSpeakerInterrupt
Insufficient system performance. The media service for the playback device is abnormal, or the audio device is occupied. Restart the application or the device.
RtcEngineErrorMicAuthFail
The microphone is not authorized. Go to System Settings to grant microphone permission, and then rejoin the channel.
RtcEngineErrorMicNotAvailable
No audio capture device is available. Check if a microphone is connected and if the device is disabled in System Settings.
RtcEngineErrorSpeakerNotAvailable
No audio playback device is available. Check if a speaker or headset is connected and if the device is disabled in System Settings.
RtcEngineErrorSpecifiedAudioDeviceNotFound
The specified audio device was not found.
RtcEngineErrorCameraOpenFail
Failed to initialize the capture device. Check if the system camera is available and if it is occupied by another mobile app.
RtcEngineErrorCameraInterrupt
An exception occurred during capture. On macOS and Windows, the camera capture light turns off, and the device is forcibly interrupted. Rejoin the channel or restart the application.
RtcEngineErrorSpecifiedCameraDeviceNotFound
The specified camera was not found.
RtcEngineErrorScreenShareOpenFail
Failed to start screen sharing.
RtcEngineErrorScreenShareNoPermission
No permission for screen sharing.
RtcEngineErrorVideoDisplayOpenFail
Failed to initialize the rendering device. On Windows, check if the graphics card driver needs to be upgraded. On mobile devices, check if the phone model, Android tablet, or other peripheral supports OpenGL.
RtcEngineErrorVideoDisplayInterrupt
An exception occurred during rendering. A system error caused the rendering engine to report an error. Rejoin the channel or restart the application.
RtcEngineErrorIceConnectionConnectFail
Failed to establish the media channel. Check your network connection.
RtcEngineErrorIceConnectionReconnectFail
Failed to reconnect to the media channel. Check your network connection.
RtcEngineErrorConnectionHeartbeatTimeout
Signaling heartbeat timeout. Check your network connection.
RtcEngineErrorConnectionConnectFail
Signaling connection failed. Check the signaling network connection.
RtcEngineErrorPublishInvalid
Publishing is invalid.
RtcEngineErrorPublishNotJoinChannel
Failed to publish the stream because the user has not joined the channel.
RtcEngineErrorPublishAudioStreamFailed
Failed to publish the audio stream.
RtcEngineErrorPublishVideoStreamFailed
Failed to publish the video stream.
RtcEngineErrorPublishScreenShareFailed
Failed to publish the screen sharing stream.
RtcEngineErrorPublishScreenShareConfigError
Incorrect screen sharing configuration.
RtcEngineErrorSubscribeInvalid
Subscription is invalid.
RtcEngineErrorSubscribeNotJoinChannel
Subscription failed because the user has not joined the channel.
RtcEngineErrorSubscribeAudioStreamFailed
Failed to subscribe to the audio stream.
RtcEngineErrorSubscribeVideoStreamFailed
Failed to subscribe to the video stream.
RtcEngineErrorSubscribeScreenShareFailed
Failed to subscribe to the screen sharing stream.
RtcEngineErrorInvalidState
Invalid SDK state. Destroy the SDK and create a new instance.
RtcEngineErrorInvalidArgument
The parameters do not match.
RtcEngineErrorSessionRemoved
The session has been removed. Destroy the instance, create a new one, and rejoin the channel. This error code is deprecated.
RtcEngineErrorAudioBufferFull
The buffer queue is full. This is used for external raw data input. Reduce the input frequency, set a wait time of 20 ms, and ensure that the data for a single input does not exceed 40 ms.
RtcEngineErrorVideoBufferFull
The buffer queue is full. This is used for external raw data input. Reduce the input frequency and wait for the video keyframe interval before the next input.
RtcEngineErrorAudioStreamError
Audio stream error.
RtcEngineErrorAudioFileOpenFail
Failed to open the audio file.
RtcEngineErrorAudioFormatNotSupported
The audio format is not supported.
RtcEngineErrorUpdateRoleChannel
An error occurred when setting the role in interactive mode.
RtcEngineErrorInner
Internal SDK error.
RtcEngineRenderMode: The view display mode.
Enumeration
Description
RtcEngineRenderModeAuto
Auto mode.
RtcEngineRenderModeStretch
Stretch mode. If the aspect ratio of the input video is different from the aspect ratio set for publishing, the video is stretched to fit the publishing ratio. This will distort the image.
RtcEngineRenderModeFill
Fill mode. If the aspect ratio of the input video is different from the aspect ratio set for publishing, black bars are added to the top and bottom or to the left and right of the video.
RtcEngineRenderModeCrop
Crop mode. If the aspect ratio of the input video is different from the aspect ratio set for publishing, the width or height of the video is cropped. This will cause some content to be lost.
RtcEngineRenderModeNoChange
The previous display mode is used.
RtcEngineRenderMirrorMode: The video window mirror mode.
Enumeration Name
Description
RtcEngineRenderMirrorModeOnlyFrontMirror
Only the front camera preview is mirrored. Other views are not mirrored.
RtcEngineRenderMirrorModeAllMirror
Mirroring is enabled.
RtcEngineRenderMirrorModeAllNoMirror
Mirroring is disabled.
RtcEngineRenderMirrorModeNoChange
Placeholder. This value has no effect.
RtcEngineVideoScale: The video aspect ratio.
Enumeration Name
Description
RtcEngineVideoScale_16_9
16:9.
RtcEngineVideoScale_4_3
4:3.
RtcEngineRotationMode: The video rotation angle.
Enumeration Name
Description
RtcEngineRotationModeNoChange
The previous rotation angle is used.
RtcEngineRotationMode_0
Rotate 0 degrees.
RtcEngineRotationMode_90
Rotate 90 degrees.
RtcEngineRotationMode_180
Rotate 180 degrees.
RtcEngineRotationMode_270
Rotate 270 degrees.
RtcEngineAudioTrack: The audio track type.
Enumeration Name
Description
RtcEngineAudioTrackNo
No microphone.
RtcEngineAudioTrackMic
Microphone.
RtcEngineAudioTrackEnd
Placeholder.
RtcEngineVideoTrack: The video track type.
Enumeration Name
Description
RtcEngineVideoTrackNo
No video stream.
RtcEngineVideoTrackCamera
Camera stream.
RtcEngineVideoTrackScreen
Screen sharing stream.
RtcEngineVideoTrackBoth
Camera stream and screen sharing stream.
RtcEngineVideoStreamType: The video stream type.
Enumeration name
Description
RtcEngineVideoStreamTypeNone
None. In the OnSubscribeStreamTypeChanged callback, this indicates that no stream is subscribed.
RtcEngineVideoStreamTypeFHD
Full high definition (FHD) stream. This corresponds to the 1080p billing tier and is available if the device performance, network conditions, and publishing resolution meet the requirements.
RtcEngineVideoStreamTypeHD
High definition (HD) stream. This corresponds to the 720p billing tier and is available if the device performance, network conditions, and publishing resolution meet the requirements.
RtcEngineVideoStreamTypeSD
Standard definition (SD) stream. This corresponds to the 480p billing tier and is available if the device performance, network conditions, and publishing resolution meet the requirements.
RtcEngineVideoStreamTypeLD
Low definition (LD) stream. This corresponds to the 480p billing tier and is available if the device performance, network conditions, and publishing resolution meet the requirements.
RtcEngineSubscribeState: The subscription state.
Enumeration Name
Description
RtcEngineStatsSubscribeIdle
Initial state.
RtcEngineStatsNoSubscribe
Not subscribed.
RtcEngineStatsSubscribing
Subscribing.
RtcEngineStatsSubscribed
Subscribed.
RtcEngineVideoEncoderOrientationMode: The video output orientation.
Enumeration Name
Description
RtcEngineVideoEncoderOrientationModeAdaptive
0: Adaptive. The publishing orientation is the same as the capture orientation.
RtcEngineVideoEncoderOrientationModeFixedLandscape
1: Landscape mode. The SDK publishes a landscape stream. The width of the output video is always the greater of the configured width and height, and the height is the lesser value.
RtcEngineVideoEncoderOrientationModeFixedPortrait
2: Portrait mode. The SDK publishes a portrait stream. The width of the output video is always the lesser of the configured width and height, and the height is the greater value.
RtcEngineVideoMirrorMode: The video mirror mode.
Enumeration Name
Description
RtcEngineRenderMirrorModeOnlyFrontMirror
Only the front camera preview is mirrored. Other views are not mirrored.
RtcEngineRenderMirrorModeAllMirror
Mirroring is enabled.
RtcEngineRenderMirrorModeAllNoMirror
Mirroring is disabled.
RtcEnginePublishState: The publishing state.
Enumeration Name
Description
RtcEngineStatsPublishIdle
Initial state.
RtcEngineStatsNoPublish
Not publishing.
RtcEngineStatsPublishing
Publishing.
RtcEngineStatsPublished
Published.
RtcEngineAudioProfile: The audio encoding profile.
Enumeration name
Description
RtcEngineBasicQualityMode
Standard quality mode. Default: 16000 Hz sample rate, mono, and a maximum bitrate of 24 kbps.
RtcEngineHighQualityMode
High quality mode. Default: 48000 Hz sample rate, mono, and a maximum bitrate of 64 kbps.
RtcEngineSuperHighQualityMode
Super high quality mode. Default: 48000 Hz sample rate, mono, and a maximum bitrate of 96 kbps.
RtcEngineAudioScenario: The audio scenario.
Enumeration name
Description
RtcEngineSceneDefaultMode
Default scenario. Recommended for general real-time communication.
RtcEngineSceneMusicMode
Music scenario. High audio quality is suitable for music-focused scenarios.
AuthInfo: The user authentication information.
Parameter
Type
Description
channelId
String
Channel ID.
userId
String
User ID.
appId
String
Application ID.
token
String
Token.
gslbServer
String
GSLB address.
RtcEngineVideoCanvas: The video display window settings.
Parameter Name
Type
Description
xComponentId
string
The display view.
backgroundColor
number
The background color in RGB Hex format.
renderMode
The rendering mode. Default value: RtcEngineRenderModeAuto.
mirrorMode
The mirror mode. Default value: RtcEngineRenderMirrorModeOnlyFrontMirror.
scaleMode
The video aspect ratio. Default value: RtcEngineVideoScale_16_9.
rotation
The rotation angle. Default value: RtcEngineRotationMode_0.
RtcEngineVideoEncoderConfiguration: The video encoding properties for the camera stream.
Parameter name
Type
Description
width
number
The video resolution. Default: 640 × 480. You can set a custom resolution or select a predefined resolution.
height
number
frameRate
number
The video frame rate. Default: 20. Maximum: 30.
orientationMode
The video output orientation. Default: RtcEngineVideoEncoderOrientationModeAdaptive. For more information, see the definition of RtcEngineVideoEncoderOrientationMode.
rotation
number
The video rotation angle. Default: 0.
LocalVideoStats: The local video statistics.
Parameter name
Type
Description
track
The video stream type.
targetEncodeBitrate
number
The target encoding bitrate.
actualEncodeBitrate
number
Actual encoding bitrate.
sentBitrate
number
The sending bitrate.
sentFps
number
The sending frame rate.
encodeFps
number
The output frame rate of the encoder.
captureFps
number
The capture frame rate.
renderFps
number
The rendering frame rate.
avgQpPerSec
number
The average QP per second.
encoderFrameWidth
number
The width of the encoded frame.
encoderFrameHeight
number
The height of the encoded frame.
captureFrameWidth
number
The width of the captured frame.
captureFrameHeight
number
The height of the captured frame.
LocalAudioStats: The local audio statistics.
Parameter
Type
Description
track
The audio track type.
sentBitrate
number
The sending bitrate.
sentSamplerate
number
The sending sample rate.
numChannel
number
The number of sound channels.
inputLevel
number
The input volume.
RemoteVideoStats: The remote video statistics.
Parameter name
Type
Description
userId
string
The user ID.
track
The video track type.
width
number
The width of the video frame.
height
number
The height of the video frame.
recvBitrate
number
The receiving bitrate.
decoderOutputFrameRate
number
The decoding frame rate.
rendererOutputFrameRate
number
The rendering frame rate.
packetLossRate
number
The packet loss rate.
RemoteAudioStats: The remote audio statistics.
Parameter name
Type
Description
userId
string
The UID of the remote user.
packetLossRate
number
The audio packet loss rate.
recvBitrate
number
The receiving bitrate.
totalFrozenTime
number
The duration of audio stuttering in milliseconds (ms).
speechExpandRate
number
The expansion rate.
AudioVolumeInfo: The audio volume information.
Parameter Name
Type
Description
userId
string
The user ID, which is a unique identifier from the AppServer. A user ID of "0" indicates the local user.
volume
number
The user's volume. Value range: [0, 100].
speechState
number
The speech state. 0: The user is not speaking. 1: The user is speaking.