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 an IRecordingEngine instance.

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
An IRecordingEngine instance.

◆ 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.

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.
Parameters
channelKeyThe channelKey for authentication. Set channelKey of the recording application the same as that of the Native/Web SDK. If the Native/Web SDK uses a token, channelKey must be set as the token. For more information, see Use Security Keys.
channelIdThe name of the channel to be recorded.
uidThe unique identifier of the recording application.
  • If you set uid as 0, the SDK randomly assigns a uid and returns it in the onJoinChannelSuccess callback.
  • If you set your own uid, it should be a 32-bit unsigned integer ranging from 1 to (232-1).
configDetailed recording configuration. See RecordingConfig.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setVideoMixingLayout()

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

This method sets the video layout in composite recording mode.

Note
If you record video in composite recording mode, you must call this method to set the video 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

TThis method allows you to retrieve the recording properties.

Note
  • Call this method after joining the channel.
  • The recording properties only include the information of the path where the recording files and log are stored.
  • Both the getProperties method and the onUserJoined callback report the relative path of the recorded files and recording log. The difference between these two functions is that the onUserJoined callback is only triggered when a remote user joins the channel.
Returns
RecordingEngineProperties.

◆ startService()

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

This method manually starts recording.

This method is valid only when you set triggerMode in RecordingConfig as 1 (manually).

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

◆ stopService()

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

This method manually stops recording.

This method is valid only when you set triggerMode in RecordingConfig as 1 (manually).

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 does not send any video stream, the background image is displayed.

Note
The background image is not displayed for users using the Agora Web SDK.
Parameters
uidThe UID of the user for whom the background image to be set.
img_pathThe path of the image file. Only supports local images in JPEG format.
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 output level.

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

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