|
|
|
@ -24,22 +24,20 @@
|
|
|
|
|
#ifndef SRS_CORE_HPP
|
|
|
|
|
#define SRS_CORE_HPP
|
|
|
|
|
|
|
|
|
|
// current release version
|
|
|
|
|
// The version config.
|
|
|
|
|
#define VERSION_MAJOR 3
|
|
|
|
|
#define VERSION_MINOR 0
|
|
|
|
|
#define VERSION_REVISION 49
|
|
|
|
|
|
|
|
|
|
// generated by configure, only macros.
|
|
|
|
|
// The macros generated by configure script.
|
|
|
|
|
#include <srs_auto_headers.hpp>
|
|
|
|
|
|
|
|
|
|
// provider info.
|
|
|
|
|
// The project informations, may sent to client in HTTP header or RTMP metadata.
|
|
|
|
|
#define RTMP_SIG_SRS_KEY "SRS"
|
|
|
|
|
#define RTMP_SIG_SRS_CODE "OuXuli"
|
|
|
|
|
#define RTMP_SIG_SRS_AUTHROS "winlin,wenjie.zhao"
|
|
|
|
|
// contact info.
|
|
|
|
|
#define RTMP_SIG_SRS_WEB "http://ossrs.net"
|
|
|
|
|
#define RTMP_SIG_SRS_EMAIL "winlin@vip.126.com"
|
|
|
|
|
// debug info.
|
|
|
|
|
#define RTMP_SIG_SRS_ROLE "cluster"
|
|
|
|
|
#define RTMP_SIG_SRS_URL "https://github.com/ossrs/srs"
|
|
|
|
|
#define RTMP_SIG_SRS_LICENSE "The MIT License (MIT)"
|
|
|
|
@ -49,33 +47,27 @@
|
|
|
|
|
#define RTMP_SIG_SRS_VERSION SRS_XSTR(VERSION_MAJOR) "." SRS_XSTR(VERSION_MINOR) "." SRS_XSTR(VERSION_REVISION)
|
|
|
|
|
#define RTMP_SIG_SRS_SERVER RTMP_SIG_SRS_KEY "/" RTMP_SIG_SRS_VERSION "(" RTMP_SIG_SRS_CODE ")"
|
|
|
|
|
|
|
|
|
|
// stable major version
|
|
|
|
|
// The current stable release.
|
|
|
|
|
#define VERSION_STABLE 2
|
|
|
|
|
#define VERSION_STABLE_BRANCH SRS_XSTR(VERSION_STABLE)".0release"
|
|
|
|
|
|
|
|
|
|
// internal macros, covert macro values to str,
|
|
|
|
|
// see: read https://gcc.gnu.org/onlinedocs/cpp/Stringification.html#Stringification
|
|
|
|
|
// To convert macro values to string.
|
|
|
|
|
// @see https://gcc.gnu.org/onlinedocs/cpp/Stringification.html#Stringification
|
|
|
|
|
#define SRS_XSTR(v) SRS_INTERNAL_STR(v)
|
|
|
|
|
#define SRS_INTERNAL_STR(v) #v
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* the core provides the common defined macros, utilities,
|
|
|
|
|
* user must include the srs_core.hpp before any header, or maybe
|
|
|
|
|
* build failed.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// for 32bit os, 2G big file limit for unistd io,
|
|
|
|
|
// For 32bit os, 2G big file limit for unistd io,
|
|
|
|
|
// ie. read/write/lseek to use 64bits size for huge file.
|
|
|
|
|
#ifndef _FILE_OFFSET_BITS
|
|
|
|
|
#define _FILE_OFFSET_BITS 64
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// for int64_t print using PRId64 format.
|
|
|
|
|
// For int64_t print using PRId64 format.
|
|
|
|
|
#ifndef __STDC_FORMAT_MACROS
|
|
|
|
|
#define __STDC_FORMAT_MACROS
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
// for srs-librtmp, @see https://github.com/ossrs/srs/issues/213
|
|
|
|
|
// For srs-librtmp, @see https://github.com/ossrs/srs/issues/213
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
#endif
|
|
|
|
@ -86,22 +78,21 @@
|
|
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
// Time defines.
|
|
|
|
|
// The time unit for timeout, interval or duration.
|
|
|
|
|
#include <srs_core_time.hpp>
|
|
|
|
|
|
|
|
|
|
// Some important performance options.
|
|
|
|
|
#include <srs_core_performance.hpp>
|
|
|
|
|
|
|
|
|
|
// free the p and set to NULL.
|
|
|
|
|
// p must be a T*.
|
|
|
|
|
// To free the p and set to NULL.
|
|
|
|
|
// @remark The p must be a pointer T*.
|
|
|
|
|
#define srs_freep(p) \
|
|
|
|
|
if (p) { \
|
|
|
|
|
delete p; \
|
|
|
|
|
p = NULL; \
|
|
|
|
|
} \
|
|
|
|
|
(void)0
|
|
|
|
|
// please use the freepa(T[]) to free an array,
|
|
|
|
|
// or the behavior is undefined.
|
|
|
|
|
// Please use the freepa(T[]) to free an array, otherwise the behavior is undefined.
|
|
|
|
|
#define srs_freepa(pa) \
|
|
|
|
|
if (pa) { \
|
|
|
|
|
delete[] pa; \
|
|
|
|
@ -109,11 +100,8 @@
|
|
|
|
|
} \
|
|
|
|
|
(void)0
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* important check for st(state-threads),
|
|
|
|
|
* only support the following cpus: i386/amd64/x86_64/arm
|
|
|
|
|
* @reamrk to patch ST for arm, read https://github.com/ossrs/state-threads/issues/1
|
|
|
|
|
*/
|
|
|
|
|
// Checking for st(state-threads), only support the following cpus: i386/amd64/x86_64/arm
|
|
|
|
|
// @reamrk to patch ST for arm, read https://github.com/ossrs/state-threads/issues/1
|
|
|
|
|
#if !defined(__amd64__) && !defined(__x86_64__) && !defined(__i386__) && !defined(__arm__)
|
|
|
|
|
#error "only support i386/amd64/x86_64/arm cpu"
|
|
|
|
|
#endif
|
|
|
|
|