1 #ifndef _IAGORA_RECORDINGENGINE_H_
2 #define _IAGORA_RECORDINGENGINE_H_
3 #include "IAgoraLinuxSdkCommon.h"
4 
5 namespace agora {
6 namespace recording {
11 
12 public:
14 
23  virtual void onError(int error, agora::linuxsdk::STAT_CODE_TYPE stat_code) = 0;
24 
32  virtual void onWarning(int warn) = 0;
33 
40  virtual void onJoinChannelSuccess(const char * channelId, uid_t uid) = 0;
41 
47  virtual void onLeaveChannel(agora::linuxsdk::LEAVE_PATH_CODE code) = 0;
48 
57  virtual void onUserJoined(uid_t uid, agora::linuxsdk::UserJoinInfos &infos) = 0;
58 
67  virtual void onUserOffline(uid_t uid, agora::linuxsdk::USER_OFFLINE_REASON_TYPE reason) = 0;
68 
75  virtual void audioFrameReceived(unsigned int uid, const agora::linuxsdk::AudioFrame *frame) const = 0;
76 
85  virtual void videoFrameReceived(unsigned int uid, const agora::linuxsdk::VideoFrame *frame) const = 0;
86 
92  virtual void onActiveSpeaker(uid_t uid) = 0;
93 };
94 
96 typedef struct RecordingConfig {
179  char * secret;
181  char * appliteDir;
187  char * cfgFilePath;
237  char * proxyServer;
248 
249 
250  RecordingConfig(): channelProfile(agora::linuxsdk::CHANNEL_PROFILE_COMMUNICATION),
251  isAudioOnly(false),
252  isVideoOnly(false),
253  isMixingEnabled(false),
254  mixResolution(NULL),
255  decryptionMode(NULL),
256  secret(NULL),
257  idleLimitSec(300),
258  appliteDir(NULL),
259  recordFileRootDir(NULL),
260  cfgFilePath(NULL),
261  lowUdpPort(0),
262  highUdpPort(0),
263  captureInterval(5),
264  decodeAudio(agora::linuxsdk::AUDIO_FORMAT_DEFAULT_TYPE),
265  decodeVideo(agora::linuxsdk::VIDEO_FORMAT_DEFAULT_TYPE),
266  mixedVideoAudio(agora::linuxsdk::MIXED_AV_DEFAULT),
267  streamType(agora::linuxsdk::REMOTE_VIDEO_STREAM_HIGH),
268  triggerMode(agora::linuxsdk::AUTOMATICALLY_MODE),
269  lang(agora::linuxsdk::CPP_LANG),
270  proxyServer(NULL),
271  audioProfile(agora::linuxsdk::AUDIO_PROFILE_DEFAULT),
272  defaultVideoBg(NULL),
273  defaultUserBg(NULL)
274  {}
275 
276  virtual ~RecordingConfig() {}
278 
282  char* storageDir;
284  {}
286 
289 public:
290 
300  static IRecordingEngine* createAgoraRecordingEngine(const char * appId, IRecordingEngineEventHandler *eventHandler);
301 
302  virtual ~IRecordingEngine() {}
303 
323  virtual int joinChannel(const char * channelKey, const char *channelId, uid_t uid, const RecordingConfig &config) = 0;
324 
332  virtual int setVideoMixingLayout(const agora::linuxsdk::VideoMixingLayout &layout) = 0;
333 
340  virtual int stoppedOnError() = 0;
341 
348  virtual int leaveChannel() = 0;
349 
356  virtual int release() = 0;
357 
368  virtual const RecordingEngineProperties* getProperties() = 0;
369 
378  virtual int startService() = 0;
379 
388  virtual int stopService() = 0;
389 
399  virtual int setUserBackground(uid_t uid, const char* img_path) = 0;
400 
410  virtual int setLogLevel(agora::linuxsdk::agora_log_level level) = 0;
411 
412 };
413 
414 }
415 }
416 
417 #endif
LEAVE_PATH_CODE
Definition: IAgoraLinuxSdkCommon.h:70
VIDEO_FORMAT_TYPE
Definition: IAgoraLinuxSdkCommon.h:136
char * recordFileRootDir
Definition: IAgoraRecordingEngine.h:184
virtual void videoFrameReceived(unsigned int uid, const agora::linuxsdk::VideoFrame *frame) const =0
CHANNEL_PROFILE_TYPE
Definition: IAgoraLinuxSdkCommon.h:105
agora::linuxsdk::REMOTE_VIDEO_STREAM_TYPE streamType
Definition: IAgoraRecordingEngine.h:231
RecordingConfig()
Definition: IAgoraRecordingEngine.h:250
virtual int setUserBackground(uid_t uid, const char *img_path)=0
virtual void onJoinChannelSuccess(const char *channelId, uid_t uid)=0
Definition: IAgoraLinuxSdkCommon.h:7
TRIGGER_MODE_TYPE
Definition: IAgoraLinuxSdkCommon.h:193
char * storageDir
Definition: IAgoraRecordingEngine.h:282
agora::linuxsdk::MIXED_AV_CODEC_TYPE mixedVideoAudio
Definition: IAgoraRecordingEngine.h:128
agora::linuxsdk::AUDIO_PROFILE_TYPE audioProfile
Definition: IAgoraRecordingEngine.h:239
int idleLimitSec
Definition: IAgoraRecordingEngine.h:215
virtual int setVideoMixingLayout(const agora::linuxsdk::VideoMixingLayout &layout)=0
char * defaultUserBg
Definition: IAgoraRecordingEngine.h:247
virtual int setLogLevel(agora::linuxsdk::agora_log_level level)=0
agora::linuxsdk::TRIGGER_MODE_TYPE triggerMode
Definition: IAgoraRecordingEngine.h:233
agora::linuxsdk::AUDIO_FORMAT_TYPE decodeAudio
Definition: IAgoraRecordingEngine.h:200
virtual void onLeaveChannel(agora::linuxsdk::LEAVE_PATH_CODE code)=0
Definition: IAgoraLinuxSdkCommon.h:507
agora::linuxsdk::VIDEO_FORMAT_TYPE decodeVideo
Definition: IAgoraRecordingEngine.h:194
Definition: IAgoraLinuxSdkCommon.h:413
USER_OFFLINE_REASON_TYPE
Definition: IAgoraLinuxSdkCommon.h:114
agora_log_level
Definition: IAgoraLinuxSdkCommon.h:220
virtual ~IRecordingEngineEventHandler()
Definition: IAgoraRecordingEngine.h:13
char * mixResolution
Definition: IAgoraRecordingEngine.h:169
int lowUdpPort
Definition: IAgoraRecordingEngine.h:205
RecordingEngineProperties()
Definition: IAgoraRecordingEngine.h:283
Definition: IAgoraLinuxSdkCommon.h:318
Definition: IAgoraRecordingEngine.h:280
AUDIO_PROFILE_TYPE
Definition: IAgoraLinuxSdkCommon.h:210
bool isAudioOnly
Definition: IAgoraRecordingEngine.h:108
char * cfgFilePath
Definition: IAgoraRecordingEngine.h:187
int audioIndicationInterval
Definition: IAgoraRecordingEngine.h:226
int captureInterval
Definition: IAgoraRecordingEngine.h:220
virtual ~RecordingConfig()
Definition: IAgoraRecordingEngine.h:276
char * defaultVideoBg
Definition: IAgoraRecordingEngine.h:241
virtual void onUserJoined(uid_t uid, agora::linuxsdk::UserJoinInfos &infos)=0
REMOTE_VIDEO_STREAM_TYPE
Definition: IAgoraLinuxSdkCommon.h:127
char * decryptionMode
Definition: IAgoraRecordingEngine.h:177
MIXED_AV_CODEC_TYPE
Definition: IAgoraLinuxSdkCommon.h:266
Definition: IAgoraLinuxSdkCommon.h:435
virtual void audioFrameReceived(unsigned int uid, const agora::linuxsdk::AudioFrame *frame) const =0
bool isVideoOnly
Definition: IAgoraRecordingEngine.h:120
char * proxyServer
Definition: IAgoraRecordingEngine.h:237
virtual int joinChannel(const char *channelKey, const char *channelId, uid_t uid, const RecordingConfig &config)=0
virtual void onError(int error, agora::linuxsdk::STAT_CODE_TYPE stat_code)=0
bool isMixingEnabled
Definition: IAgoraRecordingEngine.h:126
Definition: IAgoraRecordingEngine.h:10
virtual void onUserOffline(uid_t uid, agora::linuxsdk::USER_OFFLINE_REASON_TYPE reason)=0
AUDIO_FORMAT_TYPE
Definition: IAgoraLinuxSdkCommon.h:155
static IRecordingEngine * createAgoraRecordingEngine(const char *appId, IRecordingEngineEventHandler *eventHandler)
struct agora::recording::RecordingConfig RecordingConfig
char * secret
Definition: IAgoraRecordingEngine.h:179
char * appliteDir
Definition: IAgoraRecordingEngine.h:181
agora::linuxsdk::LANGUAGE_TYPE lang
Definition: IAgoraRecordingEngine.h:235
agora::linuxsdk::CHANNEL_PROFILE_TYPE channelProfile
Definition: IAgoraRecordingEngine.h:228
virtual const RecordingEngineProperties * getProperties()=0
STAT_CODE_TYPE
Definition: IAgoraLinuxSdkCommon.h:45
LANGUAGE_TYPE
Definition: IAgoraLinuxSdkCommon.h:202
int highUdpPort
Definition: IAgoraRecordingEngine.h:210
Definition: IAgoraRecordingEngine.h:96
struct agora::recording::RecordingEngineProperties RecordingEngineProperties
virtual ~IRecordingEngine()
Definition: IAgoraRecordingEngine.h:302
Definition: IAgoraRecordingEngine.h:288