IPacketObserver

The definition of IPacketObserver.

FOnReceiveAudioPacket

Occurs when the local user receives an audio packet.

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnReceiveAudioPacket, const FPacket&, packet);

Parameters

packet
The received audio packet, see FPacket.

Returns

  • true: The audio packet is received successfully.
  • false: The audio packet is discarded.

FOnReceiveVideoPacket

Occurs when the local user receives a video packet.

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnReceiveVideoPacket, const FPacket&, packet);

Parameters

packet
The received video packet, see FPacket.

Returns

  • true: The video packet is received successfully.
  • false: The video packet is discarded.

FOnSendAudioPacket

Occurs when the local user sends an audio packet.

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSendAudioPacket, const FPacket&, packet);

Parameters

packet
The sent audio packet, see FPacket.

Returns

  • true: The audio packet is sent successfully.
  • false: The audio packet is discarded.

FOnSendVideoPacket

Occurs when the local user sends a video packet.

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSendVideoPacket, const FPacket&, packet);

Parameters

packet
The sent video packet, see FPacket.

Returns

  • true: The video packet is sent successfully.
  • false: The video packet is discarded.

FOnStreamMessage

Occurs when the local user receives the data stream from the remote user.

DECLARE_DYNAMIC_MULTICAST_DELEGATE_FiveParams(FOnStreamMessage, int64, userId, int, streamId, FString, data, int64, length, int, sentTs);

The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the SendStreamMessage method.

Parameters

userId
The ID of the remote user sending the message.
streamId
The stream ID of the received message.
data
The data received.
length
The data length (byte).
sentTs
The time when the data stream is sent.

FOnStreamMessageError

Occurs when the local user does not receive the data stream from the remote user.

DECLARE_DYNAMIC_MULTICAST_DELEGATE_FiveParams(FOnStreamMessageError, int64, userId, int, streamId, int, code, int, missed, int, cached);

The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the SendStreamMessage method.

Parameters

userId
The ID of the remote user sending the message.
streamId
The stream ID of the received message.
code
The error code. See .
missed
The number of lost messages.
cached
Number of incoming cached messages when the data stream is interrupted.

FOnUplinkNetworkInfoUpdated

Occurs when the uplink network information changes.

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnUplinkNetworkInfoUpdated, const FUplinkNetworkInfo&, info);

The SDK triggers this callback when the uplink network information changes.

Attention: This callback only applies to scenarios where you push externally encoded video data in H.264 format to the SDK.

Parameters

info
The uplink network information. See FUplinkNetworkInfo.