Agora RTC Objective-C API Reference Refactor

Data Structures | Public Member Functions
IPacketObserver Class Referenceabstract

## Data Structures
struct | Packet

## Public Member Functions
virtual bool | onSendAudioPacket (Packet &packet)=0
virtual bool | onSendVideoPacket (Packet &packet)=0
virtual bool | onReceiveAudioPacket (Packet &packet)=0
virtual bool | onReceiveVideoPacket (Packet &packet)=0

## Detailed Description

The definition of the IPacketObserver struct.

## Constructor & Destructor Documentation

## ◆ ~IPacketObserver()

virtual ~IPacketObserver | ( |  | ) |
| inlinevirtual

## Member Function Documentation

## ◆ onSendAudioPacket()

virtual bool onSendAudioPacket | ( | Packet & | packet | ) |
| pure virtual

Occurs when the SDK is ready to send the audio packet.

Parameters

  packet | The audio packet to be sent: Packet.

Returns
  Whether to send the audio packet:
  - true: Send the packet.
  - false: Do not send the packet, in which case the audio packet will be discarded.

## ◆ onSendVideoPacket()

virtual bool onSendVideoPacket | ( | Packet & | packet | ) |
| pure virtual

Occurs when the SDK is ready to send the video packet.

Parameters

  packet | The video packet to be sent: Packet.

Returns
  Whether to send the video packet:
  - true: Send the packet.
  - false: Do not send the packet, in which case the audio packet will be discarded.

## ◆ onReceiveAudioPacket()

virtual bool onReceiveAudioPacket | ( | Packet & | packet | ) |
| pure virtual

Occurs when the audio packet is received.

Parameters

  packet | The received audio packet: Packet.

Returns
  Whether to process the audio packet:
  - true: Process the packet.
  - false: Do not process the packet, in which case the audio packet will be discarded.

## ◆ onReceiveVideoPacket()

virtual bool onReceiveVideoPacket | ( | Packet & | packet | ) |
| pure virtual

Occurs when the video packet is received.

Parameters

  packet | The received video packet: Packet.

Returns
  Whether to process the audio packet:
  - true: Process the packet.
  - false: Do not process the packet, in which case the video packet will be discarded.