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
ba947cb6
Commit
ba947cb6
authored
Aug 05, 2022
by
ziyue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整switch case语句缩进
parent
f85de2e1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
32 行增加
和
49 行删除
+32
-49
src/Extension/H264.cpp
+24
-24
srt/Packet.cpp
+4
-10
webrtc/SrtpSession.cpp
+4
-15
没有找到文件。
src/Extension/H264.cpp
查看文件 @
ba947cb6
...
...
@@ -179,32 +179,32 @@ bool H264Track::inputFrame_l(const Frame::Ptr &frame) {
int
type
=
H264_TYPE
(
frame
->
data
()[
frame
->
prefixSize
()]);
bool
ret
=
true
;
switch
(
type
)
{
case
H264Frame
:
:
NAL_SPS
:
{
_sps
=
string
(
frame
->
data
()
+
frame
->
prefixSize
(),
frame
->
size
()
-
frame
->
prefixSize
());
_latest_is_config_frame
=
true
;
ret
=
VideoTrack
::
inputFrame
(
frame
);
break
;
}
case
H264Frame
:
:
NAL_PPS
:
{
_pps
=
string
(
frame
->
data
()
+
frame
->
prefixSize
(),
frame
->
size
()
-
frame
->
prefixSize
());
_latest_is_config_frame
=
true
;
ret
=
VideoTrack
::
inputFrame
(
frame
);
break
;
}
default
:
// 避免识别不出关键帧
if
(
_latest_is_config_frame
&&
!
frame
->
dropAble
())
{
if
(
!
frame
->
keyFrame
())
{
const_cast
<
Frame
::
Ptr
&>
(
frame
)
=
std
::
make_shared
<
FrameCacheAble
>
(
frame
,
true
);
}
case
H264Frame
:
:
NAL_SPS
:
{
_sps
=
string
(
frame
->
data
()
+
frame
->
prefixSize
(),
frame
->
size
()
-
frame
->
prefixSize
());
_latest_is_config_frame
=
true
;
ret
=
VideoTrack
::
inputFrame
(
frame
);
break
;
}
// 判断是否是I帧, 并且如果是,那判断前面是否插入过config帧, 如果插入过就不插入了
if
(
frame
->
keyFrame
()
&&
!
_latest_is_config_frame
)
{
insertConfigFrame
(
frame
);
case
H264Frame
:
:
NAL_PPS
:
{
_pps
=
string
(
frame
->
data
()
+
frame
->
prefixSize
(),
frame
->
size
()
-
frame
->
prefixSize
());
_latest_is_config_frame
=
true
;
ret
=
VideoTrack
::
inputFrame
(
frame
);
break
;
}
_latest_is_config_frame
=
false
;
ret
=
VideoTrack
::
inputFrame
(
frame
);
break
;
default
:
// 避免识别不出关键帧
if
(
_latest_is_config_frame
&&
!
frame
->
dropAble
())
{
if
(
!
frame
->
keyFrame
())
{
const_cast
<
Frame
::
Ptr
&>
(
frame
)
=
std
::
make_shared
<
FrameCacheAble
>
(
frame
,
true
);
}
}
// 判断是否是I帧, 并且如果是,那判断前面是否插入过config帧, 如果插入过就不插入了
if
(
frame
->
keyFrame
()
&&
!
_latest_is_config_frame
)
{
insertConfigFrame
(
frame
);
}
_latest_is_config_frame
=
false
;
ret
=
VideoTrack
::
inputFrame
(
frame
);
break
;
}
if
(
_width
==
0
&&
ready
())
{
...
...
srt/Packet.cpp
查看文件 @
ba947cb6
...
...
@@ -321,16 +321,10 @@ bool HandshakePacket::loadExtMessage(uint8_t *buf, size_t len) {
type
=
loadUint16
(
ptr
);
length
=
loadUint16
(
ptr
+
2
);
switch
(
type
)
{
case
HSExt
:
:
SRT_CMD_HSREQ
:
case
HSExt
:
:
SRT_CMD_HSRSP
:
ext
=
std
::
make_shared
<
HSExtMessage
>
();
break
;
case
HSExt
:
:
SRT_CMD_SID
:
ext
=
std
::
make_shared
<
HSExtStreamID
>
();
break
;
default
:
WarnL
<<
"not support ext "
<<
type
;
break
;
case
HSExt
:
:
SRT_CMD_HSREQ
:
case
HSExt
:
:
SRT_CMD_HSRSP
:
ext
=
std
::
make_shared
<
HSExtMessage
>
();
break
;
case
HSExt
:
:
SRT_CMD_SID
:
ext
=
std
::
make_shared
<
HSExtStreamID
>
();
break
;
default
:
WarnL
<<
"not support ext "
<<
type
;
break
;
}
if
(
ext
)
{
if
(
ext
->
loadFromData
(
ptr
,
length
*
4
+
4
))
{
...
...
webrtc/SrtpSession.cpp
查看文件 @
ba947cb6
...
...
@@ -123,21 +123,10 @@ DepLibSRTP::DepLibSRTP() {
err
=
srtp_install_event_handler
([](
srtp_event_data_t
*
data
)
{
MS_TRACE
();
switch
(
data
->
event
)
{
case
event_ssrc_collision
:
MS_WARN_TAG
(
srtp
,
"SSRC collision occurred"
);
break
;
case
event_key_soft_limit
:
MS_WARN_TAG
(
srtp
,
"stream reached the soft key usage limit and will expire soon"
);
break
;
case
event_key_hard_limit
:
MS_WARN_TAG
(
srtp
,
"stream reached the hard key usage limit and has expired"
);
break
;
case
event_packet_index_limit
:
MS_WARN_TAG
(
srtp
,
"stream reached the hard packet limit (2^48 packets)"
);
break
;
case
event_ssrc_collision
:
MS_WARN_TAG
(
srtp
,
"SSRC collision occurred"
);
break
;
case
event_key_soft_limit
:
MS_WARN_TAG
(
srtp
,
"stream reached the soft key usage limit and will expire soon"
);
break
;
case
event_key_hard_limit
:
MS_WARN_TAG
(
srtp
,
"stream reached the hard key usage limit and has expired"
);
break
;
case
event_packet_index_limit
:
MS_WARN_TAG
(
srtp
,
"stream reached the hard packet limit (2^48 packets)"
);
break
;
}
});
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论