Agora Java API Reference for Android

Classes | Public Member Functions | List of all members
agora::rtc::IPacketObserver Class Referenceabstract

`#include <AgoraBase.h>`

## Classes
struct | Packet
| Configurations for the `Packet` instance. More...

## Public Member Functions
virtual bool | onSendAudioPacket (Packet &packet)=0
| Occurs when the local user sends an audio packet. More...
virtual bool | onSendVideoPacket (Packet &packet)=0
| Occurs when the local user sends a video packet. More...
virtual bool | onReceiveAudioPacket (Packet &packet)=0
| Occurs when the local user receives an audio packet. More...
virtual bool | onReceiveVideoPacket (Packet &packet)=0
| Occurs when the local user receives a video packet. More...

## Detailed Description

The definition of the IPacketObserver struct.

## Member Function Documentation

## ◆ onSendAudioPacket()

virtual bool agora::rtc::IPacketObserver::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 agora::rtc::IPacketObserver::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 agora::rtc::IPacketObserver::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 agora::rtc::IPacketObserver::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.