Agora RTC Objective-C API Reference Refactor

Data Structures | Public Types | Public Member Functions
IMetadataObserver Class Referenceabstract

## Data Structures
struct | Metadata

## Public Types
enum | MAX_METADATA_SIZE_TYPE

## Public Member Functions
virtual int | getMaxMetadataSize ()
virtual bool | onReadyToSendMetadata (Metadata &metadata, VIDEO_SOURCE_TYPE source_type)=0
virtual void | onMetadataReceived (const Metadata &metadata)=0

## Detailed Description

Definition of IMetadataObserver

## Member Enumeration Documentation

## ◆ METADATA_TYPE

enum METADATA_TYPE

Metadata type of the observer. We only support video metadata for now.

Enumerator
UNKNOWN_METADATA | -1: The type of metadata is unknown.
VIDEO_METADATA | 0: The type of metadata is video.

## ◆ MAX_METADATA_SIZE_TYPE

enum MAX_METADATA_SIZE_TYPE

The maximum metadata size.

Enumerator
INVALID_METADATA_SIZE_IN_BYTE |
DEFAULT_METADATA_SIZE_IN_BYTE |
MAX_METADATA_SIZE_IN_BYTE |

## Constructor & Destructor Documentation

## ◆ ~IMetadataObserver()

virtual ~IMetadataObserver | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ getMaxMetadataSize()

virtual int getMaxMetadataSize | ( |  | ) |
| inline virtual

Occurs when the SDK requests the maximum size of the metadata.

After successfully complete the registration by calling `registerMediaMetadataObserver`, the SDK triggers this callback once every video frame is sent. You need to specify the maximum size of the metadata in the return value of this callback.

Returns
  The maximum size of the `buffer` of the metadata that you want to use. The highest value is 1024 bytes. Ensure that you set the return value.

## ◆ onReadyToSendMetadata()

virtual bool onReadyToSendMetadata | ( | Metadata & | metadata,
|  | VIDEO_SOURCE_TYPE | source_type
| ) |  |
| pure virtual

Occurs when the SDK is ready to send metadata.

This callback is triggered when the SDK is ready to send metadata.

Note
  Ensure that the size of the metadata does not exceed the value set in the `getMaxMetadataSize` callback.

Parameters

  source_type | Video data type. See `VIDEO_SOURCE_TYPE`.
  metadata | The metadata that the user wants to send. See `Metadata`.

Returns
  - `true`: Send the video frame.
  - `false`: Do not send the video frame.

## ◆ onMetadataReceived()

virtual void onMetadataReceived | ( | const Metadata & | metadata | ) |
| pure virtual

Occurs when the local user receives the metadata.

Parameters

  metadata | The metadata received. See `Metadata`.