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-19 11:24:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e5fcf80b9492b14acd28ebb5a5d90a4759baaa52
e5fcf80b
1 parent
fae1c61c
refine ingest flv over srs-librtmp
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
19 行增加
和
16 行删除
trunk/research/librtmp/srs_ingest_flv.c
trunk/research/librtmp/srs_ingest_flv.c
查看文件 @
e5fcf80
...
...
@@ -49,6 +49,9 @@ void close_flv_file(int flv_fd);
int
flv_open_ic
(
int
flv_fd
);
int
flv_read_packet
(
int
flv_fd
,
int
*
type
,
u_int32_t
*
timestamp
,
char
**
data
,
int
*
size
);
int64_t
re_create
();
int64_t
re_update
(
int64_t
re
,
u_int32_t
time
);
int
main
(
int
argc
,
char
**
argv
)
{
int
ret
=
0
;
...
...
@@ -105,7 +108,7 @@ int main(int argc, char** argv)
ortmp
=
srs_rtmp_create
(
out_rtmp_url
);
ret
=
proxy
(
flv_fd
,
ortmp
);
trace
(
"
proxy
completed"
);
trace
(
"
ingest flv to RTMP
completed"
);
srs_rtmp_destroy
(
ortmp
);
close_flv_file
(
flv_fd
);
...
...
@@ -113,20 +116,6 @@ int main(int argc, char** argv)
return
ret
;
}
int64_t
re_create
()
{
return
0
;
}
int64_t
re_update
(
int64_t
re
,
u_int32_t
time
)
{
if
(
time
-
re
>
500
)
{
usleep
((
time
-
re
)
*
1000
);
return
time
;
}
return
re
;
}
int
proxy
(
int
flv_fd
,
srs_rtmp_t
ortmp
)
{
int
ret
=
0
;
...
...
@@ -145,7 +134,7 @@ int proxy(int flv_fd, srs_rtmp_t ortmp)
return
ret
;
}
trace
(
"start
proxy
RTMP stream"
);
trace
(
"start
ingest flv to
RTMP stream"
);
for
(;;)
{
if
((
ret
=
flv_read_packet
(
flv_fd
,
&
type
,
&
timestamp
,
&
data
,
&
size
))
!=
0
)
{
trace
(
"irtmp get packet failed. ret=%d"
,
ret
);
...
...
@@ -192,6 +181,20 @@ int connect_oc(srs_rtmp_t ortmp)
return
ret
;
}
int64_t
re_create
()
{
return
0
;
}
int64_t
re_update
(
int64_t
re
,
u_int32_t
time
)
{
if
(
time
-
re
>
500
)
{
usleep
((
time
-
re
)
*
1000
);
return
time
;
}
return
re
;
}
int
open_flv_file
(
char
*
in_flv_file
)
{
return
open
(
in_flv_file
,
O_RDONLY
);
...
...
请
注册
或
登录
后发表评论