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 | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ onSendAudioPacket()

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

Occurs when the local user sends an audio packet.

Parameters

  packet | The sent audio packet, see `Packet`.

Returns
  - `true`: The audio packet is sent successfully.
  - `false`: The audio packet is discarded.

## ◆ onSendVideoPacket()

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

Occurs when the local user sends a video packet.

Parameters

  packet | The sent video packet, see `Packet`.

Returns
  - `true`: The video packet is sent successfully.
  - `false`: The video packet is discarded.

## ◆ onReceiveAudioPacket()

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

Occurs when the local user receives an audio packet.

Parameters

  packet | The received audio packet, see `Packet`.

Returns
  - `true`: The audio packet is received successfully.
  - `false`: The audio packet is discarded.

## ◆ onReceiveVideoPacket()

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

Occurs when the local user receives a video packet.

Parameters

  packet | The received video packet, see `Packet`.

Returns
  - `true`: The video packet is received successfully.
  - `false`: The video packet is discarded.