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
2014-11-15 16:31:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b4269c8d675e0bd6981af79dcb318fb639294a0a
b4269c8d
1 parent
278ff845
refine name of srslibrtmp, raw_stream to h264_raw_stream
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
11 行增加
和
11 行删除
trunk/src/libs/srs_librtmp.cpp
trunk/src/libs/srs_librtmp.cpp
查看文件 @
b4269c8
...
...
@@ -72,7 +72,7 @@ struct Context
// for h264 raw stream,
// see: https://github.com/winlinvip/simple-rtmp-server/issues/66#issuecomment-62240521
SrsStream
raw_stream
;
SrsStream
h264_
raw_stream
;
// about SPS, @see: 7.3.2.1.1, H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 62
std
::
string
h264_sps
;
std
::
string
h264_pps
;
...
...
@@ -1337,32 +1337,32 @@ int srs_h264_write_raw_frames(srs_rtmp_t rtmp,
srs_assert
(
rtmp
!=
NULL
);
Context
*
context
=
(
Context
*
)
rtmp
;
if
((
ret
=
context
->
raw_stream
.
initialize
(
frames
,
frames_size
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
context
->
h264_
raw_stream
.
initialize
(
frames
,
frames_size
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
// send each frame.
while
(
!
context
->
raw_stream
.
empty
())
{
while
(
!
context
->
h264_
raw_stream
.
empty
())
{
// each frame must prefixed by annexb format.
// about annexb, @see H.264-AVC-ISO_IEC_14496-10.pdf, page 211.
int
pnb_start_code
=
0
;
if
(
!
srs_avc_startswith_annexb
(
&
context
->
raw_stream
,
&
pnb_start_code
))
{
if
(
!
srs_avc_startswith_annexb
(
&
context
->
h264_
raw_stream
,
&
pnb_start_code
))
{
return
ERROR_H264_API_NO_PREFIXED
;
}
int
start
=
context
->
raw_stream
.
pos
()
+
pnb_start_code
;
int
start
=
context
->
h264_
raw_stream
.
pos
()
+
pnb_start_code
;
// find the last frame prefixed by annexb format.
context
->
raw_stream
.
skip
(
pnb_start_code
);
while
(
!
context
->
raw_stream
.
empty
())
{
if
(
srs_avc_startswith_annexb
(
&
context
->
raw_stream
,
NULL
))
{
context
->
h264_raw_stream
.
skip
(
pnb_start_code
);
while
(
!
context
->
h264_raw_stream
.
empty
())
{
if
(
srs_avc_startswith_annexb
(
&
context
->
h264_raw_stream
,
NULL
))
{
break
;
}
context
->
raw_stream
.
skip
(
1
);
context
->
h264_
raw_stream
.
skip
(
1
);
}
int
size
=
context
->
raw_stream
.
pos
()
-
start
;
int
size
=
context
->
h264_
raw_stream
.
pos
()
-
start
;
// send out the frame.
char
*
frame
=
context
->
raw_stream
.
data
()
+
start
;
char
*
frame
=
context
->
h264_
raw_stream
.
data
()
+
start
;
if
((
ret
=
__srs_write_h264_raw_frame
(
context
,
frame
,
size
,
dts
,
pts
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
请
注册
或
登录
后发表评论