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
2017-01-18 16:59:19 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8acb99f96c4718308d5c9ff545cd4da8082b3e22
8acb99f9
1 parent
c5fcc159
refine comments for librtmp
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
47 行增加
和
45 行删除
trunk/src/libs/srs_librtmp.hpp
trunk/src/libs/srs_librtmp.hpp
查看文件 @
8acb99f
...
...
@@ -1002,80 +1002,82 @@ typedef void* srs_hijack_io_t;
// which use librtmp but use its own io(use st also).
#ifdef SRS_HIJACK_IO
/**
* create hijack.
* @return NULL for error; otherwise, ok.
*/
* create hijack.
* @return NULL for error; otherwise, ok.
*/
extern
srs_hijack_io_t
srs_hijack_io_create
();
/**
* destroy the context, user must close the socket.
*/
* destroy the context, user must close the socket.
*/
extern
void
srs_hijack_io_destroy
(
srs_hijack_io_t
ctx
);
/**
* create socket, not connect yet.
* @param owner, the rtmp context which create this socket.
* @return 0, success; otherswise, failed.
*/
* create socket, not connect yet.
* @param owner, the rtmp context which create this socket.
* @return 0, success; otherswise, failed.
*/
extern
int
srs_hijack_io_create_socket
(
srs_hijack_io_t
ctx
,
srs_rtmp_t
owner
);
/**
* connect socket at server_ip:port.
* @return 0, success; otherswise, failed.
*/
* connect socket at server_ip:port.
* @return 0, success; otherswise, failed.
*/
extern
int
srs_hijack_io_connect
(
srs_hijack_io_t
ctx
,
const
char
*
server_ip
,
int
port
);
/**
* read from socket.
* @return 0, success; otherswise, failed.
*/
* read from socket.
* @return 0, success; otherswise, failed.
*/
extern
int
srs_hijack_io_read
(
srs_hijack_io_t
ctx
,
void
*
buf
,
size_t
size
,
ssize_t
*
nread
);
/**
* set the socket recv timeout in ms.
* @return 0, success; otherswise, failed.
*/
* set the socket recv timeout in ms.
* @return 0, success; otherswise, failed.
*/
extern
int
srs_hijack_io_set_recv_timeout
(
srs_hijack_io_t
ctx
,
int64_t
tm
);
/**
* get the socket recv timeout.
* @return 0, success; otherswise, failed.
*/
* get the socket recv timeout.
* @return 0, success; otherswise, failed.
*/
extern
int64_t
srs_hijack_io_get_recv_timeout
(
srs_hijack_io_t
ctx
);
/**
* get the socket recv bytes.
* @return 0, success; otherswise, failed.
*/
* get the socket recv bytes.
* @return 0, success; otherswise, failed.
*/
extern
int64_t
srs_hijack_io_get_recv_bytes
(
srs_hijack_io_t
ctx
);
/**
* set the socket send timeout in ms.
* @return 0, success; otherswise, failed.
*/
* set the socket send timeout in ms.
* @return 0, success; otherswise, failed.
*/
extern
int
srs_hijack_io_set_send_timeout
(
srs_hijack_io_t
ctx
,
int64_t
tm
);
/**
* get the socket send timeout.
* @return 0, success; otherswise, failed.
*/
* get the socket send timeout.
* @return 0, success; otherswise, failed.
*/
extern
int64_t
srs_hijack_io_get_send_timeout
(
srs_hijack_io_t
ctx
);
/**
* get the socket send bytes.
* @return 0, success; otherswise, failed.
*/
* get the socket send bytes.
* @return 0, success; otherswise, failed.
*/
extern
int64_t
srs_hijack_io_get_send_bytes
(
srs_hijack_io_t
ctx
);
/**
* writev of socket.
* @return 0, success; otherswise, failed.
*/
* writev of socket.
* @return 0, success; otherswise, failed.
* @remark We assume that the writev always write all data to peer, like what ST or block-socket done.
*/
extern
int
srs_hijack_io_writev
(
srs_hijack_io_t
ctx
,
const
iovec
*
iov
,
int
iov_size
,
ssize_t
*
nwrite
);
/**
* whether the timeout is never timeout in ms.
* @return 0, success; otherswise, failed.
*/
* whether the timeout is never timeout in ms.
* @return 0, success; otherswise, failed.
*/
// TODO: FIXME: Upgrade srs-bench and change the us to ms for timeout.
extern
bool
srs_hijack_io_is_never_timeout
(
srs_hijack_io_t
ctx
,
int64_t
tm
);
/**
* read fully, fill the buf exactly size bytes.
* @return 0, success; otherswise, failed.
*/
* read fully, fill the buf exactly size bytes.
* @return 0, success; otherswise, failed.
*/
extern
int
srs_hijack_io_read_fully
(
srs_hijack_io_t
ctx
,
void
*
buf
,
size_t
size
,
ssize_t
*
nread
);
/**
* write bytes to socket.
* @return 0, success; otherswise, failed.
*/
* write bytes to socket.
* @return 0, success; otherswise, failed.
* @remark We assume that the write always write all data to peer, like what ST or block-socket done.
*/
extern
int
srs_hijack_io_write
(
srs_hijack_io_t
ctx
,
void
*
buf
,
size_t
size
,
ssize_t
*
nwrite
);
#endif
...
...
请
注册
或
登录
后发表评论