remote_notify.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #ifdef EGOREMOTE_EXPORTS
  3. #define EGOREMOTE_API __declspec(dllexport)
  4. #else
  5. #define EGOREMOTE_API __declspec(dllimport)
  6. #endif
  7. namespace remote
  8. {
  9. class Robot;
  10. }
  11. namespace webrtc
  12. {
  13. class VideoFrame;
  14. }
  15. class IRemoteNotify
  16. {
  17. public:
  18. virtual void OnConnected(bool bRet) = 0;
  19. virtual void OnRobot(const remote::Robot& robot) = 0;
  20. virtual void OnLogin(int32_t uid, bool bRet) = 0;
  21. virtual void OnVideoReq(int32_t index, int32_t peer) = 0;
  22. virtual void OnVideoOffer(int32_t index, const char* type, const char* sdp) = 0;
  23. virtual void OnVideoAnswer(int32_t index, const char* type, const char* sdp) = 0;
  24. virtual void OnVideoCandidate(int32_t index, const char* candidate,
  25. int32_t sdp_mline_index,
  26. const char* sdp_mid) = 0;
  27. virtual void OnNotifyState(int32_t rid, UserState state) = 0;
  28. virtual void OnVideoRep(bool ok, int32_t index, int32_t peer) = 0;
  29. virtual void OnNotifyDel(int32_t peer, EgoType type) = 0;
  30. virtual void OnVideoLeave(int32_t peer, EgoType type) = 0;
  31. };
  32. class IRemoteCtrl
  33. {
  34. public:
  35. virtual void Start(EgoType type,std::array<IRender*, RenderPosition::ALL>& ar) = 0;//Monitor
  36. virtual void Login(std::string account, std::string pass) = 0;
  37. virtual void ReqUserList() = 0;
  38. virtual void OnConnect(int32_t peer) = 0;
  39. virtual void OnLeave() = 0;
  40. virtual void OverlayVideo(RenderPosition pos,const webrtc::VideoFrame& frame) = 0;
  41. virtual std::string GetAccount() = 0;
  42. virtual std::string GetPassword() = 0;
  43. virtual std::string GetName() = 0;
  44. };
  45. class IMonitroNotify
  46. {
  47. public:
  48. virtual void OnRobot(std::unique_ptr<UserDriver>& info) = 0;
  49. virtual void OnLogin(bool bRet) = 0;
  50. virtual void OnNotifyDel(int32_t peer) = 0;
  51. virtual void OnNotifyLeave(int32_t peer) = 0;
  52. virtual void OnNotifyVideoFail(int32_t uid) = 0;
  53. virtual void OnNotifyState(int32_t uid, UserState state) = 0;
  54. };
  55. EGOREMOTE_API IRemoteCtrl* GetRemoteController(IMonitroNotify* n);