Agora RTC Objective-C API Reference  Refactor
Instance Methods
<AgoraMediaMetadataDataSource> Protocol Reference

Inherits <NSObject>.

Instance Methods

(NSInteger) - metadataMaxSize
 
(NSData *_Nullable) - readyToSendMetadataAtTimestamp:sourceType:
 

Detailed Description

The definition of the AgoraMediaMetadataDataSource protocol.

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

Method Documentation

◆ metadataMaxSize

- (NSInteger) metadataMaxSize
required

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

After successfully complete the registration by calling setMediaMetadataDelegate:withType:, 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.

◆ readyToSendMetadataAtTimestamp:sourceType:

- (NSData * _Nullable) readyToSendMetadataAtTimestamp: (NSTimeInterval)  timestamp
sourceType: (AgoraVideoSourceType sourceType 
required

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 metadataMaxSize callback.
Parameters
timestampThe timestamp.
sourceTypeVideo data type. See AgoraVideoSourceType.
Returns
The metadata that you want to send in the format of NSData, which includes the following parameters:
  • uid: The ID of the remote user who sends the metadata.
  • size: The size of the metadata.
  • buffer: The metadata data.
  • timeStampMs: The NTP timestamp (ms) when the metadata is sent.