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 15:27:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3292136f707af50083c82570f6fa2d8fda8b4dd7
3292136f
1 parent
30d48905
update research, flv ingester, support atc time flv.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
18 行增加
和
12 行删除
trunk/research/librtmp/srs_ingest_flv.c
trunk/src/libs/srs_librtmp.cpp
trunk/research/librtmp/srs_ingest_flv.c
查看文件 @
3292136
...
...
@@ -39,8 +39,8 @@ int connect_oc(srs_rtmp_t ortmp);
#define RE_PULSE_MS 300
int64_t
re_create
();
void
re_update
(
int64_t
re
,
u_int32_t
time
);
void
re_cleanup
(
int64_t
re
,
u_int32_t
time
);
void
re_update
(
int64_t
re
,
int32_t
starttime
,
u_int32_t
time
);
void
re_cleanup
(
int64_t
re
,
int32_t
starttime
,
u_int32_t
time
);
int64_t
tools_main_entrance_startup_time
;
int
main
(
int
argc
,
char
**
argv
)
...
...
@@ -109,7 +109,7 @@ int main(int argc, char** argv)
return
ret
;
}
int
do_proxy
(
srs_flv_t
flv
,
srs_rtmp_t
ortmp
,
int64_t
re
,
u_int32_t
*
ptimestamp
)
int
do_proxy
(
srs_flv_t
flv
,
srs_rtmp_t
ortmp
,
int64_t
re
,
int32_t
*
pstarttime
,
u_int32_t
*
ptimestamp
)
{
int
ret
=
0
;
...
...
@@ -147,8 +147,12 @@ int do_proxy(srs_flv_t flv, srs_rtmp_t ortmp, int64_t re, u_int32_t* ptimestamp)
}
srs_lib_verbose
(
"ortmp sent packet: type=%s, time=%d, size=%d"
,
srs_type2string
(
type
),
*
ptimestamp
,
size
);
if
(
*
pstarttime
<
0
)
{
*
pstarttime
=
*
ptimestamp
;
}
re_update
(
re
,
*
ptimestamp
);
re_update
(
re
,
*
p
starttime
,
*
p
timestamp
);
}
return
ret
;
...
...
@@ -158,6 +162,7 @@ int proxy(srs_flv_t flv, srs_rtmp_t ortmp)
{
int
ret
=
0
;
u_int32_t
timestamp
=
0
;
int32_t
starttime
=
-
1
;
char
header
[
13
];
if
((
ret
=
srs_flv_read_header
(
flv
,
header
))
!=
0
)
{
...
...
@@ -169,10 +174,10 @@ int proxy(srs_flv_t flv, srs_rtmp_t ortmp)
int64_t
re
=
re_create
();
ret
=
do_proxy
(
flv
,
ortmp
,
re
,
&
timestamp
);
ret
=
do_proxy
(
flv
,
ortmp
,
re
,
&
starttime
,
&
timestamp
);
// for the last pulse, always sleep.
re_cleanup
(
re
,
timestamp
);
re_cleanup
(
re
,
starttime
,
timestamp
);
return
ret
;
}
...
...
@@ -223,23 +228,24 @@ int64_t re_create()
return
re
;
}
void
re_update
(
int64_t
re
,
u_int32_t
time
)
void
re_update
(
int64_t
re
,
int32_t
starttime
,
u_int32_t
time
)
{
// send by pulse algorithm.
int64_t
now
=
srs_get_time_ms
();
int64_t
diff
=
time
-
(
now
-
re
);
int64_t
diff
=
time
-
starttime
-
(
now
-
re
);
if
(
diff
>
RE_PULSE_MS
)
{
usleep
(
diff
*
1000
);
}
}
void
re_cleanup
(
int64_t
re
,
u_int32_t
time
)
void
re_cleanup
(
int64_t
re
,
int32_t
starttime
,
u_int32_t
time
)
{
// for the last pulse, always sleep.
// for the virtual live encoder long time publishing.
int64_t
now
=
srs_get_time_ms
();
int64_t
diff
=
time
-
(
now
-
re
);
int64_t
diff
=
time
-
starttime
-
(
now
-
re
);
if
(
diff
>
0
)
{
srs_lib_trace
(
"re_cleanup sleep for the last pulse for %d ms"
,
(
int
)
diff
);
srs_lib_trace
(
"re_cleanup, diff=%d, start=%d, last=%d ms"
,
(
int
)
diff
,
starttime
,
time
);
usleep
(
diff
*
1000
);
}
}
...
...
trunk/src/libs/srs_librtmp.cpp
查看文件 @
3292136
...
...
@@ -1159,7 +1159,7 @@ int __srs_write_h264_sps_pps(Context* context, u_int32_t dts, u_int32_t pts)
// @see: Annex A Profiles and levels, H.264-AVC-ISO_IEC_14496-10.pdf, page 205
// Baseline profile profile_idc is 66(0x42).
//
Baseline
profile profile_idc is 77(0x4d).
//
Main
profile profile_idc is 77(0x4d).
// Extended profile profile_idc is 88(0x58).
u_int8_t
profile_idc
=
frame
[
1
];
//u_int8_t constraint_set = frame[2];
...
...
请
注册
或
登录
后发表评论