Agora RTC Objective-C API Reference Refactor

Public Member Functions
IMediaControlPacketSender Class Referenceabstract

## Public Member Functions
virtual int | sendPeerMediaControlPacket (media::base::user_id_t userId, const uint8_t *packet, size_t length, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | sendBroadcastMediaControlPacket (const uint8_t *packet, size_t length, aosl_ref_t ares=AOSL_REF_INVALID)=0

## Detailed Description

The `IMediaControlPacketSender` class.

You can get the `IMediaControlPacketSender` class object from a video track or audio track, and then send media control packets directly. The media control packets are RTCP/UDP packets that contain media control payload. If the track is disabled, the packets will be automatically discarded.

## Constructor & Destructor Documentation

## ◆ ~IMediaControlPacketSender()

virtual ~IMediaControlPacketSender | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ sendPeerMediaControlPacket()

virtual int sendPeerMediaControlPacket | ( | media::base::user_id_t | userId,
|  | const uint8_t * | packet,
|  | size_t | length,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Sends the media control packet to a specified user. Currently, we only support sending packets through video tracks.

Parameters

  userId | ID of the user to send the packet to.
  packet | The pointer to the packet.
  length | The packet size.

Returns
  - `true`: Success.
  - `false`: Failure.

## ◆ sendBroadcastMediaControlPacket()

virtual int sendBroadcastMediaControlPacket | ( | const uint8_t * | packet,
|  | size_t | length,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Sends the media transport control packet to all users. Currently, we only support sending packets through video tracks.

Parameters

  packet | The pointer to the packet.
  length | The packet size.

Returns
  - `true`: Success.
  - `false`: Failure.