-
Notifications
You must be signed in to change notification settings - Fork 1k
/
inroom.h
109 lines (90 loc) · 3.02 KB
/
inroom.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#ifndef INROOM_H
#define INROOM_H
#include <Memory>
#include <QVariant>
#include <QMainWindow>
#include "enterroom.h"
#include <mutex>
#include <qtimer.h>
#include <IAgoraRtcEngine.h>
using namespace agora::rtc;
namespace Ui {
class InRoom;
}
typedef struct eTagVideoStats {
eTagVideoStats(){;}
eTagVideoStats(unsigned int ui,int nlastmiledelay = 0,int nwidth = 0,int nheight = 0,int nfps = 0,int nbitrate = 0,QWidget *pwidget = Q_NULLPTR,int nindex = 0):
uid(ui),nLastmileDelay(nlastmiledelay),nWidth(nwidth),nHeight(nheight),nFps(nfps),nBitrate(nbitrate),pWidget(pwidget),nIndex(nindex){;}
eTagVideoStats(const eTagVideoStats& vss) {
*this = vss;
}
eTagVideoStats& operator=(const eTagVideoStats& vss) {
if(this != &vss) {
uid = vss.uid;
nLastmileDelay = vss.nLastmileDelay;
nWidth = vss.nWidth;
nHeight = vss.nHeight;
nFps = vss.nFps;
nBitrate = vss.nBitrate;
pWidget = vss.pWidget;
nIndex = vss.nIndex;
}
return *this;
}
unsigned int uid;
int nLastmileDelay;
int nWidth;
int nHeight;
int nFps;
int nBitrate;
QWidget* pWidget;
int nIndex;
}Video_Stats,*PVideo_Stats,*LPVideoStats;
typedef QMap<unsigned int,Video_Stats> qIVS;
class InRoom : public QMainWindow
{
Q_OBJECT
public:
explicit InRoom(QWidget *parent = 0);
~InRoom();
private:
Ui::InRoom *ui;
protected:
virtual void mousePressEvent(QMouseEvent *e);
virtual void mouseMoveEvent(QMouseEvent *e);
virtual void mouseReleaseEvent(QMouseEvent *e);
virtual void focusInEvent(QFocusEvent *event);
virtual void focusOutEvent(QFocusEvent *event);
public slots:
void joinchannel(const QString& qsChannelId,const QString& qsChannelKey,uint uid);
void leavechannel();
void receive_videoStopped();
void receive_joinedChannelSuccess(const QString &qsChannel, unsigned int uid, int elapsed);
void receive_userJoined(unsigned int uid, int elapsed);
void receive_userOffline(unsigned int uid, USER_OFFLINE_REASON_TYPE reason);
void receive_firstLocalVideoFrame(int width, int height, int elapsed);
void receive_firstRemoteVideoDecoded(unsigned int uid, int width, int height, int elapsed);
void receive_firstRemoteVideoFrameDrawn(unsigned int uid, int width, int height, int elapsed);
void receive_localVideoStats(const LocalVideoStats &stats);
void receive_remoteVideoStats(const RemoteVideoStats &stats);
void receive_rtcStats(const RtcStats &stats);
void receive_timer_pfs();
bool eventFilter(QObject *watched,QEvent *event);
private slots:
private:
void adjustPos();
private:
const int lnTitleWidth = 1366;
const int lnTitleHeight = 30;
QPoint m_mousePosition;
bool m_bMousePressed;
std::unique_ptr<EnterRoom> m_uper;
std::mutex m_vsMutex;
qIVS m_qivs;
int m_nlastmileDelay;
QTimer *m_timer_fps;
uid_t m_uid;
uid_t m_bigUid;
QString m_qsChannel;
};
#endif // INROOM_H