12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #ifndef _RTPCOMMON_H_
- #define _RTPCOMMON_H_
- #include <QList>
- /**
- * @brief UDP的状态
- *
- */
- enum class eUDPState
- {
- eUDP_None = 0, /* 未知状态 */
- eUDP_Init, /* 初始化 */
- eUDP_Opened, /* 已打开 */
- eUDP_Closed, /* 已关闭 */
- eUDP_Error /* 错误状态 */
- };
- /**
- 接收到的客户端结构体
- 这里的sessionID应该换成对比项ID加需要数据的对比项使用的通道信息,通过对比项ID加通道编号
- 找到对应的声卡通道
- */
- struct RtpRecvClientInfo_t
- {
- char clientIP[32]; /* 客户端IP */
- int clientPort; /* 客户端接收数据的UDP端口 */
- int compareItemID; /* 对比项ID */
- int compareItemRoadNum; /* 对比项的通道号 */
- int type; /* 包类型,0:Login,1:Heart,2:Logout */
- RtpRecvClientInfo_t();
- RtpRecvClientInfo_t(const RtpRecvClientInfo_t& other);
- RtpRecvClientInfo_t& operator=(const RtpRecvClientInfo_t& other);
- };
- /**
- * @brief 客户端信息结构体
- *
- */
- struct RtpSendClientInfo_t
- {
- QString localIP; /* 本地IP */
- int localPort = -1; /* 本地发送数据的UDP端口 */
- QString clientIP; /* 客户端IP */
- int clientPort = -1; /* 客户端接收数据的UDP端口 */
-
- // int compareItemID; /* 对比项ID */
- // int compareItemRoadNum; /* 对比项通道号 */
- int SoundCardNum; /* 声卡编号 */
- int SoundCardRoadNum; /* 声卡通道编号 */
- RtpSendClientInfo_t();
- RtpSendClientInfo_t(const RtpSendClientInfo_t& other);
- RtpSendClientInfo_t& operator=(const RtpSendClientInfo_t& other);
- };
- /**
- * @brief 客户端信息结构体,充当Rtp服务中客户端列表的键
- *
- */
- struct RtpClientKey_t
- {
- QString clientIP; /* 客户端IP */
- int clientPort; /* 客户端接收数据的UDP端口 */
- int SoundCardNum = -1; /* 声卡编号 */
- int SoundCardRoadNum = -1; /* 声卡通道编号 */
- RtpClientKey_t() = default;
-
- bool operator==(const RtpClientKey_t& other) const;
- bool operator<(const RtpClientKey_t& other) const;
- };
- #endif /* _RTPCOMMON_H_ */
|