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
059c118e
Commit
059c118e
authored
6 years ago
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
H264 RTP解码支持STAP-A(24)类型
更新ZLToolKit(修复logger相关bug)
parent
49c8d4fb
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
43 行增加
和
4 行删除
+43
-4
src/RtspMuxer/H264RtpCodec.cpp
+43
-4
没有找到文件。
src/RtspMuxer/H264RtpCodec.cpp
查看文件 @
059c118e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
* MIT License
* MIT License
*
*
* Copyright (c) 2016 xiongziliang <771730766@qq.com>
* Copyright (c) 2016 xiongziliang <771730766@qq.com>
* Copyright (c) 2019 火宣 <459502659@qq.com>
*
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
*
*
...
@@ -107,7 +108,43 @@ bool H264RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtppack) {
...
@@ -107,7 +108,43 @@ bool H264RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtppack) {
return
(
isIDR
);
//i frame
return
(
isIDR
);
//i frame
}
}
if
(
nal
.
type
==
28
)
{
switch
(
nal
.
type
){
case
24
:{
// 24 STAP-A 单一时间的组合包
bool
haveIDR
=
false
;
auto
ptr
=
frame
+
1
;
while
(
true
){
int
off
=
ptr
-
frame
;
if
(
off
>=
length
)
{
break
;
}
//获取当前nalu的大小
uint16_t
len
=
*
ptr
++
;
len
<<=
8
;
len
|=
*
ptr
++
;
if
(
off
+
len
>
length
)
{
break
;
}
if
(
len
>=
10
){
//过小的帧丢弃
NALU
nal
;
MakeNalu
(
ptr
[
0
],
nal
);
_h264frame
->
buffer
.
assign
(
"\x0\x0\x0\x1"
,
4
);
_h264frame
->
buffer
.
append
((
char
*
)
ptr
,
len
);
_h264frame
->
type
=
nal
.
type
;
_h264frame
->
timeStamp
=
rtppack
->
timeStamp
;
_h264frame
->
sequence
=
rtppack
->
sequence
;
if
(
nal
.
type
==
H264Frame
::
NAL_IDR
){
haveIDR
=
true
;
}
onGetH264
(
_h264frame
);
}
ptr
+=
len
;
}
return
haveIDR
;
}
case
28
:{
//FU-A
//FU-A
FU
fu
;
FU
fu
;
MakeFU
(
frame
[
1
],
fu
);
MakeFU
(
frame
[
1
],
fu
);
...
@@ -142,16 +179,18 @@ bool H264RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtppack) {
...
@@ -142,16 +179,18 @@ bool H264RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtppack) {
return
false
;
return
false
;
}
}
WarnL
<<
"不支持的rtp类型:"
<<
(
int
)
nal
.
type
<<
" "
<<
rtppack
->
sequence
;
default
:
{
return
false
;
// 29 FU-B 单NAL单元B模式
// 29 FU-B 单NAL单元B模式
// 24 STAP-A 单一时间的组合包
// 25 STAP-B 单一时间的组合包
// 25 STAP-B 单一时间的组合包
// 26 MTAP16 多个时间的组合包
// 26 MTAP16 多个时间的组合包
// 27 MTAP24 多个时间的组合包
// 27 MTAP24 多个时间的组合包
// 0 udef
// 0 udef
// 30 udef
// 30 udef
// 31 udef
// 31 udef
WarnL
<<
"不支持的rtp类型:"
<<
(
int
)
nal
.
type
<<
" "
<<
rtppack
->
sequence
;
return
false
;
}
}
}
}
void
H264RtpDecoder
::
onGetH264
(
const
H264Frame
::
Ptr
&
frame
)
{
void
H264RtpDecoder
::
onGetH264
(
const
H264Frame
::
Ptr
&
frame
)
{
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论