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
ec8e5181
Commit
ec8e5181
authored
May 10, 2021
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善fci相关代码
parent
c57f31d3
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
47 行增加
和
21 行删除
+47
-21
src/Rtcp/Rtcp.cpp
+23
-21
src/Rtcp/Rtcp.h
+24
-0
没有找到文件。
src/Rtcp/Rtcp.cpp
查看文件 @
ec8e5181
...
...
@@ -517,44 +517,48 @@ std::shared_ptr<RtcpFB> RtcpFB::create(RTPFBType fmt, const void *fci, size_t fc
return
RtcpFB
::
create_l
(
RtcpType
::
RTCP_RTPFB
,
(
int
)
fmt
,
fci
,
fci_len
);
}
const
void
*
RtcpFB
::
getFciPtr
()
const
{
return
(
uint8_t
*
)
&
ssrc_media
+
sizeof
(
ssrc_media
);
}
size_t
RtcpFB
::
getFciSize
()
const
{
auto
fci_len
=
(
ssize_t
)
getSize
()
-
getPaddingSize
()
-
sizeof
(
RtcpFB
);
CHECK
(
fci_len
>=
0
);
return
fci_len
;
}
string
RtcpFB
::
dumpString
()
const
{
_StrPrinter
printer
;
printer
<<
RtcpHeader
::
dumpHeader
();
printer
<<
"ssrc:"
<<
ssrc
<<
"
\r\n
"
;
printer
<<
"ssrc_media:"
<<
ssrc_media
<<
"
\r\n
"
;
auto
fci_data
=
(
uint8_t
*
)
&
ssrc_media
+
sizeof
(
ssrc_media
);
auto
fci_len
=
(
ssize_t
)
getSize
()
-
getPaddingSize
()
-
sizeof
(
RtcpFB
);
CHECK
(
fci_len
>=
0
);
switch
((
RtcpType
)
pt
)
{
case
RtcpType
:
:
RTCP_PSFB
:
{
switch
((
PSFBType
)
report_count
)
{
case
PSFBType
:
:
RTCP_PSFB_SLI
:
{
FCI_SLI
*
fci
=
(
FCI_SLI
*
)
fci_data
;
fci
->
check
(
fci_len
);
printer
<<
"fci:"
<<
psfbTypeToStr
((
PSFBType
)
report_count
)
<<
" "
<<
fci
->
dumpString
();
auto
&
fci
=
getFci
<
FCI_SLI
>
();
printer
<<
"fci:"
<<
psfbTypeToStr
((
PSFBType
)
report_count
)
<<
" "
<<
fci
.
dumpString
();
break
;
}
case
PSFBType
:
:
RTCP_PSFB_PLI
:
{
CHECK
(
fci_len
==
0
);
getFciSize
(
);
printer
<<
"fci:"
<<
psfbTypeToStr
((
PSFBType
)
report_count
);
break
;
}
case
PSFBType
:
:
RTCP_PSFB_FIR
:
{
FCI_FIR
*
fci
=
(
FCI_FIR
*
)
fci_data
;
fci
->
check
(
fci_len
);
printer
<<
"fci:"
<<
psfbTypeToStr
((
PSFBType
)
report_count
)
<<
" "
<<
fci
->
dumpString
();
auto
&
fci
=
getFci
<
FCI_FIR
>
();
printer
<<
"fci:"
<<
psfbTypeToStr
((
PSFBType
)
report_count
)
<<
" "
<<
fci
.
dumpString
();
break
;
}
case
PSFBType
:
:
RTCP_PSFB_REMB
:
{
FCI_REMB
*
fci
=
(
FCI_REMB
*
)
fci_data
;
fci
->
check
(
fci_len
);
printer
<<
"fci:"
<<
psfbTypeToStr
((
PSFBType
)
report_count
)
<<
" "
<<
fci
->
dumpString
();
auto
&
fci
=
getFci
<
FCI_REMB
>
();
printer
<<
"fci:"
<<
psfbTypeToStr
((
PSFBType
)
report_count
)
<<
" "
<<
fci
.
dumpString
();
break
;
}
default
:
{
printer
<<
"fci:"
<<
psfbTypeToStr
((
PSFBType
)
report_count
)
<<
" "
<<
hexdump
(
fci_data
,
fci_len
);
printer
<<
"fci:"
<<
psfbTypeToStr
((
PSFBType
)
report_count
)
<<
" "
<<
hexdump
(
getFciPtr
(),
getFciSize
()
);
break
;
}
}
...
...
@@ -563,19 +567,17 @@ string RtcpFB::dumpString() const {
case
RtcpType
:
:
RTCP_RTPFB
:
{
switch
((
RTPFBType
)
report_count
)
{
case
RTPFBType
:
:
RTCP_RTPFB_NACK
:
{
FCI_NACK
*
fci
=
(
FCI_NACK
*
)
fci_data
;
fci
->
check
(
fci_len
);
printer
<<
"fci:"
<<
rtpfbTypeToStr
((
RTPFBType
)
report_count
)
<<
" "
<<
fci
->
dumpString
();
auto
&
fci
=
getFci
<
FCI_NACK
>
();
printer
<<
"fci:"
<<
rtpfbTypeToStr
((
RTPFBType
)
report_count
)
<<
" "
<<
fci
.
dumpString
();
break
;
}
case
RTPFBType
:
:
RTCP_RTPFB_TWCC
:
{
FCI_TWCC
*
fci
=
(
FCI_TWCC
*
)
fci_data
;
fci
->
check
(
fci_len
);
printer
<<
"fci:"
<<
rtpfbTypeToStr
((
RTPFBType
)
report_count
)
<<
" "
<<
fci
->
dumpString
(
fci_len
);
auto
&
fci
=
getFci
<
FCI_TWCC
>
();
printer
<<
"fci:"
<<
rtpfbTypeToStr
((
RTPFBType
)
report_count
)
<<
" "
<<
fci
.
dumpString
(
getFciSize
());
break
;
}
default
:
{
printer
<<
"fci:"
<<
rtpfbTypeToStr
((
RTPFBType
)
report_count
)
<<
" "
<<
hexdump
(
fci_data
,
fci_len
);
printer
<<
"fci:"
<<
rtpfbTypeToStr
((
RTPFBType
)
report_count
)
<<
" "
<<
hexdump
(
getFciPtr
(),
getFciSize
()
);
break
;
}
}
...
...
src/Rtcp/Rtcp.h
查看文件 @
ec8e5181
...
...
@@ -586,6 +586,30 @@ public:
*/
static
std
::
shared_ptr
<
RtcpFB
>
create
(
RTPFBType
fmt
,
const
void
*
fci
=
nullptr
,
size_t
fci_len
=
0
);
/**
* fci转换成某对象指针
* @tparam Type 对象类型
* @return 对象指针
*/
template
<
typename
Type
>
const
Type
&
getFci
()
const
{
auto
fci_data
=
getFciPtr
();
auto
fci_len
=
getFciSize
();
Type
*
fci
=
(
Type
*
)
fci_data
;
fci
->
check
(
fci_len
);
return
*
fci
;
}
/**
* 获取fci指针
*/
const
void
*
getFciPtr
()
const
;
/**
* 获取fci数据长度
*/
size_t
getFciSize
()
const
;
private
:
/**
* 打印字段详情
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论