1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #pragma once
- #include <stdint.h>
- #include <thread>
- #include <mutex>
- #include "remote_def.h"
- #include "../common/comm.h"
- class CUserHandler;
- class CIOBuffer;
- struct Benchboard
- {
- int32_t uid;
-
- int32_t type;
- std::string name;
- UserState state;
- };
-
- class CUserManager
- {
- public:
- void Add(CUserHandler* ptr);
- void Check(int32_t uid);
- void Remove(CUserHandler* lhs);
- void Write(int32_t id, CIOBuffer* pBuffer);
- static CUserManager& GetInstance();
- remote::VideoDesc ConnectPeerVideo(int32_t peer, int32_t uid, int32_t index);
- void NotifyOffer(int32_t peer, int32_t uid, int32_t video, const char* type, const char* sdp);
- void NotifyAnswer(int32_t peer, int32_t uid, int32_t video, const char* type, const char* sdp);
- void NotifyCandidate(int32_t peer, int32_t uid, int32_t video, const char* type, const char* candidate, int32_t sdp_mline_index, const char* sdp_mid);
- void ReplyPeerVideo(int32_t peer, int32_t uid, remote::VideoDesc ret, int32_t index);
- void LeavePeerVideo(int32_t peer, int32_t uid, EgoType type);
- void ClosePeerVideo(int32_t peer, int32_t uid, EgoType type,int32_t index);
- void GetRobot(std::vector<Benchboard>& ret);
- void BroadCast(CIOBuffer* pBuffer);
- void NotifyState(int32_t uid,EgoType type, UserState state );
- void Start();
- void Run();
- private:
- std::vector<CUserHandler*> SocketList;
-
- std::mutex _lock;
- std::thread _thread;
- bool _run;
- };
|