AgoraMediaMetadataDataSource
AgoraMediaMetadataDataSource protocol.
Implement all the callbacks in this class in the critical thread. We recommend avoiding any time-consuming operation in the critical thread.
metadataMaxSize
Occurs when the SDK requests the maximum size of the metadata.
- (NSInteger)metadataMaxSize;
After successfully complete the registration by calling setMediaMetadataDelegate, 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
Occurs when the SDK is ready to send metadata.
- (NSData * _Nullable)readyToSendMetadataAtTimestamp:(NSTimeInterval)timestamp sourceType:(AgoraVideoSourceType)sourceType;
This callback is triggered when the SDK is ready to send metadata.
Parameters
- timestamp
- The timestamp.
- sourceType
- Video data type. For details, see AgoraVideoSourceType.
Returns
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.