#include <IAgoraRecordingEngine.h>

Public Member Functions

virtual ~IRecordingEngineEventHandler ()
 
virtual void onError (int error, agora::linuxsdk::STAT_CODE_TYPE stat_code)=0
 
virtual void onWarning (int warn)=0
 
virtual void onJoinChannelSuccess (const char *channelId, uid_t uid)=0
 
virtual void onLeaveChannel (agora::linuxsdk::LEAVE_PATH_CODE code)=0
 
virtual void onUserJoined (uid_t uid, agora::linuxsdk::UserJoinInfos &infos)=0
 
virtual void onUserOffline (uid_t uid, agora::linuxsdk::USER_OFFLINE_REASON_TYPE reason)=0
 
virtual void audioFrameReceived (unsigned int uid, const agora::linuxsdk::AudioFrame *frame) const =0
 
virtual void videoFrameReceived (unsigned int uid, const agora::linuxsdk::VideoFrame *frame) const =0
 
virtual void onActiveSpeaker (uid_t uid)=0
 

Detailed Description

The IRecordingEngineEventHandler class enables callbacks to your application.

Constructor & Destructor Documentation

◆ ~IRecordingEngineEventHandler()

virtual agora::recording::IRecordingEngineEventHandler::~IRecordingEngineEventHandler ( )
inlinevirtual

Member Function Documentation

◆ onError()

virtual void agora::recording::IRecordingEngineEventHandler::onError ( int  error,
agora::linuxsdk::STAT_CODE_TYPE  stat_code 
)
pure virtual

This callback is triggered when an error occurs during SDK runtime.

The SDK cannot fix the issue or resume running. It requires intervention from the application and informs the user on the issue.

Parameters
errorError codes.
stat_codeState codes.

◆ onWarning()

virtual void agora::recording::IRecordingEngineEventHandler::onWarning ( int  warn)
pure virtual

This callback is triggered when a warning occurs during SDK runtime.

In most cases, the application can ignore the warnings reported by the SDK because the SDK can usually fix the issue and resume running.

Parameters
warnWarning codes.

◆ onJoinChannelSuccess()

virtual void agora::recording::IRecordingEngineEventHandler::onJoinChannelSuccess ( const char *  channelId,
uid_t  uid 
)
pure virtual

This callback is triggered when the recording application joins the channel.

Parameters
channelIdChannel ID assigned based on the channel name specified in joinChannel.
uidThe user ID.

◆ onLeaveChannel()

virtual void agora::recording::IRecordingEngineEventHandler::onLeaveChannel ( agora::linuxsdk::LEAVE_PATH_CODE  code)
pure virtual

This callback is triggered when the recording application leaves the channel.

Parameters
codeThe reasons why the recording application leaves the channel. See the LEAVE_PATH_CODE.

◆ onUserJoined()

virtual void agora::recording::IRecordingEngineEventHandler::onUserJoined ( uid_t  uid,
agora::linuxsdk::UserJoinInfos infos 
)
pure virtual

This callback is triggered when a user joins the channel and returns the UID of the new user.

If there are users in the channel before the recording app joins the channel, the SDK will also reports on the UIDs of the existing users. This callback is triggered as many times as the number of the users in the channel.

Parameters
uidThe user ID.
infosUser information.

◆ onUserOffline()

virtual void agora::recording::IRecordingEngineEventHandler::onUserOffline ( uid_t  uid,
agora::linuxsdk::USER_OFFLINE_REASON_TYPE  reason 
)
pure virtual

This callback is triggered when a user leaves the channel or goes offline.

When no data package of a user is received for a certain period of time (15 seconds), the SDK assumes that the user has goes offline. Weak network connections may lead to misinformation, so Agora recommends using the signaling system for offline event detection.

Parameters
uidThe user ID.
reasonThe reasons why the user leaves the channel or goes offline.

◆ audioFrameReceived()

virtual void agora::recording::IRecordingEngineEventHandler::audioFrameReceived ( unsigned int  uid,
const agora::linuxsdk::AudioFrame frame 
) const
pure virtual

This callback is triggered when the raw audio data is received.

Parameters
uidThe user ID.
frameReceived raw audio data in PCM or AAC format. For more information, see AudioFrame.

◆ videoFrameReceived()

virtual void agora::recording::IRecordingEngineEventHandler::videoFrameReceived ( unsigned int  uid,
const agora::linuxsdk::VideoFrame frame 
) const
pure virtual

This callback is triggered when the raw video data is received.

This callback is triggered for every received raw video frame and can be used to detect sexually explicit content, if necessary. Agora recommends capturing the I frame only and neglecting the others.

Parameters
uidThe user ID.
frameReceived raw audio data in YUV, H.264 or JPG format. For more information, see VideoFrame.

◆ onActiveSpeaker()

virtual void agora::recording::IRecordingEngineEventHandler::onActiveSpeaker ( uid_t  uid)
pure virtual

This callback returns the UID of the active speaker in the channel.

Parameters
uidThe user ID.