Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2016-08-18 11:27:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a4bb03b9d6ed139251f8e9bf87ceee9dea0ebde1
a4bb03b9
1 parent
dbc6d940
ignore other 264 frame except sps,pps,idr,nonidr
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
14 行增加
和
0 行删除
trunk/src/libs/srs_librtmp.cpp
trunk/src/libs/srs_librtmp.cpp
查看文件 @
a4bb03b
...
...
@@ -1366,6 +1366,11 @@ int srs_write_h264_raw_frame(Context* context,
char
*
frame
,
int
frame_size
,
u_int32_t
dts
,
u_int32_t
pts
)
{
int
ret
=
ERROR_SUCCESS
;
// empty frame.
if
(
frame_size
<=
0
)
{
return
ret
;
}
// for sps
if
(
context
->
avc_raw
.
is_sps
(
frame
,
frame_size
))
{
...
...
@@ -1399,6 +1404,15 @@ int srs_write_h264_raw_frame(Context* context,
return
ret
;
}
// ignore others.
// 5bits, 7.3.1 NAL unit syntax,
// H.264-AVC-ISO_IEC_14496-10.pdf, page 44.
// 7: SPS, 8: PPS, 5: I Frame, 1: P Frame
SrsAvcNaluType
nut
=
(
SrsAvcNaluType
)(
frame
[
0
]
&
0x1f
);
if
(
nut
!=
SrsAvcNaluTypeSPS
&&
nut
!=
SrsAvcNaluTypePPS
&&
nut
!=
SrsAvcNaluTypeIDR
&&
nut
!=
SrsAvcNaluTypeNonIDR
)
{
return
ret
;
}
// send pps+sps before ipb frames when sps/pps changed.
if
((
ret
=
srs_write_h264_sps_pps
(
context
,
dts
,
pts
))
!=
ERROR_SUCCESS
)
{
return
ret
;
...
...
请
注册
或
登录
后发表评论