Agora Java API Reference for Android
Public Member Functions | Static Public Attributes | List of all members
io.agora.rtc2.IMetadataObserver Interface Reference

Public Member Functions

abstract int getMaxMetadataSize ()
 Occurs when the SDK requests the maximum size of the metadata. More...
 
abstract byte[] onReadyToSendMetadata (long timeStampMs, int sourceType)
 Occurs when the SDK is ready to send metadata. More...
 
abstract void onMetadataReceived (AgoraMetadata metadata)
 Occurs when the local user receives the metadata. More...
 

Static Public Attributes

static final int UNKNOWN_METADATA = -1
 
static final int VIDEO_METADATA = 0
 

Detailed Description

The definition of IMetadataObserver.

Note
Implement all the callbacks in this class in the critical thread. We recommend avoiding any time-consuming operation in the critical thread.

Member Function Documentation

◆ getMaxMetadataSize()

abstract int io.agora.rtc2.IMetadataObserver.getMaxMetadataSize ( )
abstract

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

abstract byte [] io.agora.rtc2.IMetadataObserver.onReadyToSendMetadata ( long  timeStampMs,
int  sourceType 
)
abstract

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
timeStampMsThe timestamp.
sourceTypeVideo data type. See VideoSourceType.
Returns
The metadata that you want to send in the format of byte. Ensure that you set the return value.

◆ onMetadataReceived()

abstract void io.agora.rtc2.IMetadataObserver.onMetadataReceived ( AgoraMetadata  metadata)
abstract

Occurs when the local user receives the metadata.

Parameters
metadataThe metadata received. See AgoraMetadata.

Member Data Documentation

◆ UNKNOWN_METADATA

final int io.agora.rtc2.IMetadataObserver.UNKNOWN_METADATA = -1
static

(Not supported) The metadata type is unknown.

◆ VIDEO_METADATA

final int io.agora.rtc2.IMetadataObserver.VIDEO_METADATA = 0
static

The metadata type is video.