Video SDK v3.7.1 API Reference for Unity
Public Member Functions | List of all members
agora_gaming_rtc.PacketObserver Class Reference

Inherits agora_gaming_rtc.IPacketObserver.

Public Member Functions

delegate bool OnReceiveAudioPacketHandler (Packet packet)
 
delegate bool OnReceiveVideoPacketHandler (Packet packet)
 
delegate bool OnSendVideoPacketHandler (Packet packet)
 
delegate bool OnSendAudioPacketHandler (Packet packet)
 
override int RegisterPacketObserver ()
 
override int UnRegisterPacketObserver ()
 

Detailed Description

The definition of PacketObserver.

Member Function Documentation

◆ OnReceiveAudioPacketHandler()

delegate bool agora_gaming_rtc.PacketObserver.OnReceiveAudioPacketHandler ( Packet  packet)

Occurs when the local user receives an audio packet.

Parameters
packetThe received audio packet. See Packet.
Returns
  • true: The audio packet is received successfully.
  • false: The audio packet is discarded.

◆ OnReceiveVideoPacketHandler()

delegate bool agora_gaming_rtc.PacketObserver.OnReceiveVideoPacketHandler ( Packet  packet)

Occurs when the local user receives a video packet.

Parameters
packetThe received video packet. See Packet.
Returns
  • true: The video packet is received successfully.
  • false: The video packet is discarded.

◆ OnSendVideoPacketHandler()

delegate bool agora_gaming_rtc.PacketObserver.OnSendVideoPacketHandler ( Packet  packet)

Occurs when the local user sends a video packet.

Parameters
packetThe sent video packet. See Packet.
Returns
  • true: The video packet is sent successfully.
  • false: The video packet is discarded.

◆ OnSendAudioPacketHandler()

delegate bool agora_gaming_rtc.PacketObserver.OnSendAudioPacketHandler ( Packet  packet)

Occurs when the local user sends an audio packet.

Parameters
packetThe sent audio packet. See Packet.
Returns
  • true: The audio packet is sent successfully.
  • false: The audio packet is discarded.

◆ GetInstance()

static PacketObserver agora_gaming_rtc.PacketObserver.GetInstance ( IRtcEngine  irtcEngine)
static

◆ ReleaseInstance()

static void agora_gaming_rtc.PacketObserver.ReleaseInstance ( )
static

◆ SetEngine()

void agora_gaming_rtc.PacketObserver.SetEngine ( IRtcEngine  irtcEngine)

◆ RegisterPacketObserver()

override int agora_gaming_rtc.PacketObserver.RegisterPacketObserver ( )
virtual

Registers a packet observer.

The Agora RTC SDK allows your application to register a packet observer to receive callbacks for voice or video packet transmission.

Note
  • The size of the packet sent to the network after processing should not exceed 1200 bytes, otherwise, the packet may fail to be sent.
  • Ensure that both receivers and senders call this method, otherwise, you may meet undefined behaviors such as no voice and black screen.
  • When you use CDN live streaming, capturing or storage functions, Agora doesn't recommend calling this method.
  • Call this method before joining a channel.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IPacketObserver.

◆ UnRegisterPacketObserver()

override int agora_gaming_rtc.PacketObserver.UnRegisterPacketObserver ( )
virtual

UnRegisters the packet observer.

Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IPacketObserver.

Member Data Documentation

◆ _OnReceiveAudioPacket

OnReceiveAudioPacketHandler agora_gaming_rtc.PacketObserver._OnReceiveAudioPacket

◆ _OnReceiveVideoPacket

OnReceiveVideoPacketHandler agora_gaming_rtc.PacketObserver._OnReceiveVideoPacket

◆ _OnSendVideoPacket

OnSendVideoPacketHandler agora_gaming_rtc.PacketObserver._OnSendVideoPacket

◆ _OnSendAudioPacket

OnSendAudioPacketHandler agora_gaming_rtc.PacketObserver._OnSendAudioPacket

◆ _packetObserver

PacketObserver agora_gaming_rtc.PacketObserver._packetObserver = null
static

The documentation for this class was generated from the following file: