1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine code, rename the human functions to prefixed with srs_human_

This commit is contained in:
winlin 2014-11-21 14:03:30 +08:00
parent 30e7c38a48
commit b3bb2cdf2b
12 changed files with 190 additions and 190 deletions

View file

@ -47,31 +47,31 @@ int main(int argc, char** argv)
// warn it .
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/126
srs_lib_trace("\033[33m%s\033[0m",
srs_human_trace("\033[33m%s\033[0m",
"[warning] it's only a sample to use librtmp. "
"please never use it to publish and test forward/transcode/edge/HLS whatever. "
"you should refer to this tool to use the srs-librtmp to publish the real media stream."
"read about: https://github.com/winlinvip/simple-rtmp-server/issues/126");
srs_lib_trace("rtmp url: %s", argv[1]);
srs_human_trace("rtmp url: %s", argv[1]);
srs_rtmp_t rtmp = srs_rtmp_create(argv[1]);
if (srs_simple_handshake(rtmp) != 0) {
srs_lib_trace("simple handshake failed.");
srs_human_trace("simple handshake failed.");
goto rtmp_destroy;
}
srs_lib_trace("simple handshake success");
srs_human_trace("simple handshake success");
if (srs_connect_app(rtmp) != 0) {
srs_lib_trace("connect vhost/app failed.");
srs_human_trace("connect vhost/app failed.");
goto rtmp_destroy;
}
srs_lib_trace("connect vhost/app success");
srs_human_trace("connect vhost/app success");
if (srs_publish_stream(rtmp) != 0) {
srs_lib_trace("publish stream failed.");
srs_human_trace("publish stream failed.");
goto rtmp_destroy;
}
srs_lib_trace("publish stream success");
srs_human_trace("publish stream success");
u_int32_t timestamp = 0;
for (;;) {
@ -84,8 +84,8 @@ int main(int argc, char** argv)
if (srs_write_packet(rtmp, type, timestamp, data, size) != 0) {
goto rtmp_destroy;
}
srs_lib_trace("sent packet: type=%s, time=%d, size=%d",
srs_type2string(type), timestamp, size);
srs_human_trace("sent packet: type=%s, time=%d, size=%d",
srs_human_flv_tag_type2string(type), timestamp, size);
usleep(40 * 1000);
}