Rtpcommon.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef _RTPCOMMON_H_
  2. #define _RTPCOMMON_H_
  3. #include <QList>
  4. #include <QUdpSocket>
  5. /**
  6. 接收到的客户端结构体
  7. 这里的sessionID应该换成对比项ID加需要数据的对比项使用的通道信息,通过对比项ID加通道编号
  8. 找到对应的声卡通道
  9. */
  10. struct RtpRecvClientInfo_t
  11. {
  12. char clientIP[32]; /* 客户端IP */
  13. int clientPort; /* 客户端接收数据的UDP端口 */
  14. // int sessionID; /* 连接的SessionID */
  15. int compareItemID; /* 对比项ID */
  16. int compareItemRoadNum; /* 对比项的通道号 */
  17. char sessionName[32]; /* 客户端名称 */
  18. int type; /* 包类型,0:Login,1:Heart,2:Logout */
  19. RtpRecvClientInfo_t();
  20. RtpRecvClientInfo_t(const RtpRecvClientInfo_t& other);
  21. RtpRecvClientInfo_t& operator=(const RtpRecvClientInfo_t& other);
  22. };
  23. /**
  24. 回复给客户端的信息,主要是服务发送RTP数据的端口
  25. */
  26. struct RtpReplyClientInfo_t
  27. {
  28. int localPort; /* 本地发送数据的UDP端口 */
  29. };
  30. /**
  31. * @brief RTP通道包含带有UDP信息的客户端信息,这个是传递给RTP发送线程的
  32. *
  33. */
  34. struct RtpSendClientInfo_t
  35. {
  36. int localPort; /* 本地发送数据的UDP端口 */
  37. QString clientIP; /* 客户端IP */
  38. int clientPort; /* 客户端接收数据的UDP端口 */
  39. // int sessionID; /* 连接的SessionID */
  40. // QString sessionName; /* 客户端名称 */
  41. int compareItemID; /* 对比项ID */
  42. int compareItemRoadNum; /* 对比项通道号 */
  43. QUdpSocket* udpSocket = nullptr; /* 用于发送数据的UDP套接字 */
  44. RtpSendClientInfo_t();
  45. RtpSendClientInfo_t(const RtpSendClientInfo_t& other);
  46. RtpSendClientInfo_t& operator=(const RtpSendClientInfo_t& other);
  47. };
  48. #endif /* _RTPCOMMON_H_ */