CloudHub Docs
Download Documents

RTS


CloudHubRTS CPP

IDownStreamEventHandler

Pulling events

onFirstRemoteAudioFrame

Occurs when the engine receives the first audio frame from a specific remote stream.

void onFirstRemoteAudioFrame(cloudhub::IDownStream* stream)

Parameters

ParameterDescription
streamIDownStream object

onFirstRemoteVideoFrame

Occurs when the first remote video frame is decoded.

void onFirstRemoteVideoFrame(cloudhub::IDownStream* stream,
                                       int width,
                                       int height)

Parameters

ParameterDescription
streamIDownStream object
widthWidth (px) of the video frame
heightHeight (px) of the video stream

Details

The SDK triggers this callback when the first frame of the remote video is decoded

onRemoteVideoSizeChange

Occurs when the remote video size of a specified stream changes.

void onRemoteVideoSizeChange(cloudhub::IDownStream* stream,int width,int height)

Parameters

ParameterDescription
streamIDownStream object
widthNew width (pixels) of the video
heightNew height (pixels) of the video

onPullStatusUpdate

Occurs when the pull status changes

void onPullStatusUpdate(cloudhub::IDownStream* stream,
                                  CONNECTION_STATE_TYPE type)

Parameters

ParameterDescription
streamIDownStream object
typeState of the connection

onRemoteVideoStateChanged

Occurs when the remote video state changes.

void onRemoteVideoStateChanged(cloudhub::IDownStream* stream,
                                         RTS_VIDEO_STATE state)

Parameters

ParameterDescription
streamIDownStream object
stateState of the remote video. See RTS_VIDEO_STATE

onRemoteAudioStateChanged

Occurs when the remote audio state changes. This callback indicates the state change of the remote audio stream.

void onRemoteAudioStateChanged(cloudhub::IDownStream* stream,
                                         RTS_AUDIO_STATE state)

Parameters

ParameterDescription
streamIDownStream object
stateState of the remote audio. See RTS_AUDIO_STATE

onStatisticsUpdate

Occurs when statistics change

void onStatisticsUpdate(cloudhub::IDownStream* stream,
                                  cloudhub::RtcStats& stats)

Parameters

ParameterDescription
streamIDownStream object
statsStatistics of the data, see RtcStats

onAudioVolumeIndication

Reports the volume information of stream.

void onAudioVolumeIndication(cloudhub::IDownStream* stream,
                                       int volume)

Parameters

ParameterDescription
streamIDownStream object
volumeThe value ranges between 0 (lowest volume) and 255 (highest volume)

Details

By default, this callback is disabled. You can enable it by calling enableVolumeIndication.

onError

Reports an error during SDK runtime.

void onError(cloudhub::IDownStream* stream,
                       int code,
                       const char* msg)

Parameters

ParameterDescription
streamIDownStream object
errError code
msgPointer to the error message

Details

In most cases, the SDK cannot fix the issue and resume running. The SDK requires the application to take action or informs the user about the issue.