正在显示
1 个修改的文件
包含
10 行增加
和
2 行删除
| @@ -926,8 +926,12 @@ extern int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* dat | @@ -926,8 +926,12 @@ extern int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* dat | ||
| 926 | // log to console, for use srs-librtmp application. | 926 | // log to console, for use srs-librtmp application. |
| 927 | extern const char* srs_human_format_time(); | 927 | extern const char* srs_human_format_time(); |
| 928 | 928 | ||
| 929 | -// when hijack the log, user will defines this macros. | ||
| 930 | -#ifndef SRS_HIJACK_LOG | 929 | +// when disabled log, donot compile it. |
| 930 | +#ifdef SRS_DISABLE_LOG | ||
| 931 | + #define srs_human_trace(msg, ...) (void)0 | ||
| 932 | + #define srs_human_verbose(msg, ...) (void)0 | ||
| 933 | + #define srs_human_raw(msg, ...) (void)0 | ||
| 934 | +#else | ||
| 931 | #define srs_human_trace(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n") | 935 | #define srs_human_trace(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n") |
| 932 | #define srs_human_verbose(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n") | 936 | #define srs_human_verbose(msg, ...) printf("[%s] ", srs_human_format_time());printf(msg, ##__VA_ARGS__);printf("\n") |
| 933 | #define srs_human_raw(msg, ...) printf(msg, ##__VA_ARGS__) | 937 | #define srs_human_raw(msg, ...) printf(msg, ##__VA_ARGS__) |
| @@ -944,6 +948,10 @@ typedef void* srs_hijack_io_t; | @@ -944,6 +948,10 @@ typedef void* srs_hijack_io_t; | ||
| 944 | // the example @see https://github.com/winlinvip/st-load | 948 | // the example @see https://github.com/winlinvip/st-load |
| 945 | // which use librtmp but use its own io(use st also). | 949 | // which use librtmp but use its own io(use st also). |
| 946 | #ifdef SRS_HIJACK_IO | 950 | #ifdef SRS_HIJACK_IO |
| 951 | + #ifndef _WIN32 | ||
| 952 | + // for iovec. | ||
| 953 | + #include <sys/uio.h> | ||
| 954 | + #endif | ||
| 947 | /** | 955 | /** |
| 948 | * create hijack. | 956 | * create hijack. |
| 949 | * @return NULL for error; otherwise, ok. | 957 | * @return NULL for error; otherwise, ok. |
-
请 注册 或 登录 后发表评论