From 4e96c443d8296e1178c2fee99816c52509055110 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 27 Feb 2017 17:39:29 +0800 Subject: [PATCH] Change the bool to int for C --- trunk/src/libs/srs_lib_simple_socket.cpp | 2 +- trunk/src/libs/srs_librtmp.hpp | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/trunk/src/libs/srs_lib_simple_socket.cpp b/trunk/src/libs/srs_lib_simple_socket.cpp index 1308389d4..0a3ff5195 100644 --- a/trunk/src/libs/srs_lib_simple_socket.cpp +++ b/trunk/src/libs/srs_lib_simple_socket.cpp @@ -252,7 +252,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. return ret; } - bool srs_hijack_io_is_never_timeout(srs_hijack_io_t ctx, int64_t tm) + int srs_hijack_io_is_never_timeout(srs_hijack_io_t ctx, int64_t tm) { return tm == SRS_CONSTS_NO_TMMS; } diff --git a/trunk/src/libs/srs_librtmp.hpp b/trunk/src/libs/srs_librtmp.hpp index b73a11009..9ea69509e 100644 --- a/trunk/src/libs/srs_librtmp.hpp +++ b/trunk/src/libs/srs_librtmp.hpp @@ -73,16 +73,24 @@ extern "C"{ #endif /** -* the schema of url, now bravo support 4 kinds of url: +* The schema of RTMP url, the following are legal urls: * srs_url_schema_normal: rtmp://vhost:port/app/stream * srs_url_schema_via : rtmp://ip:port/vhost/app/stream * srs_url_schema_vis : rtmp://ip:port/app/stream?vhost=xxx * srs_url_schema_vis2 : rtmp://ip:port/app/stream?domain=xxx */ enum srs_url_schema{ + // Normal RTMP URL, the vhost put in host field, using DNS to resolve the server ip. + // For example, rtmp://vhost:port/app/stream srs_url_schema_normal = 0, + // VIA(vhost in app), the vhost put in app field. + // For example, rtmp://ip:port/vhost/app/stream srs_url_schema_via, + // VIS(vhost in stream), the vhost put in query string, keyword use vhost=xxx. + // For example, rtmp://ip:port/app/stream?vhost=xxx srs_url_schema_vis, + // VIS, keyword use domain=xxx. + // For example, rtmp://ip:port/app/stream?domain=xxx srs_url_schema_vis2 }; @@ -1139,10 +1147,9 @@ typedef void* srs_hijack_io_t; 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. + * @return 0, with timeout specified; otherwise, never timeout. */ - // 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); + extern int 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.