-
Notifications
You must be signed in to change notification settings - Fork 1k
/
agoraobject.h
95 lines (78 loc) · 3.28 KB
/
agoraobject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#ifndef CAGORAOBJECT_H
#define CAGORAOBJECT_H
#include <Memory>
#include <mutex>
#include "agoraconfig.h"
extern CAgoraConfig gAgoraConfig;
//Specify your APP ID here
#define APPID ""
#define APP_TOKEN ""
#include <QString>
#include <QVariant>
#include <IAgoraRtcEngine.h>
#include <IAgoraMediaEngine.h>
#include <AgoraBase.h>
#include "agoraqtjson.h"
using namespace agora;
using namespace agora::rtc;
typedef QMap<QString,QString> qSSMap;
class CAgoraObject:public QObject
{
Q_OBJECT
public:
int joinChannel(const QString& key, const QString& channel, uint uid);
int leaveChannel();
int muteLocalAudioStream(bool muted);
BOOL LocalVideoPreview(HWND hVideoWnd, BOOL bPreviewOn, RENDER_MODE_TYPE renderType = RENDER_MODE_TYPE::RENDER_MODE_FIT);
BOOL RemoteVideoRender(uid_t uid, HWND hVideoWnd, RENDER_MODE_TYPE renderType = RENDER_MODE_TYPE::RENDER_MODE_HIDDEN);
BOOL startLastMileProbeTest(bool enable);
int enableVideo(bool enabled);
int enableAudio(bool enabled);
BOOL MuteLocalVideo(BOOL bMute);
BOOL MuteLocalAudio(BOOL bMute);
BOOL SetEncryptionMode(const char* secret,const char* secretMode);
BOOL EnableEncryption(bool enabled, const EncryptionConfig& config);
BOOL setLogPath(const QString &strDir);
BOOL SetChannelProfile(CHANNEL_PROFILE_TYPE channelType);
BOOL SetClientRole(CLIENT_ROLE_TYPE roleType);
BOOL EnableWebSdkInteroperability(BOOL bEnable);
qSSMap getRecordingDeviceList();
qSSMap getPlayoutDeviceList();
qSSMap getVideoDeviceList();
int setRecordingDevice(const QString& guid);
int setPlayoutDevice(const QString& guid);
int setVideoDevice(const QString& guid);
BOOL setVideoProfile(int nWidth,int nHeight, FRAME_RATE fps, int bitrate);
BOOL setRecordingIndex(int nIndex);
BOOL setPlayoutIndex(int nIndex);
BOOL setVideoIndex(int nIndex);
BOOL SetLogFilter(LOG_FILTER_TYPE logFilterType, LPCTSTR lpLogPath);
bool setBeautyEffectOptions(bool enabled, BeautyOptions& options);
bool SetCustomVideoProfile();
void SetDefaultParameters();
QString GetAppToken();
signals:
void sender_videoStopped();
void sender_joinedChannelSuccess(const QString &qsChannel, unsigned int uid, int elapsed);
void sender_userJoined(unsigned int uid, int elapsed);
void sender_userOffline(unsigned int uid, USER_OFFLINE_REASON_TYPE reason);
void sender_firstLocalVideoFrame(int width, int height, int elapsed);
void sender_firstRemoteVideoDecoded(unsigned int uid, int width, int height, int elapsed);
void sender_firstRemoteVideoFrameDrawn(unsigned int uid, int width, int height, int elapsed);
void sender_localVideoStats(const LocalVideoStats &stats);
void sender_remoteVideoStats(const RemoteVideoStats &stats);
void sender_rtcStats(const RtcStats &stats);
void sender_lastmileQuality(int quality);
void sender_lastmileProbeResult(const LastmileProbeResult &result);
public:
static CAgoraObject* getInstance(QObject *parent = 0);
static CAgoraObject* m_pInstance;
static std::mutex m_mutex;
private:
explicit CAgoraObject(QObject *parent = 0);
~CAgoraObject();
agora::rtc::IRtcEngine* m_rtcEngine;
std::unique_ptr<agora::rtc::IRtcEngineEventHandler> m_eventHandler;
AgoraQtJson m_agoraJson;
};
#endif // CAGORAOBJECT_H