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
 
virtual void onAudioVolumeIndication (const agora::linuxsdk::AudioVolumeInfo *speakers, unsigned int speakerNum)=0
 
virtual void onFirstRemoteVideoDecoded (uid_t uid, int width, int height, int elapsed)=0
 
virtual void onFirstRemoteAudioFrame (uid_t uid, int elapsed)=0
 
virtual void onReceivingStreamStatusChanged (bool receivingAudio, bool receivingVideo)=0
 
virtual void onConnectionLost ()=0
 
virtual void onConnectionInterrupted ()=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

Occurs 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

Occurs 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

Occurs 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

Occurs 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

Occurs 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

Occurs 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

Occurs when the raw audio data is received.

Parameters
uidThe user ID.
frameThe received 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

Occurs 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.
frameThe received 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

Reports the user who speaks loudest.

If you set the audioIndicationInterval parameter in RecordingConfig to be greater than 0, this callback returns the uid of the user with the highest volume over a certain time period.

Parameters
uidThe ID of the user with the highest volume over a certain time period.

◆ onAudioVolumeIndication()

virtual void agora::recording::IRecordingEngineEventHandler::onAudioVolumeIndication ( const agora::linuxsdk::AudioVolumeInfo speakers,
unsigned int  speakerNum 
)
pure virtual

Reports the list of users who are speaking and their volumes.

This callback works only when the audioIndicationInterval parameter in RecordingConfig is set to be greater than 0.

Parameters
speakersAn array containing the user ID and volume information for each speaker. For more information, see AudioVolumeInfo.
speakerNumThe total number of users who are speaking.

◆ onFirstRemoteVideoDecoded()

virtual void agora::recording::IRecordingEngineEventHandler::onFirstRemoteVideoDecoded ( uid_t  uid,
int  width,
int  height,
int  elapsed 
)
pure virtual

Occurs when the first remote video frame is decoded.

This callback is triggered when the first frame of the remote video is received and decoded.

Parameters
uidThe user ID.
widthThe width of the video frame.
heightThe height of the video frame.
elapsedTime elapsed (ms) from the local user calling joinChannel until this callback is triggered.

◆ onFirstRemoteAudioFrame()

virtual void agora::recording::IRecordingEngineEventHandler::onFirstRemoteAudioFrame ( uid_t  uid,
int  elapsed 
)
pure virtual

Occurs when the first remote audio frame is received.

Parameters
uidThe user ID.
elapsedTime elapsed (ms) from the local user calling joinChannel until this callback is triggered.

◆ onReceivingStreamStatusChanged()

virtual void agora::recording::IRecordingEngineEventHandler::onReceivingStreamStatusChanged ( bool  receivingAudio,
bool  receivingVideo 
)
pure virtual

Occurs when the status of receiving the audio or video stream changes.

Parameters
receivingAudioWhether or not the recording application is receiving the audio stream.
receivingVideoWhether or not the recording application is receiving the video stream.

◆ onConnectionLost()

virtual void agora::recording::IRecordingEngineEventHandler::onConnectionLost ( )
pure virtual

Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted.

The SDK triggers this callback when it cannot connect to the server 10 seconds after calling joinChannel, regardless of whether it is in the channel or not.

This callback is different from onConnectionInterrupted:

  • The SDK triggers the onConnectionInterrupted callback when the SDK loses connection with the server for more than 4 seconds after it joins the channel.
  • The SDK triggers the onConnectionLost callback when the SDK loses connection with the server for more than 10 seconds, regardless of whether it joins the channel or not.

For both callbacks, the SDK tries to reconnect to the server until the app calls leaveChannel.

◆ onConnectionInterrupted()

virtual void agora::recording::IRecordingEngineEventHandler::onConnectionInterrupted ( )
pure virtual

Occurs when the connection between the SDK and the server is interrupted.

The SDK triggers this callback when it loses connection to the server for more than 4 seconds after the connection is established. After triggering this callback, the SDK tries to reconnect to the server. You can use this callback to implement pop-up reminders.

This callback is different from onConnectionInterrupted:

  • The SDK triggers the onConnectionInterrupted callback when the SDK loses connection with the server for more than 4 seconds after it joins the channel.
  • The SDK triggers the onConnectionLost callback when the SDK loses connection with the server for more than 10 seconds, regardless of whether it joins the channel or not.

For both callbacks, the SDK tries to reconnect to the server until the app calls leaveChannel.