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-04-29 18:16:29 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0f498acd7bf2938e2d65f8199c32dd5f24c2caf6
0f498acd
1 parent
80ddddf8
add comments and variable for c3 extended-timestamp. to 0.9.82
显示空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
29 行增加
和
4 行删除
trunk/research/librtmp/srs_play.c
trunk/src/core/srs_core.hpp
trunk/src/rtmp/srs_protocol_rtmp_stack.cpp
trunk/src/rtmp/srs_protocol_rtmp_stack.hpp
trunk/research/librtmp/srs_play.c
查看文件 @
0f498ac
...
...
@@ -42,7 +42,11 @@ int main(int argc, char** argv)
printf
(
"srs(simple-rtmp-server) client librtmp library.
\n
"
);
printf
(
"version: %d.%d.%d
\n
"
,
srs_version_major
(),
srs_version_minor
(),
srs_version_revision
());
if
(
argc
>
1
)
{
rtmp
=
srs_rtmp_create
(
argv
[
1
]);
}
else
{
rtmp
=
srs_rtmp_create
(
"rtmp://127.0.0.1:1935/live/livestream"
);
}
if
(
srs_simple_handshake
(
rtmp
)
!=
0
)
{
printf
(
"simple handshake failed.
\n
"
);
...
...
trunk/src/core/srs_core.hpp
查看文件 @
0f498ac
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "8
1
"
#define VERSION_REVISION "8
2
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "srs"
...
...
trunk/src/rtmp/srs_protocol_rtmp_stack.cpp
查看文件 @
0f498ac
...
...
@@ -301,6 +301,7 @@ SrsProtocol::SrsProtocol(ISrsProtocolReaderWriter* io)
skt
=
io
;
in_chunk_size
=
out_chunk_size
=
RTMP_DEFAULT_CHUNK_SIZE
;
send_extended_timestamp_for_C3_chunk
=
true
;
}
SrsProtocol
::~
SrsProtocol
()
...
...
@@ -524,7 +525,7 @@ int SrsProtocol::do_send_and_free_message(SrsMessage* msg, SrsPacket* packet)
// @see: ngx_rtmp_prepare_message
// @see: http://blog.csdn.net/win_lin/article/details/13363699
u_int32_t
timestamp
=
(
u_int32_t
)
msg
->
header
.
timestamp
;
if
(
timestamp
>=
RTMP_EXTENDED_TIMESTAMP
){
if
(
send_extended_timestamp_for_C3_chunk
&&
timestamp
>=
RTMP_EXTENDED_TIMESTAMP
){
pp
=
(
char
*
)
&
timestamp
;
*
pheader
++
=
pp
[
3
];
*
pheader
++
=
pp
[
2
];
...
...
@@ -1086,7 +1087,8 @@ int SrsProtocol::read_message_header(SrsChunkStream* chunk, char fmt, int bh_siz
fmt
,
mh_size
,
chunk
->
extended_timestamp
);
}
if
(
chunk
->
extended_timestamp
)
{
// read extended-timestamp
if
(
chunk
->
extended_timestamp
&&
send_extended_timestamp_for_C3_chunk
)
{
mh_size
+=
4
;
required_size
=
bh_size
+
mh_size
;
srs_verbose
(
"read header ext time. fmt=%d, ext_time=%d, mh_size=%d"
,
fmt
,
chunk
->
extended_timestamp
,
mh_size
);
...
...
@@ -1111,7 +1113,8 @@ int SrsProtocol::read_message_header(SrsChunkStream* chunk, char fmt, int bh_siz
u_int32_t
chunk_timestamp
=
chunk
->
header
.
timestamp
;
if
(
chunk_timestamp
>
RTMP_EXTENDED_TIMESTAMP
&&
chunk_timestamp
!=
timestamp
)
{
mh_size
-=
4
;
srs_verbose
(
"ignore the 4bytes extended timestamp. mh_size=%d"
,
mh_size
);
send_extended_timestamp_for_C3_chunk
=
false
;
srs_warn
(
"no 4bytes extended timestamp in the continued chunk"
);
}
else
{
chunk
->
header
.
timestamp
=
timestamp
;
}
...
...
trunk/src/rtmp/srs_protocol_rtmp_stack.hpp
查看文件 @
0f498ac
...
...
@@ -107,6 +107,24 @@ private:
* value: the request command name
*/
std
::
map
<
double
,
std
::
string
>
requests
;
/**
* RTMP specification and ffmpeg/librtmp is false,
* but, adobe changed the specification, so flash/FMLE/FMS always true.
* default to true to support flash/FMLE/FMS.
*
* ffmpeg/librtmp may donot send this filed, need to detect the value.
* @see also: http://blog.csdn.net/win_lin/article/details/13363699
* compare to the chunk timestamp, which is set by chunk message header
* type 0,1 or 2.
*
* @remark, nginx send the extended-timestamp in sequence-header,
* and timestamp delta in continue C1 chunks, and so compatible with ffmpeg,
* that is, there is no continue chunks and extended-timestamp in nginx-rtmp.
*
* @remark, srs always send the extended-timestamp, to keep simple,
* and compatible with adobe products.
*/
bool
send_extended_timestamp_for_C3_chunk
;
// peer in
private:
std
::
map
<
int
,
SrsChunkStream
*>
chunk_streams
;
...
...
请
注册
或
登录
后发表评论