Rtpcommon.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef _RTPCOMMON_H_
  2. #define _RTPCOMMON_H_
  3. #include <QList>
  4. /**
  5. * @brief UDP的状态
  6. *
  7. */
  8. enum class eUDPState
  9. {
  10. eUDP_None = 0, /* 未知状态 */
  11. eUDP_Init, /* 初始化 */
  12. eUDP_Opened, /* 已打开 */
  13. eUDP_Closed, /* 已关闭 */
  14. eUDP_Error /* 错误状态 */
  15. };
  16. /**
  17. 接收到的客户端结构体
  18. 这里的sessionID应该换成对比项ID加需要数据的对比项使用的通道信息,通过对比项ID加通道编号
  19. 找到对应的声卡通道
  20. */
  21. struct RtpRecvClientInfo_t
  22. {
  23. char clientIP[32]; /* 客户端IP */
  24. int clientPort; /* 客户端接收数据的UDP端口 */
  25. // int sessionID; /* 连接的SessionID */
  26. int compareItemID; /* 对比项ID */
  27. int compareItemRoadNum; /* 对比项的通道号 */
  28. char sessionName[32]; /* 客户端名称 */
  29. int type; /* 包类型,0:Login,1:Heart,2:Logout */
  30. RtpRecvClientInfo_t();
  31. RtpRecvClientInfo_t(const RtpRecvClientInfo_t& other);
  32. RtpRecvClientInfo_t& operator=(const RtpRecvClientInfo_t& other);
  33. };
  34. /**
  35. 回复给客户端的信息,主要是服务发送RTP数据的端口
  36. */
  37. struct RtpReplyClientInfo_t
  38. {
  39. int localPort; /* 本地发送数据的UDP端口 */
  40. };
  41. /**
  42. * @brief 客户端信息结构体
  43. *
  44. */
  45. struct RtpSendClientInfo_t
  46. {
  47. QString localIP; /* 本地IP */
  48. int localPort; /* 本地发送数据的UDP端口 */
  49. QString clientIP; /* 客户端IP */
  50. int clientPort; /* 客户端接收数据的UDP端口 */
  51. int compareItemID; /* 对比项ID */
  52. int compareItemRoadNum; /* 对比项通道号 */
  53. int SoundCardNum; /* 声卡编号 */
  54. int SoundCardRoadNum; /* 声卡通道编号 */
  55. RtpSendClientInfo_t();
  56. RtpSendClientInfo_t(const RtpSendClientInfo_t& other);
  57. RtpSendClientInfo_t& operator=(const RtpSendClientInfo_t& other);
  58. };
  59. #endif /* _RTPCOMMON_H_ */