Data structures

更新时间:
复制 MD 格式

This topic describes the data structures of the ApsaraVideo Real-time Communication (ARTC) SDK for Linux in Java.

Contents

Data type

Description

ERROR_CODE

The error code enumeration.

WARNNING_CODE

The warning code enumeration.

ChannelProfile

The enumeration of the channel mode.

PublishMode

The enumeration of the stream ingest mode.

PublishAvsyncMode

The enumeration of the audio and video synchronization mode for stream ingest.

VideoTrack

The video track enumeration.

AudioTrack

The audio track enumeration.

VideoProfile

The enumeration of the video profile settings.

AliEngineVideoDimensions

The video resolution.

AliEngineFrameRate

The video frame rate.

AliEngineVideoOrientationMode

The screen orientation mode.

AliEngineVideoMirrorMode

The video mirroring mode.

AliEngineRotationMode

The video rotation angle.

AliEngineVideoEncoderConfiguration

The video encoding settings for the camera track.

AliEngineScreenShareEncoderConfiguration

The video encoding settings for the screen track.

VideoSource

The type of the video source.

RenderMode

The rendering mode.

VideoDataFormat

The format of the video data.

VideoBufferType

The type of the video buffer.

VideoDataSample

A class for video data samples.

SubscribeMode

The enumeration of the subscription mode.

AudioTranscodingCodec

The enumeration of the audio transcoding codec.

VideoTranscodingCodec

The enumeration of the video transcoding codec.

VideoTrackType

An enumeration of video track types.

VideoFormat

The enumeration of the video format.

AudioFormat

The enumeration of the audio format.

AliRtcDataMsgType

The enumeration of the message type.

AliRtcDataChannelMsg

This is the data tunnel message class.

VideoFrameType

The enumeration of the type of video frames.

AudioFrameType

The enumeration of the type of audio frames.

AudioPcmFrame

The class of pulse-code modulation (PCM) frames of the audio.

AudioAacFrame

The class of Advanced Audio Coding (AAC) frames of the audio.

AudioFrame

The class of the audio frames.

VideoH264Frame

The class of H.264 frames of the video.

VideoFrame

The class of the video frames.

JoinChannelConfig

You can add the channel configuration class.

AuthInfo

The class of the authentication information.

AliEnginePublishState

The enumeration of the stream ingest status.

AliEngineSubscribeState

The enumeration of the subscription status.

AliEngineAudioQualityMode

The enumeration of the mode of audio quality.

AliEngineAudioSceneMode

The enumeration of the mode for the audio scenario.

AliEngineVideoStreamType

The type of the video track.

AliEngineMuteLocalAudioMode

The local mute mode.

AliEngineClientRole

The client role.

Details

  • ERROR_CODE: the error code enumeration.

Enumeration Name

Description

ERR_OK

Normal.

ERR_JOIN_BAD_APPID

The application ID does not exist.

ERR_JOIN_INVALID_APPID

The application ID is invalid.

ERR_JOIN_BAD_CHANNEL

The channel does not exist.

ERR_JOIN_INVALID_CHANNEL

The channel is invalid.

ERR_JOIN_BAD_TOKEN

The token does not exist.

ERR_JOIN_TIMEOUT

The request to join the channel times out.

ERR_JOIN_BAD_PARAM

One or more parameters specified for the request to join the channel are incorrect.

ERR_JOIN_FAILED

Failed to join the channel.

ERR_JOIN_CONFIG_INVALID

One or more parameters specified for the request to join the channel are invalid. For example, an empty token is specified.

ERR_LEAVE_UNUSUAL

The user leaves the channel unexpectedly. It may be because the user is kicked out.

ERR_PROCESS_STOP

The child process exits due to exceptions.

ERR_AUDIO_DATA_ERROR

An audio data error occurs.

ERR_VIDEO_DATA_ERROR

A video data error occurs.

ERR_NETWORK_CONNECT_FAIL

The media channel fails to be established.

ERR_NETWORK_RECONNECT_FAIL

The media channel fails to be reconnected.

ERR_NETWORK_DISCONNECT

A disconnection occurs.

ERR_NETWORK_TIMEOUT

The connection times out.

ERR_PUBLISH_INVALID

The ingested stream is invalid.

ERR_Publish_NOT_JOIN_CHANNEL

The stream ingest fails because the user has not joined the channel.

ERR_PUBLISH_AUDIO_STREAM_FAILED

The audio track fails to be ingested.

ERR_PUBLISH_VIDEO_STREAM_FAILED

The video track fails to be ingested.

ERR_PUBLISH_DUAL_STREAM_FAILED

The minor stream fails to be ingested.

ERR_PUBLISH_SCREEN_SHARE_FAILED

Failed to start screen sharing.

ERR_PUBLISH_SCREEN_SHARE_CONFIG

The screen sharing settings are invalid.

ERR_SUBSCRIBE_INVALID

The subscription is invalid.

ERR_SUBSCRIBE_NOT_JOIN_CHANNEL

A subscription error occurs because the user has not joined the channel.

ERR_SUBSCRIBE_AUDIO_STREAM_FAILED

The subscription to the audio track fails.

ERR_SUBSCRIBE_VIDEO_STREAM_FAILED

The subscription to the video track fails.

ERR_SUBSCRIBE_DUAL_STREAM_FAILED

The subscription to the minor stream fails.

ERR_SUBSCRIBE_SCREEN_SHARE_FAILED

The subscription to the screen track fails.

ERR_SUBSCRIBE_DUAL_AUDIO_STREAM_FAILED

The subscription to binaural channels fails.

ERR_SDK_INVALID_STATE

The SDK internal status is invalid.

ERR_SESSION_REMOVED

The session has been removed.

ERR_INNER

An SDK internal error occurs.

ERR_VIDEO_TRANSFER

An error occurs during video data transmission.

ERR_AUDIO_TRANSFER

An error occurs during audio data transmission.

ERR_AUDIO_BUFFER_FULL

The frequency is too high when the audio is input externally.

ERR_FATAL

An SDK critical error occurs.

  • WARNNING_CODE: the warning code enumeration.

Enumeration name

Description

WARN_DEFAULT

The default warning.

  • ChannelProfile: the enumeration of the channel mode.

Enumeration Name

Description

ChannelProfileCommunication

The communication mode.

ChannelProfileInteractiveLive

The interactive mode.

ChannelProfileInteractiveWithLowLatencyLive

The low-latency interactive mode.

  • PublishMode: the enumeration of the stream ingest mode.

Enumeration Name

Description

PublishAutomatically

Automatic stream ingest.

PublishManually

Manual stream ingest.

  • PublishAvsyncMode: the enumeration of the audio and video synchronization mode for stream ingest.

Enumeration name

Description

PublishAvsyncNoDelay

No delay, which indicates that the audio and video are in sync.

PublishAvysncWithPts

The audio and video are synchronized with each other based on the presentation timestamp (PTS).

  • VideoTrack: the video track enumeration.

Enumeration name

Description

VideoTrackNo

No video track.

VideoTrackCamera

Video track from the camera or a file.

VideoTrackScreen

Video track from screen sharing.

VideoTrackBoth

Video tracks from both the camera or a file and screen sharing.

VideoTrackEnd

The end marker for video track options. The value is 0xffffffff.

  • AudioTrack: the audio track enumeration.

Enumeration name

Description

AudioTrackNo

No audio track.

AudioTrackMic

Audio track from the microphone or a file.

AudioTrackEnd

The end marker for the audio track options is 0xffffffff.

  • VideoProfile: the enumeration of the video profile settings.

Enumeration Name

Description

VideoProfile_Default

You can let the SDK decide the best resolution.

VideoProfile_180_240P_15

The resolution is 180×240, and the frame rate is 15 frames per seconds (FPS).

VideoProfile_180_320P_15

The resolution is 180×320, and the frame rate is 15 FPS.

VideoProfile_180_320P_30

The resolution is 180×320, and the frame rate is 30 FPS.

VideoProfile_240_320P_15

The resolution is 240×320, and the frame rate is 15 FPS.

VideoProfile_360_480P_15

The resolution is 360×480, and the frame rate is 15 FPS.

VideoProfile_360_480P_30

The resolution is 360×480, and the frame rate is 30 FPS.

VideoProfile_360_640P_15

The resolution is 360×640, and the frame rate is 15 FPS.

VideoProfile_360_640P_30

The resolution is 360×640, and the frame rate is 30 FPS.

VideoProfile_480_640P_15

The resolution is 480×640, and the frame rate is 15 FPS.

VideoProfile_480_640P_30

The resolution is 480×640, and the frame rate is 30 FPS.

VideoProfile_720_960P_15

The resolution is 720×960, and the frame rate is 15 FPS.

VideoProfile_720_960P_30

The resolution is 720×960, and the frame rate is 30 FPS.

VideoProfile_720_1280P_15

The resolution is 720×1280, and the frame rate is 15 FPS.

VideoProfile_720_1280P_30

The resolution is 720×1280, and the frame rate is 30 FPS.

VideoProfile_1080_1920P_15

The resolution is 1080×1920, and the frame rate is 15 FPS.

VideoProfile_1080_1920P_30

The resolution is 1080×1920, and the frame rate is 30 FPS.

VideoProfile_480_640P_15_1500Kb

Resolution: 480 × 640. Frame rate: 15 fps. Bitrate: 1,500 Kbps.

  • AliEngineVideoDimensions: the video resolution.

Enum name

Description

width

The video resolution width.

height

The vertical resolution of the video.

  • AliEngineFrameRate: the video frame rate.

Enumeration name

Description

AliEngineFrameRateFps5

5 FPS

AliEngineFrameRateFps10

10 FPS

AliEngineFrameRateFps15

15 FPS

AliEngineFrameRateFps20

20 FPS

AliEngineFrameRateFps25

25 FPS

AliEngineFrameRateFps30

30 FPS

  • AliEngineVideoOrientationMode: the screen orientation mode.

Enumeration name

Description

AliEngineVideoEncoderOrientationModeAdaptive

Adaptive mode.

AliEngineVideoEncoderOrientationModeFixedLandscape

Landscape mode.

AliEngineVideoEncoderOrientationModeFixedPortrait

Portrait mode.

  • AliEngineVideoMirrorMode: the video mirroring mode.

Enumeration name

Description

AliEngineVideoMirrorModeDisabled

Mirroring is disabled.

AliEngineVideoMirrorModeEnable

Mirroring is enabled.

  • AliEngineRotationMode: the video rotation angle.

Enumeration Name

Description

AliEngineRotationModeNoChange

The previous rotation angle is used.

AliEngineRotationMode_0

0

AliEngineRotationMode_90

90

AliEngineRotationMode_180

180

AliEngineRotationMode_270

270

  • AliEngineVideoEncoderConfiguration: the video encoding settings for the camera track.

Parameter

Type

Description

dimensions

AliEngineVideoDimensions

The video resolution. Default value: 640×480. Maximum value: 1920×1080.

frameRate

AliEngineFrameRate

The video frame rate. Unit: FPS. Default value: 15. Maximum value: 30.

bitrate

int

The video encoding bitrate in Kbps. The default value is 512. If you set this parameter to 0, the SDK calculates a suitable bitrate. The bitrate must be within a reasonable range that corresponds to the resolution and frame rate. If you specify a value outside the valid range, the SDK automatically adjusts the bitrate to a valid value.

orientationMode

AliEngineVideoOrientationMode

The screen orientation mode. By default, the adaptive mode is used.

mirrorMode

AliEngineVideoMirrorMode

The mirroring mode for stream ingest. By default, mirroring is disabled.

rotationMode

AliEngineRotationMode

The rotation angle for stream ingest. Default value: 0.

  • AliEngineScreenShareEncoderConfiguration: the video encoding settings for the screen track.

Parameter

Type

Description

dimensions

AliEngineVideoDimensions

The video resolution. Default value: 0×0, which indicates that the resolution for stream ingest is the same as the resolution of the shared screen. Maximum value: 3840×2160.

frameRate

AliEngineFrameRate

The video frame rate. Unit: FPS. Default value: 5. Maximum value: 30.

bitrate

int

The video encoding bitrate in Kbps. The default value is 512. If you set this parameter to 0, the SDK calculates a suitable bitrate. The bitrate must be within a reasonable range that corresponds to the resolution and frame rate. If you specify a value outside the valid range, the SDK automatically adjusts the bitrate to a valid value.

rotationMode

AliEngineRotationMode

The rotation angle for stream ingest. Default value: 0.

  • VideoSource: the video source.

Enumeration name

Description

VideoSourceCamera

A camera is a video source.

VideoSourceScreenShare

You can share your screen as a video source.

VideosourceTypeMax

The video source type has a maximum value of 0xffffffff.

  • RenderMode: the rendering mode.

Enumeration Name

Description

RenderModeAuto

The auto mode.

RenderModeStretch

The stretching mode.

RenderModeFill

Padding

RenderModeCrop

Crop.

  • VideoDataFormat: the format of the video data.

Enumeration Name

Description

VideoDataFormatUnknow

Unknown.

VideoDataFormatBGRA

BGRA format

VideoDataFormatI420

I420 format

VideoDataFormatNV21

NV21.

VideoDataFormatNV12

NV12.

VideoDataFormatH264

H.264.

VideoDataFormatRGB24

RGB24.

VideoDataFormatBGR24

BGR24 format

  • VideoBufferType: the type of the video buffer.

Enumeration Name

Description

VideoBufferTypeRawData

Raw data.

VideoBufferTypeCVPixelBuffer

CV pixel buffer.

VideoBufferTypeTexture

Texture.

  • VideoDataSample: the video sample.

Parameter

Type

Description

format

VideoDataFormat

The format of the video data.

bufferType

VideoBufferType

The type of the video buffer.

data

byte[]

The raw data that stores the video frames.

dataLen

int

The length of the data, which is the size of the data array.

strideY

int

The stride of the Y plane, which is used for the I420, NV12, and NV21 formats.

strideU

int

The stride of the U plane, which is used for the I420 format.

strideV

int

The stride of the V plane, which is used for the I420 format.

height

int

The height of the video frame.

width

int

The width of the video frame.

rotation

int

The rotation angle of the video frame, in degrees.

timeStamp

long

The timestamp of the video frame, in milliseconds.

  • SubscribeMode: the enumeration of the subscription mode.

Enumeration Name

Description

SubscribeAutomatically

Automatic subscription.

SubscribeManually

Manual subscription.

SubscribeAudioAutoAndOnly

Automatic subscription to only audio.

SubscribeCameraAutoAndOnly

Automatic subscription to only video from the camera.

  • AudioTranscodingCodec: the enumeration of the audio transcoding codec.

Enumeration Name

Description

AudioTranscodingCodecPcm

PCM encoding

AudioTranscodingCodecAac

AAC encoding

AudioTranscodingCodecBothPcmAndAac

Supports both PCM and AAC encoding.

  • VideoTranscodingCodec: the enumeration of the video transcoding codec.

Enumeration name

Description

VideoTranscodingCodecYuv

YUV encoding

VideoTranscodingCodecH264

H.264 encoding

VideoTranscodingCodecBothYuvAndH264

Support for both YUV and H.264 encoding.

  • VideoTrackType: the enumeration of the video track source.

Enumeration name

Description

VideoTrackCameraLarge

Main Camera Video

VideoTrackCameraSmall

The minor stream from the camera.

VideoTrackCameraSuper

Extra-large camera videos

VideoTrackScreenshare

Shared screen video

  • VideoFormat: the enumeration of the video format.

Enumeration Name

Description

VideoFormatNone

No specific format.

VideoFormatH264

H.264 format

VideoFormatYuv

YUV format

  • AudioFormat: the enumeration of the audio format.

Enumeration Name

Description

AudioFormatNone

No specific format.

AudioFormatMixedPcm

PCM format after mixing.

AudioFormatPcmBeforeMixing

PCM format before mixing.

  • AliRtcDataMsgType: the enumeration of the message type.

Enumeration Name

Description

AliEngineDataMsgNone

No message.

AliEngineDataMsgMusicProgress

Progress message.

AliEngineDataMsgCustom

Custom message.

  • The AliRtcDataChannelMsg class defines a data channel message.

Parameter

Type

Description

type

AliRtcDataMsgType

The message type. Default value: AliEngineDataMsgNone.

networkTime

long

The Network Time Protocol (NTP) timestamp when the message was sent. This parameter is used only when `type` is set to `AliEngineDataMsgMusicProgress`.

progress

int

The current progress, in milliseconds. This parameter takes effect only if the value of the type parameter is AliEngineDataMsgMusicProgress.

data

byte[]

The data content carried by the message.

  • VideoFrameType: the enumeration of the type of video frames.

Enumeration name

Description

VideoFrameH264

H264 video frame format

VideoFrameH264Nalu

H264 NALU unit format

  • AudioFrameType: the enumeration of the type of audio frames.

Enumeration Name

Description

AudioFrameRawPcm

Raw PCM data.

AudioFrameAacAdts

Data in the AAC ADTS format.

  • AudioPcmFrame: the class of PCM frames of the audio.

Parameter

Type

Description

frame_ms

long

The timestamp of the frame.

channels

int

The number of sound channels. The value is 1 by default.

sample_bits

int

The bit depth of each sample. The value is 16 by default.

sample_rates

int

The audio sampling rate. Examples: 8 KHz, 16 KHz, and 32 KHz.

samples

int

The number of samples.

pcmBuf

byte[]

The PCM buffer.

pcmBufSize

int

The size of the PCM buffer.

  • AudioAacFrame: the class of AAC frames of the audio.

Parameter

Type

Description

frame_ms

long

The timestamp of the frame.

channels

int

The number of sound channels. The value is 1 by default.

sample_rates

int

The audio sampling rate. Examples: 8 KHz, 16 KHz, and 32 KHz.

aacBuf

byte[]

The AAC buffer.

aacBufSize

int

The size of the AAC buffer.

  • AudioFrame: the class of the audio frames.

Parameter

Type

Description

type

AudioFrameType

The type of the audio frames.

pcm

AudioPcmFrame

The PCM frames.

aac

AudioAacFrame

The AAC frames.

  • VideoH264Frame: the class of H.264 frames of the video.

Parameter

Type

Description

frame_ms

long

The frame timestamp.

frame_num

int

The sequence number of the video frame.

buf

byte[]

The H.264 buffer.

bufSize

int

The size of the H.264 buffer.

  • VideoFrame: the class of the video frames.

Parameter

Type

Description

track

VideoTrackType

The type of video track.

type

VideoFrameType

The type of the video frames.

h264

VideoH264Frame

The H.264 frames.

width

int

The width of the video frames.

height

int

The height of the video frames.

  • JoinChannelConfig: the class of the channel settings.

Parameter

Type

Description

isAudioOnly

boolean

Specifies whether to use the audio-only mode.

channelProfile

ChannelProfile

The channel profile.

publishMode

PublishMode

The stream ingest mode.

publishAvsyncMode

PublishAvsyncMode

The audio and video synchronization mode for stream ingest.

subscribeMode

SubscribeMode

The subscription mode.

subscribeVideoFormat

VideoFormat

The format of the subscribed video.

subscribeAudioFormat

AudioFormat

The format of the subscribed audio.

  • AuthInfo: the class of the authentication information.

Parameter

Type

Description

channel

String

The channel name.

userid

String

The user ID.

username

String

The username.

appid

String

The application ID.

nonce

String

A one-time random string that is used for security verification.

token

String

Authentication token

gslb

String[]

Array of Global Service Load Balancing servers.

agent

String[]

Proxy server array.

gslb_count

int

Indicates the number of actual servers in the GSLB array.

agent_count

int

The number of active servers in the agent array.

timestamp

long

The timestamp.

  • AliEnginePublishState: the enumeration of the stream ingest status.

Enumeration name

Description

AliEngineStatsPublishIdle

The initial state. Stream ingest has not started.

AliEngineStatsNoPublish

No stream is ingested.

AliEngineStatsPublishing

A stream is being ingested.

AliEngineStatsPublished

Stream ingestion has started.

  • AliEngineSubscribeState: the enumeration of the subscription status.

Enumeration name

Description

AliEngineStatsSubscribeIdle

The initial state. Subscription has not started.

AliEngineStatsNoSubscribe

No stream is subscribed to.

AliEngineStatsSubscribing

The subscription flow is running.

AliEngineStatsSubscribed

The subscription is complete.

  • AliEngineAudioQualityMode: the enumeration of the mode of audio quality.

Enumeration name

Description

AliEngineAudioLowQualityMode

Low audio quality mode: By default, the sampling rate is 8,000 Hz, a mono channel is supported, and the maximum bitrate is 12 Kbit/s.

AliEngineAudioBasicQualityMode

Standard audio quality mode: By default, the sampling rate is 16,000 Hz, a mono channel is supported, and the maximum bitrate is 24 Kbit/s.

AliEngineAudioHighQualityMode

High audio quality mode: By default, the sampling rate is 48,000 Hz, a mono channel is supported, and the maximum bitrate is 64 Kbit/s.

AliEngineAudioStereoHighQualityMode

High-quality stereo mode: By default, the sampling rate is 48,000 Hz, binaural channels are supported, and the maximum bitrate is 80 Kbit/s.

AliEngineSuperHighQualityMode

Ultra-high audio quality mode: By default, the sampling rate is 48,000 Hz, a mono channel is supported, and the maximum bitrate is 96 Kbit/s.

AliEngineStereoSuperHighQualityMode

Ultra-high-quality stereo mode: By default, the sampling rate is 48,000 Hz, binaural channels are supported, and the maximum bitrate is 128 Kbit/s.

  • AliEngineAudioSceneMode: the enumeration of the mode for the audio scenario.

Enumeration Name

Description

AliEngineAudioDefaultMode

The default mode. Audio 3A (automatic gain control, acoustic echo cancelling, and active noise suppression) processing is implemented based on hardware.

AliEngineAudioEducationMode

The education-related mode. Audio 3A processing is implemented based on hardware.

AliEngineAudioMediaMode

The media-related mode. Audio 3A processing is implemented based on basic software.

AliEngineAudioMusicMode

The music-related mode. Audio 3A processing is implemented based on music optimization software.

AliEngineAudioChatroomMode

The chatroom mode. Audio 3A processing is implemented based on hardware.

AliEngineAudioKtvMode

The karaoke mode. Audio 3A processing is implemented based on music optimization software and AAudio.

  • AliEngineVideoStreamType: the type of the video track.

Enumeration name

Description

AliEngineVideoStreamTypeNone

None. The OnSubscribeStreamTypeChanged callback returns a response that indicates no subscription.

AliEngineVideoStreamTypeHigh

High bitrate and high resolution (major stream).

AliEngineVideoStreamTypeLow

Low bitrate and low resolution (minor stream).

  • AliEngineMuteLocalAudioMode: the local mute mode.

Enumeration name

Description

AliEngineMuteLocalAudioModeDefault

Default mode. Mutes all audio, including audio from the microphone and external input.

AliEngineMuteLocalAudioModeMuteOnlyMic

Only the audio collected from the microphone is muted.

AliEngineMuteLocalAudioModeMuteAll

Mutes all audio, including audio from the microphone and external input.

  • AliEngineClientRole: the client role.

Enumeration name

Description

AliEngineClientRoleInteractive

Interactive role

AliEngineClientRoleLive

The viewer role.