Ai
1 Star 0 Fork 0

zip/rtpengine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rtcplib.h 980 Bytes
一键复制 编辑 原始数据 按行查看 历史
Guillem Jover 提交于 2021-05-04 03:47 +08:00 . TT#111150 Use modern uint_t types
#ifndef _RTCPLIB_H_
#define _RTCPLIB_H_
#include <glib.h>
#include "str.h"
#include "compat.h"
struct rtcp_header {
#if G_BYTE_ORDER == G_BIG_ENDIAN
unsigned version:2; /**< packet type */
unsigned p:1; /**< padding flag */
unsigned count:5; /**< varies by payload type */
#elif G_BYTE_ORDER == G_LITTLE_ENDIAN
unsigned count:5; /**< varies by payload type */
unsigned p:1; /**< padding flag */
unsigned version:2; /**< packet type */
#else
#error "byte order unknown"
#endif
unsigned char pt;
uint16_t length;
} __attribute__ ((packed));
struct rtcp_packet {
struct rtcp_header header;
uint32_t ssrc;
} __attribute__ ((packed));
/* RFC 5761 section 4 */
INLINE int rtcp_demux_is_rtcp(const str *s) {
struct rtcp_packet *rtcp;
if (s->len < sizeof(*rtcp))
return 0;
rtcp = (void *) s->s;
if (rtcp->header.pt < 194)
return 0;
if (rtcp->header.pt > 223)
return 0;
return 1;
}
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zip/rtpengine.git
git@gitee.com:zip/rtpengine.git
zip
rtpengine
rtpengine
master

搜索帮助