On-premise Recording SDK v3.0.6 API Reference for Linux (C++)
Classes | Typedefs | Enumerations
agora::linuxsdk Namespace Reference

Classes

class   IEngine
 
class   IEngineConfig
 
struct   UserInfo
 
struct   AudioVolumeInfo
 
struct   RemoteVideoStats
 
struct   RemoteAudioStats
 
struct   RecordingStats
 
class   AudioPcmFrame
 
class   AudioAacFrame
 
struct   AudioFrame
 
class   VideoYuvFrame
 
struct   VideoH264Frame
 
struct   VideoH265Frame
 
struct   VideoJpgFrame
 
struct   VideoJpgFile
 
struct   VideoFrame
 
struct   LiteraWatermarkConfig
 
struct   TimestampWatermarkConfig
 
struct   ImageWatermarkConfig
 
struct   WatermarkConfig
 
struct   VideoMixingLayout
 
struct   UserJoinInfos
 

Typedefs

typedef unsigned char  uchar_t
 
typedef unsigned int  uint_t
 
typedef unsigned int  uid_t
 
typedef uint64_t  u64_t
 
typedef struct agora::linuxsdk::VideoMixingLayout  VideoMixingLayout
 
typedef struct agora::linuxsdk::UserJoinInfos  UserJoinInfos
 

Enumerations

enum   ERROR_CODE_TYPE { ERR_OK = 0 , ERR_FAILED = 1 , ERR_INVALID_ARGUMENT = 2 , ERR_INTERNAL_FAILED = 3 }
 
enum   STAT_CODE_TYPE {
  STAT_OK = 0 , STAT_ERR_FROM_ENGINE = 1 , STAT_ERR_ARS_JOIN_CHANNEL = 2 , STAT_ERR_CREATE_PROCESS = 3 ,
  STAT_ERR_MIXED_INVALID_VIDEO_PARAM = 4 , STAT_ERR_NULL_POINTER = 5 , STAT_ERR_PROXY_SERVER_INVALID_PARAM = 6 , STAT_POLL_ERR = 0x8 ,
  STAT_POLL_HANG_UP = 0x10 , STAT_POLL_NVAL = 0x20
}
 
enum   LEAVE_PATH_CODE {
  LEAVE_CODE_INIT = 0 , LEAVE_CODE_SIG = 1<<1 , LEAVE_CODE_NO_USERS = 1<<2 , LEAVE_CODE_TIMER_CATCH = 1<<3 ,
  LEAVE_CODE_CLIENT_LEAVE = 1 << 4
}
 
enum   WARN_CODE_TYPE {
  WARN_NO_AVAILABLE_CHANNEL = 103 , WARN_LOOKUP_CHANNEL_TIMEOUT = 104 , WARN_LOOKUP_CHANNEL_REJECTED = 105 , WARN_OPEN_CHANNEL_TIMEOUT = 106 ,
  WARN_OPEN_CHANNEL_REJECTED = 107 , WARN_RECOVERY_CORE_SERVICE_FAILURE = 108 , WARN_DECRYPTION_FAILED = 120
}
 
enum   CHANNEL_PROFILE_TYPE { CHANNEL_PROFILE_COMMUNICATION = 0 , CHANNEL_PROFILE_LIVE_BROADCASTING = 1 }
 
enum   USER_OFFLINE_REASON_TYPE { USER_OFFLINE_QUIT = 0 , USER_OFFLINE_DROPPED = 1 , USER_OFFLINE_BECOME_AUDIENCE = 2 }
 
enum   REMOTE_VIDEO_STREAM_TYPE { REMOTE_VIDEO_STREAM_HIGH = 0 , REMOTE_VIDEO_STREAM_LOW = 1 }
 
enum   VIDEO_FORMAT_TYPE {
  VIDEO_FORMAT_DEFAULT_TYPE = 0 , VIDEO_FORMAT_H264_FRAME_TYPE = 1 , VIDEO_FORMAT_ENCODED_FRAME_TYPE = VIDEO_FORMAT_H264_FRAME_TYPE , VIDEO_FORMAT_YUV_FRAME_TYPE = 2 ,
  VIDEO_FORMAT_JPG_FRAME_TYPE = 3 , VIDEO_FORMAT_JPG_FILE_TYPE = 4 , VIDEO_FORMAT_JPG_VIDEO_FILE_TYPE = 5
}
 
enum   AUDIO_FORMAT_TYPE { AUDIO_FORMAT_DEFAULT_TYPE = 0 , AUDIO_FORMAT_AAC_FRAME_TYPE = 1 , AUDIO_FORMAT_PCM_FRAME_TYPE = 2 , AUDIO_FORMAT_MIXED_PCM_FRAME_TYPE = 3 }
 
enum   AUDIO_FRAME_TYPE { AUDIO_FRAME_RAW_PCM = 0 , AUDIO_FRAME_AAC = 1 }
 
enum   MEMORY_TYPE { STACK_MEM_TYPE = 0 , HEAP_MEM_TYPE = 1 }
 
enum   VIDEO_FRAME_TYPE {
  VIDEO_FRAME_RAW_YUV = 0 , VIDEO_FRAME_H264 = 1 , VIDEO_FRAME_JPG = 2 , VIDEO_FRAME_H265 = 3 ,
  VIDEO_JPG_FILE = 4
}
 
enum   SERVICE_MODE { RECORDING_MODE = 0 , SERVER_MODE = 1 , IOT_MODE = 2 }
 
enum   TRIGGER_MODE_TYPE { AUTOMATICALLY_MODE = 0 , MANUALLY_MODE = 1 }
 
enum   LANGUAGE_TYPE { CPP_LANG = 0 , JAVA_LANG = 1 }
 
enum   AUDIO_PROFILE_TYPE { AUDIO_PROFILE_DEFAULT = 0 , AUDIO_PROFILE_HIGH_QUALITY = 1 , AUDIO_PROFILE_HIGH_QUALITY_STEREO = 2 }
 
enum   agora_log_level {
  AGORA_LOG_LEVEL_FATAL = 1 , AGORA_LOG_LEVEL_ERROR = 2 , AGORA_LOG_LEVEL_WARN = 3 , AGORA_LOG_LEVEL_NOTICE = 4 ,
  AGORA_LOG_LEVEL_INFO = 5 , AGORA_LOG_LEVEL_DEBUG = 6
}
 
enum   RemoteStreamStateChangedReason { REASON_REMOTE_STREAM_STARTED , REASON_REMOTE_STREAM_STOPPED }
 
enum   RemoteStreamState { REMOTE_STREAM_STATE_RUNNING , REMOTE_STREAM_STATE_STOPPED }
 
enum   MIXED_AV_CODEC_TYPE {
  MIXED_AV_DEFAULT = 0 , MIXED_AV_CODEC_V1 = 1 , MIXED_AV_CODEC_V2 = 2 , AV_CODEC_INDIVIDUAL_TS_ONLY = 4 ,
  AV_CODEC_INDIVIDUAL_TS_AND_MP4 = 5 , AV_CODEC_MIXED_TS_ONLY = 6 , AV_CODEC_MIXED_TS_AND_MP4 = 7
}
 
enum   ClientRoleType { CLIENT_ROLE_BROADCASTER = 1 , CLIENT_ROLE_AUDIENCE =2 }
 
enum   ConnectionStateType {
  CONNECTION_STATE_DISCONNECTED = 1 , CONNECTION_STATE_CONNECTING = 2 , CONNECTION_STATE_CONNECTED = 3 , CONNECTION_STATE_RECONNECTING = 4 ,
  CONNECTION_STATE_FAILED = 5
}
 
enum   ConnectionChangedReasonType {
  CONNECTION_CHANGED_CONNECTING = 0 , CONNECTION_CHANGED_JOIN_SUCCESS = 1 , CONNECTION_CHANGED_INTERRUPTED = 2 , CONNECTION_CHANGED_BANNED_BY_SERVER = 3 ,
  CONNECTION_CHANGED_JOIN_FAILED = 4 , CONNECTION_CHANGED_LEAVE_CHANNEL = 5
}
 
enum   MAX_USER_ACCOUNT_LENGTH_TYPE { MAX_USER_ACCOUNT_LENGTH = 256 }
 
enum   WatermarkType { WATERMARK_TYPE_LITERA , WATERMARK_TYPE_TIMESTAMP , WATERMARK_TYPE_IMAGE }
 
enum   UID_LIST_TYPE { UID_SUBSCRIBE_WHITE_LIST = 0 , UID_SUBSCRIBE_BLACK_LIST }
 

Typedef Documentation

◆ uchar_t

typedef unsigned char agora::linuxsdk::uchar_t

◆ uint_t

typedef unsigned int agora::linuxsdk::uint_t

◆ uid_t

typedef unsigned int agora::linuxsdk::uid_t

◆ u64_t

typedef uint64_t agora::linuxsdk::u64_t

◆ VideoMixingLayout

The layout setting of the videos in composite recording mode.

◆ UserJoinInfos

User information.

Enumeration Type Documentation

◆ ERROR_CODE_TYPE

Error codes.

Note
When using the Agora Recording SDK, you may also receive error codes from the Agora Native SDK. See more error codes.
Enumerator
ERR_OK 

0: No error.

ERR_FAILED 

1: General error with no classified reason.

ERR_INVALID_ARGUMENT 

2: Invalid parameter. For example, the specific channel name contains illegal characters.

ERR_INTERNAL_FAILED 

3: The SDK module is not ready. Agora recommends the following methods to solve this error:

  • Check the audio device.
  • Check the completeness of the app.
  • Re-initialize the SDK.

◆ STAT_CODE_TYPE

State codes.

Enumerator
STAT_OK 

0: Everything is normal.

STAT_ERR_FROM_ENGINE 

1: Errors from the Agora Native SDK. See more Error Codes.

STAT_ERR_ARS_JOIN_CHANNEL 

2: Failure to join the channel.

STAT_ERR_CREATE_PROCESS 

3: Failure to create a process.

STAT_ERR_MIXED_INVALID_VIDEO_PARAM 

4: Invalid parameters of the video profile of the mixed video. See Video Profile Table to set the mixResolution parameter.

STAT_ERR_NULL_POINTER 

5: Null pointer.

STAT_ERR_PROXY_SERVER_INVALID_PARAM 

6: Invalid parameters of the proxy server.

STAT_POLL_ERR 

0x8: Error in polling.

STAT_POLL_HANG_UP 

0x10: Polling hangs up.

STAT_POLL_NVAL 

0x20: Invalid polling request.

◆ LEAVE_PATH_CODE

The reasons why the recording server leaves the channel. You can perform a bitwise AND operation on the code and each enum value, and those with non-zero results are the reason for the exit. For example, if you perform a bit-by-bit AND operation on code 6 (binary 110) and each enum value, only LEAVE_CODE_SIG (binary 10) and LEAVE_CODE_NO_USERS (binary 100) get a non-zero result. The reasons for exiting, in this case, include a timeout and a signal triggering the exit.

Enumerator
LEAVE_CODE_INIT 

0: The initialization fails.

LEAVE_CODE_SIG 

2 (binary 10): The AgoraCoreService process receives the SIGINT signal.

LEAVE_CODE_NO_USERS 

4 (binary 100): The recording server automatically leaves the channel and stops recording because the channel has no user.

LEAVE_CODE_TIMER_CATCH 

8 (binary 1000): Ignore it.

LEAVE_CODE_CLIENT_LEAVE 

16 (binary 10000): The recording server calls the leaveChannel method to leave the channel.

◆ WARN_CODE_TYPE

Warning codes.

Note
When using the Agora Recording SDK, you may also receive warning codes from the Native SDK. See Interactive Broadcast Warning Codes.
Enumerator
WARN_NO_AVAILABLE_CHANNEL 

103: No channel resources are available. Maybe because the server cannot allocate any channel resource.

WARN_LOOKUP_CHANNEL_TIMEOUT 

104: A timeout when looking up the channel. When a user joins a channel, the SDK looks up the specified channel. This warning usually occurs when the network conditions are too poor to connect to the server.

WARN_LOOKUP_CHANNEL_REJECTED 

105: The server rejected the request to look up the channel. The server cannot process this request or the request is illegal.

WARN_OPEN_CHANNEL_TIMEOUT 

106: A timeout occurred when opening the channel. Once the specific channel is found, the SDK opens the channel. This warning usually occurs when the network conditions are too poor to connect to the server.

WARN_OPEN_CHANNEL_REJECTED 

107: The server rejected the request to open the channel. The server cannot process this request or the request is illegal.

WARN_RECOVERY_CORE_SERVICE_FAILURE 

108: An abnormal error occurs. The SDK would resume the recording.

WARN_DECRYPTION_FAILED 

120: Error decryption mode or secret.

◆ CHANNEL_PROFILE_TYPE

Channel types.

Note
The Recording SDK must use the same channel profile as the Agora Native/Web SDK, otherwise issues may occur.
Enumerator
CHANNEL_PROFILE_COMMUNICATION 

0: (Default) Communication mode. This is used in one-on-one or group calls, where all users in the channel can talk freely.

CHANNEL_PROFILE_LIVE_BROADCASTING 

1: Live broadcast mode. The host sends and receives voice/video, while the audience only receives voice/video. Host and audience roles can be set by calling setClientRole.

◆ USER_OFFLINE_REASON_TYPE

The reasons why the user leaves the channel or goes offline.

Enumerator
USER_OFFLINE_QUIT 

0: The user has quit the call.

USER_OFFLINE_DROPPED 

1: The SDK timed out and the user dropped offline because it has not received any data packet for a period of time. If a user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user has dropped offline.

USER_OFFLINE_BECOME_AUDIENCE 

2: The client role has changed from the host to the audience. The option is only valid when you set the channel profile as live broadcast when calling joinChannel.

◆ REMOTE_VIDEO_STREAM_TYPE

Takes effect only when the Agora Native SDK has enabled dual-stream mode (high stream by default).

Enumerator
REMOTE_VIDEO_STREAM_HIGH 

0: (Default) High stream.

REMOTE_VIDEO_STREAM_LOW 

1: Low stream.

◆ VIDEO_FORMAT_TYPE

Video decoding format.

Enumerator
VIDEO_FORMAT_DEFAULT_TYPE 

0: Default video format. Depending on your codec, the recording service generates either MP4 or WebM files.

VIDEO_FORMAT_H264_FRAME_TYPE 

DEPRECATED 1: Video frame in H.264 format.

VIDEO_FORMAT_ENCODED_FRAME_TYPE 

1: Video frame in H.264 or H.265 format. You receive video frames from the videoFrameReceived callback.

VIDEO_FORMAT_YUV_FRAME_TYPE 

2: Video frame in YUV format. You receive video frames from the videoFrameReceived callback.

VIDEO_FORMAT_JPG_FRAME_TYPE 

3: Video frame in JPG format. You receive video frames from the videoFrameReceived callback.

VIDEO_FORMAT_JPG_FILE_TYPE 

4: JPG file format.

VIDEO_FORMAT_JPG_VIDEO_FILE_TYPE 

5: JPG file format and MP4 or WebM video.

  • Individual mode (isMixingEnabled is set as false): MP4 or WebM video and JPG files.
  • Composite mode (isMixingEnabled is set as true): MP4 or WebM video file for mixed streams and JPG files for individual streams.

◆ AUDIO_FORMAT_TYPE

Audio decoding format.

Enumerator
AUDIO_FORMAT_DEFAULT_TYPE 

0: Default audio file format (ACC).

AUDIO_FORMAT_AAC_FRAME_TYPE 

1: Audio frame in AAC format. You receive audio frames from the audioFrameReceived callback.

AUDIO_FORMAT_PCM_FRAME_TYPE 

2: Audio frame in PCM format. You receive audio frames from the audioFrameReceived callback.

AUDIO_FORMAT_MIXED_PCM_FRAME_TYPE 

3: Audio-mixing frame in PCM format. You receive audio frames from the audioFrameReceived callback.

◆ AUDIO_FRAME_TYPE

Audio frame type.

Enumerator
AUDIO_FRAME_RAW_PCM 

0: PCM format.

AUDIO_FRAME_AAC 

1: AAC format.

◆ MEMORY_TYPE

Memory type.

Enumerator
STACK_MEM_TYPE 

0: Stack.

HEAP_MEM_TYPE 

1: Heap.

◆ VIDEO_FRAME_TYPE

Video frame type.

Enumerator
VIDEO_FRAME_RAW_YUV 

0: YUV format.

VIDEO_FRAME_H264 

1: H.264 format.

VIDEO_FRAME_JPG 

2: JPG format.

VIDEO_FRAME_H265 

3: H.265 format.

VIDEO_JPG_FILE 

4: JPG file format.

◆ SERVICE_MODE

Enumerator
RECORDING_MODE 
SERVER_MODE 
IOT_MODE 

◆ TRIGGER_MODE_TYPE

Whether to record automatically or manually.

Enumerator
AUTOMATICALLY_MODE 

0: (Default) Automatically.

MANUALLY_MODE 

1: Manually. To start and stop recording, call startService and stopService respectively.

◆ LANGUAGE_TYPE

The programming language.

Enumerator
CPP_LANG 

0: (Default) C++.

JAVA_LANG 

1: Java.

◆ AUDIO_PROFILE_TYPE

Audio profile. Sets the sampling rate, bitrate, encode mode, and the number of channels.

Enumerator
AUDIO_PROFILE_DEFAULT 

0: (Default) Sampling rate of 48 kHz, communication encoding, mono, and a bitrate of up to 48 Kbps.

AUDIO_PROFILE_HIGH_QUALITY 

1: Sampling rate of 48 kHz, music encoding, mono, and a bitrate of up to 128 Kbps.

AUDIO_PROFILE_HIGH_QUALITY_STEREO 

2: Sampling rate of 48 kHz, music encoding, stereo, and a bitrate of up to 192 Kbps.

◆ agora_log_level

Log level.

Enumerator
AGORA_LOG_LEVEL_FATAL 

1: Fatal.

AGORA_LOG_LEVEL_ERROR 

2: Error.

AGORA_LOG_LEVEL_WARN 

3: Warning.

AGORA_LOG_LEVEL_NOTICE 

4: Notice.

AGORA_LOG_LEVEL_INFO 

5: Info.

AGORA_LOG_LEVEL_DEBUG 

6: Debug.

◆ RemoteStreamStateChangedReason

The reasons causing the change of the remote stream state.

Enumerator
REASON_REMOTE_STREAM_STARTED 

Starts pulling the stream of the remote user.

REASON_REMOTE_STREAM_STOPPED 

Stops pulling the stream of the remote user.

◆ RemoteStreamState

The states of the remote stream.

Enumerator
REMOTE_STREAM_STATE_RUNNING 

The remote stream is received normally.

REMOTE_STREAM_STATE_STOPPED 

The remote stream is stopped.

◆ MIXED_AV_CODEC_TYPE

Mix audio and video in real time. See Supported Players.

Enumerator
MIXED_AV_DEFAULT 

0: (Default) Mixes the audio and video respectively in the composite recording mode.

MIXED_AV_CODEC_V1 

1: Mixes the audio and video in real time into an MP4 file in the composite recording mode. Supports limited players.

MIXED_AV_CODEC_V2 

2: Mixes the audio and video in real time into an MP4 file in the composite recording mode. Supports more players.

AV_CODEC_INDIVIDUAL_TS_ONLY 

4: Generates video files in TS format, and audio files in AAC format in the individual recording mode.

Note
If you record a video file in TS format, the recorded file can still be played when a crash occurs.
AV_CODEC_INDIVIDUAL_TS_AND_MP4 

5: Generates video files in TS format and MP4 format, and audio files in AAC format in the individual recording mode.

Note
  • The recorded MP4 file is restored from the TS file when a crash occurs.
  • The Agora SDK deletes the TS file after successful recording.
AV_CODEC_MIXED_TS_ONLY 

6: Mixes the audio and video in real time into an TS file in the composite recording mode.

Note
If you record a video file in TS format, the recorded file can still be played when a crash occurs.
AV_CODEC_MIXED_TS_AND_MP4 

7: Mixes the audio and video in real time into an TS file and an MP4 file in the composite recording mode.

Note
  • The recorded MP4 file is restored from the TS file when a crash occurs.
  • The Agora SDK deletes the TS file after successful recording.

◆ ClientRoleType

User roles in a live broadcast.

Enumerator
CLIENT_ROLE_BROADCASTER 

The host in a live broadcast.

CLIENT_ROLE_AUDIENCE 

The audience in a live broadcast.

◆ ConnectionStateType

Connection states.

Enumerator
CONNECTION_STATE_DISCONNECTED 

1: The SDK is disconnected from Agora's edge server.

  • This is the initial state before calling the joinChannel method.
  • The SDK also enters this state when the application calls the leaveChannel method.
CONNECTION_STATE_CONNECTING 

2: The SDK is connecting to Agora's edge server.

CONNECTION_STATE_CONNECTED 

3: The SDK is connected to Agora's edge server and has joined a channel. You can now publish or subscribe to a media stream in the channel.

If the connection to the channel is lost because, for example, if the network is down or switched, the SDK automatically tries to reconnect and triggers:

CONNECTION_STATE_RECONNECTING 

4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues.

  • If the SDK cannot rejoin the channel within 10 seconds after being disconnected from Agora's edge server, the SDK triggers the onConnectionLost callback, stays in the CONNECTION_STATE_RECONNECTING state, and keeps rejoining the channel.
  • If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK triggers the onConnectionStateChanged callback, switches to the CONNECTION_STATE_FAILED state, and stops rejoining the channel.
CONNECTION_STATE_FAILED 

5: The SDK fails to connect to Agora's edge server or join the channel.

If the SDK is banned from joining the channel by Agora's edge server (through the RESTful API), the SDK triggers the onConnectionStateChanged callback and switches to the CONNECTION_STATE_FAILED state.

You must call the leaveChannel method to leave this state, and call the joinChannel method again to rejoin the channel.

◆ ConnectionChangedReasonType

Reasons for a connection state change.

Enumerator
CONNECTION_CHANGED_CONNECTING 

0: The SDK is connecting to Agora's edge server.

CONNECTION_CHANGED_JOIN_SUCCESS 

1: The SDK has joined the channel successfully.

CONNECTION_CHANGED_INTERRUPTED 

2: The connection between the SDK and Agora's edge server is interrupted.

CONNECTION_CHANGED_BANNED_BY_SERVER 

3: The connection between the SDK and Agora's edge server is banned by Agora's edge server.

CONNECTION_CHANGED_JOIN_FAILED 

4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel.

CONNECTION_CHANGED_LEAVE_CHANNEL 

5: The SDK has left the channel.

◆ MAX_USER_ACCOUNT_LENGTH_TYPE

Enumerator
MAX_USER_ACCOUNT_LENGTH 

◆ WatermarkType

Supported watermark types.

Enumerator
WATERMARK_TYPE_LITERA 

The text watermark.

WATERMARK_TYPE_TIMESTAMP 

The timestamp watermark.

WATERMARK_TYPE_IMAGE 

The image watermark.

◆ UID_LIST_TYPE

Enumerator
UID_SUBSCRIBE_WHITE_LIST 
UID_SUBSCRIBE_BLACK_LIST