Rtpcommon.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _RTPCOMMON_H_
  2. #define _RTPCOMMON_H_
  3. #include <QList>
  4. #include <QUdpSocket>
  5. /**
  6. * @brief 接收到的客户端结构体
  7. *
  8. */
  9. struct RtpRecvClientInfo_t
  10. {
  11. char clientIP[32]; /* 客户端IP */
  12. int clientPort; /* 客户端接收数据的UDP端口 */
  13. int sessionID; /* 连接的SessionID */
  14. char sessionName[32]; /* 客户端名称 */
  15. int type; /* 包类型,0:Login,1:Heart,2:Logout */
  16. RtpRecvClientInfo_t();
  17. RtpRecvClientInfo_t(const RtpRecvClientInfo_t& other);
  18. RtpRecvClientInfo_t& operator=(const RtpRecvClientInfo_t& other);
  19. };
  20. /**
  21. * @brief RTP通道包含带有UDP信息的客户端信息
  22. *
  23. */
  24. struct RtpSendClientInfo_t
  25. {
  26. int localPort; /* 本地发送数据的UDP端口 */
  27. QString clientIP; /* 客户端IP */
  28. int clientPort; /* 客户端接收数据的UDP端口 */
  29. int sessionID; /* 连接的SessionID */
  30. QString sessionName; /* 客户端名称 */
  31. QUdpSocket* udpSocket = nullptr; /* 用于发送数据的UDP套接字 */
  32. RtpSendClientInfo_t();
  33. RtpSendClientInfo_t(const RtpSendClientInfo_t& other);
  34. RtpSendClientInfo_t& operator=(const RtpSendClientInfo_t& other);
  35. };
  36. #endif /* _RTPCOMMON_H_ */