Public Member Functions

virtual ~IRecordingEngine ()
 
virtual int joinChannel (const char *channelKey, const char *channelId, uid_t uid, const RecordingConfig &config)=0
 
virtual int setVideoMixingLayout (const agora::linuxsdk::VideoMixingLayout &layout)=0
 
virtual int stoppedOnError ()=0
 
virtual int leaveChannel ()=0
 
virtual int release ()=0
 
virtual const RecordingEnginePropertiesgetProperties ()=0
 
virtual int startService ()=0
 
virtual int stopService ()=0
 
virtual int setUserBackground (uid_t uid, const char *img_path)=0
 
virtual int setLogLevel (agora::linuxsdk::agora_log_level level)=0
 

Static Public Member Functions

static IRecordingEnginecreateAgoraRecordingEngine (const char *appId, IRecordingEngineEventHandler *eventHandler)
 

Detailed Description

The IRecordingEngine class provides the main methods that can be invoked by your application.

Constructor & Destructor Documentation

◆ ~IRecordingEngine()

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

Member Function Documentation

◆ createAgoraRecordingEngine()

static IRecordingEngine* agora::recording::IRecordingEngine::createAgoraRecordingEngine ( const char *  appId,
IRecordingEngineEventHandler eventHandler 
)
static

This method creates the Agora recording engine object.

Parameters
appIdThe App ID used in the communications to be recorded. For more information, see Get an App ID.
eventHandlerThe Agora Recording SDK notifies the application of the triggered events by callbacks in the IRecordingEngineEventHandler.
Returns
  • 0: Success.
  • < 0: Failure.

◆ joinChannel()

virtual int agora::recording::IRecordingEngine::joinChannel ( const char *  channelKey,
const char *  channelId,
uid_t  uid,
const RecordingConfig config 
)
pure virtual

This method allows the recording application to join a channel and start recording.

Parameters
channelKeyThis parameter is optional if the user uses a static key, or App ID. In this case, pass NULL as the parameter value. For more information, see Use Security Keys.
channelIdName of the channel to be recorded. The length must be within 64 bytes. The following is the supported scope:
  • The 26 lowercase English letters from a to z
  • The 26 uppercase English letters from A to Z
  • The 10 numbers from 0 to 9
  • The space
  • "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ","
uidUID. A 32-bit unsigned integer ranging from 1 to (232-1) that is unique in a channel.
configDetailed recording configuration. See the structure RecordingConfig.
Returns
  • 0: Success.
  • < 0: Failure.
Note
  • In the Recording SDK, requestToken and renewToken are private methods. Make sure that you set expireTimestamp as 0 when generating a token, which means that the privilege, once generated, never expires.
  • A channel does not accept duplicate uids. Otherwise, there will be unpredictable behaviors.

◆ setVideoMixingLayout()

virtual int agora::recording::IRecordingEngine::setVideoMixingLayout ( const agora::linuxsdk::VideoMixingLayout layout)
pure virtual

This method sets the video mixing layout.

Parameters
layoutLayout setting. See VideoMixingLayout.
Returns
  • 0: Success.
  • < 0: Failure.

◆ stoppedOnError()

virtual int agora::recording::IRecordingEngine::stoppedOnError ( )
pure virtual

This method stops onError handler. It is called in onError handler when meeting an error which cannot be handled.

Returns
  • 0: Success.
  • < 0: Failure.

◆ leaveChannel()

virtual int agora::recording::IRecordingEngine::leaveChannel ( )
pure virtual

This method allows the recording application to leave the channel and release the thread resources.

Returns
  • 0: Success.
  • < 0: Failure.

◆ release()

virtual int agora::recording::IRecordingEngine::release ( )
pure virtual

This method destroys the IRecordingEngine object.

Returns
  • 0: Success.
  • < 0: Failure.

◆ getProperties()

virtual const RecordingEngineProperties* agora::recording::IRecordingEngine::getProperties ( )
pure virtual

This method allows you to retrieve the recording properties without joining a channel. For more information, see RecordingEngineProperties.

Returns
  • 0: Success.
  • < 0: Failure.
Note
  • The recording properties only include the information of the path where the recording files are stored.
  • This method is different from onUserJoined. You can only use the onUserJoined callback after joining the channel.

◆ startService()

virtual int agora::recording::IRecordingEngine::startService ( )
pure virtual

This method manually starts recording.

The method is only valid when you set triggerMode to 1 (manually) when joining the channel. For more information, see TRIGGER_MODE_TYPE.

Returns
  • 0: Success.
  • < 0: Failure.

◆ stopService()

virtual int agora::recording::IRecordingEngine::stopService ( )
pure virtual

This method manually stops recording.

The method is only valid when you set triggerMode to 1 (manually) when joining the channel. For more information, see TRIGGER_MODE_TYPE.

Returns
  • 0: Success.
  • < 0: Failure.

◆ setUserBackground()

virtual int agora::recording::IRecordingEngine::setUserBackground ( uid_t  uid,
const char *  img_path 
)
pure virtual

This method sets the background image of a specified user. When the user is online but not sending out any video stream, the background image is displayed.

Note
If the user uses Agora Web SDK, the user sends the audio and video stream all the time. In this case, the background image is not displayed.
Parameters
uidThe UID of the user for the background image to be set.
img_pathThe path of the image file.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setLogLevel()

virtual int agora::recording::IRecordingEngine::setLogLevel ( agora::linuxsdk::agora_log_level  level)
pure virtual

This method sets the log level.

Only log levels preceding the selected level are generated. The default value of the log level is 6.

Parameters
levelSee agora_log_level.
Returns
  • 0: Success.
  • < 0: Failure.