Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
37096f8e
Commit
37096f8e
authored
Apr 13, 2021
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善rtcp的定义
parent
29c8c9bf
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
211 行增加
和
52 行删除
+211
-52
src/Rtcp/Rtcp.cpp
+4
-4
src/Rtcp/Rtcp.h
+41
-10
src/Rtcp/RtcpFCI.cpp
+16
-3
src/Rtcp/RtcpFCI.h
+150
-35
没有找到文件。
src/Rtcp/Rtcp.cpp
查看文件 @
37096f8e
...
...
@@ -38,7 +38,7 @@ const char *psfbTypeToStr(PSFBType type) {
#define SWITCH_CASE(key, value) case PSFBType::key : return #value "(" #key ")";
PSFB_TYPE_MAP
(
SWITCH_CASE
)
#undef SWITCH_CASE
default
:
return
"unknown payload-specific fb message
(rfc4585)
type"
;
default
:
return
"unknown payload-specific fb message
fmt
type"
;
}
}
...
...
@@ -385,7 +385,7 @@ string SdesItem::dumpString() const{
printer
<<
"ssrc:"
<<
ssrc
<<
"
\r\n
"
;
printer
<<
"type:"
<<
sdesTypeToStr
((
SdesType
)
type
)
<<
"
\r\n
"
;
printer
<<
"length:"
<<
(
int
)
length
<<
"
\r\n
"
;
printer
<<
"text:"
<<
(
length
?
string
(
&
text
,
length
)
:
""
)
<<
"
\r\n
"
;
printer
<<
"text:"
<<
(
length
?
string
(
text
,
length
)
:
""
)
<<
"
\r\n
"
;
return
std
::
move
(
printer
);
}
...
...
@@ -403,7 +403,7 @@ std::shared_ptr<RtcpSdes> RtcpSdes::create(const std::initializer_list<string> &
for
(
auto
&
text
:
item_text
)
{
item_ptr
->
length
=
(
0xFF
&
text
.
size
());
//确保赋值\0为RTCP_SDES_END
memcpy
(
&
(
item_ptr
->
text
)
,
text
.
data
(),
item_ptr
->
length
+
1
);
memcpy
(
item_ptr
->
text
,
text
.
data
(),
item_ptr
->
length
+
1
);
item_ptr
=
(
SdesItem
*
)
((
char
*
)
item_ptr
+
item_ptr
->
totalBytes
());
}
...
...
@@ -555,7 +555,7 @@ void RtcpBye::net2Host(size_t size) {
}
}
#if
0
#if
1
#include "Util/onceToken.h"
static
toolkit
::
onceToken
token
([](){
...
...
src/Rtcp/Rtcp.h
查看文件 @
37096f8e
...
...
@@ -25,8 +25,7 @@ namespace mediakit {
#pragma pack(push, 1)
#endif // defined(_WIN32)
//https://datatracker.ietf.org/doc/rfc3550
//http://www.networksorcery.com/enp/protocol/rtcp.htm
#define RTCP_PT_MAP(XX) \
XX(RTCP_FIR, 192) \
XX(RTCP_NACK, 193) \
...
...
@@ -43,7 +42,8 @@ namespace mediakit {
XX(RTCP_AVB, 208) \
XX(RTCP_RSI, 209) \
XX(RTCP_TOKEN, 210)
//https://tools.ietf.org/html/rfc3550#section-6.5
#define SDES_TYPE_MAP(XX) \
XX(RTCP_SDES_END, 0) \
XX(RTCP_SDES_CNAME, 1) \
...
...
@@ -69,19 +69,49 @@ namespace mediakit {
// 1: Picture Loss Indication (PLI)
// 2: Slice Loss Indication (SLI)
// 3: Reference Picture Selection Indication (RPSI)
// 4-14: unassigned
// 15: Application layer FB (AFB) message
// 4: FIR https://tools.ietf.org/html/rfc5104#section-4.3.1.1
// 5: TSTR https://tools.ietf.org/html/rfc5104#section-4.3.2.1
// 6: TSTN https://tools.ietf.org/html/rfc5104#section-4.3.2.1
// 7: VBCM https://tools.ietf.org/html/rfc5104#section-4.3.4.1
// 8-14: unassigned
// 15: REMB / Application layer FB (AFB) message, https://tools.ietf.org/html/draft-alvestrand-rmcat-remb-03
// 16-30: unassigned
// 31: reserved for future expansion of the sequence number space
#define PSFB_TYPE_MAP(XX) \
XX(RTCP_PSFB_PLI, 1) \
XX(RTCP_PSFB_SLI, 2) \
XX(RTCP_PSFB_RPSI, 3) \
XX(RTCP_PSFB_FIR, 4) \
XX(RTCP_PSFB_TSTR, 5) \
XX(RTCP_PSFB_TSTR, 5)\
XX(RTCP_PSFB_TSTN, 6)\
XX(RTCP_PSFB_VBCM, 7) \
XX(RTCP_PSFB_AFB, 15)
//https://tools.ietf.org/html/rfc4585#section-6.2
//6.2. Transport Layer Feedback Messages
//
// Transport layer FB messages are identified by the value RTPFB as RTCP
// message type.
//
// A single general purpose transport layer FB message is defined in
// this document: Generic NACK. It is identified by means of the FMT
// parameter as follows:
//
// 0: unassigned
// 1: Generic NACK
// 2: reserved https://tools.ietf.org/html/rfc5104#section-4.2
// 3: TMMBR https://tools.ietf.org/html/rfc5104#section-4.2.1.1
// 4: TMMBN https://tools.ietf.org/html/rfc5104#section-4.2.2.1
// 5-14: unassigned
// 15 transport-cc https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions-01
// 16-30: unassigned
// 31: reserved for future expansion of the identifier number space
#define RTPFB_TYPE_MAP(XX) \
XX(RTCP_RTPFB_NACK, 1) \
XX(RTCP_RTPFB_TMMBR, 3) \
XX(RTCP_RTPFB_TMMBN, 4) \
XX(RTCP_RTPFB_TWCC, 15)
//rtcp类型枚举
enum
class
RtcpType
:
uint8_t
{
#define XX(key, value) key = value,
...
...
@@ -436,7 +466,7 @@ public:
//text长度股,可以为0
uint8_t
length
;
//不定长
char
text
;
char
text
[
1
]
;
//最后以RTCP_SDES_END结尾
//只字段为占位字段,不代表真实位置
uint8_t
end
;
...
...
@@ -501,7 +531,8 @@ private:
void
net2Host
(
size_t
size
);
}
PACKED
;
//6.1. Common Packet Format for Feedback Messages
// https://tools.ietf.org/html/rfc4585#section-6.1
// 6.1. Common Packet Format for Feedback Messages
//
// All FB messages MUST use a common packet format that is depicted in
// Figure 3:
...
...
@@ -569,7 +600,7 @@ public:
/* 可选 */
uint8_t
reason_len
;
char
reason
;
char
reason
[
1
]
;
public
:
/**
...
...
src/Rtcp/RtcpFCI.cpp
查看文件 @
37096f8e
//
// Created by xzl on 2021/4/13.
//
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
*
* Use of this source code is governed by MIT license that can be found in the
* LICENSE file in the root of the source tree. All contributing project authors
* may be found in the AUTHORS file in the root of the source tree.
*/
#include "RtcpFCI.h"
namespace
mediakit
{
}
//
namespace
mediakit
\ No newline at end of file
src/Rtcp/RtcpFCI.h
查看文件 @
37096f8e
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论