mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refactor macro SRS_AUTO_XXX to SRS_XXX.
This commit is contained in:
parent
2fe1874a87
commit
ed338f4c0a
31 changed files with 193 additions and 198 deletions
|
@ -40,7 +40,7 @@ using namespace std;
|
|||
#include <srs_kernel_utility.hpp>
|
||||
#include <srs_core_mem_watch.hpp>
|
||||
#include <srs_core_autofree.hpp>
|
||||
#ifdef SRS_AUTO_RTC
|
||||
#ifdef SRS_RTC
|
||||
#include <srs_kernel_rtp.hpp>
|
||||
#endif
|
||||
|
||||
|
@ -164,7 +164,7 @@ SrsCommonMessage::SrsCommonMessage()
|
|||
|
||||
SrsCommonMessage::~SrsCommonMessage()
|
||||
{
|
||||
#ifdef SRS_AUTO_MEM_WATCH
|
||||
#ifdef SRS_MEM_WATCH
|
||||
srs_memory_unwatch(payload);
|
||||
#endif
|
||||
srs_freepa(payload);
|
||||
|
@ -177,7 +177,7 @@ void SrsCommonMessage::create_payload(int size)
|
|||
payload = new char[size];
|
||||
srs_verbose("create payload for RTMP message. size=%d", size);
|
||||
|
||||
#ifdef SRS_AUTO_MEM_WATCH
|
||||
#ifdef SRS_MEM_WATCH
|
||||
srs_memory_watch(payload, "RTMP.msg.payload", size);
|
||||
#endif
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ SrsSharedPtrMessage::SrsSharedPtrPayload::SrsSharedPtrPayload()
|
|||
size = 0;
|
||||
shared_count = 0;
|
||||
|
||||
#ifdef SRS_AUTO_RTC
|
||||
#ifdef SRS_RTC
|
||||
samples = NULL;
|
||||
nn_samples = 0;
|
||||
has_idr = false;
|
||||
|
@ -224,12 +224,12 @@ SrsSharedPtrMessage::SrsSharedPtrPayload::SrsSharedPtrPayload()
|
|||
|
||||
SrsSharedPtrMessage::SrsSharedPtrPayload::~SrsSharedPtrPayload()
|
||||
{
|
||||
#ifdef SRS_AUTO_MEM_WATCH
|
||||
#ifdef SRS_MEM_WATCH
|
||||
srs_memory_unwatch(payload);
|
||||
#endif
|
||||
srs_freepa(payload);
|
||||
|
||||
#ifdef SRS_AUTO_RTC
|
||||
#ifdef SRS_RTC
|
||||
srs_freepa(samples);
|
||||
|
||||
for (int i = 0; i < nn_extra_payloads; i++) {
|
||||
|
@ -376,7 +376,7 @@ SrsSharedPtrMessage* SrsSharedPtrMessage::copy()
|
|||
return copy;
|
||||
}
|
||||
|
||||
#ifdef SRS_AUTO_RTC
|
||||
#ifdef SRS_RTC
|
||||
void SrsSharedPtrMessage::set_extra_payloads(SrsSample* payloads, int nn_payloads)
|
||||
{
|
||||
srs_assert(nn_payloads);
|
||||
|
|
|
@ -302,7 +302,7 @@ private:
|
|||
int size;
|
||||
// The reference count
|
||||
int shared_count;
|
||||
#ifdef SRS_AUTO_RTC
|
||||
#ifdef SRS_RTC
|
||||
public:
|
||||
// For RTC video, we need to know the NALU structures,
|
||||
// because the RTP STAP-A or FU-A based on NALU.
|
||||
|
@ -361,7 +361,7 @@ public:
|
|||
// @remark, assert object is created.
|
||||
virtual SrsSharedPtrMessage* copy();
|
||||
public:
|
||||
#ifdef SRS_AUTO_RTC
|
||||
#ifdef SRS_RTC
|
||||
// Set extra samples, for example, when we transcode an AAC audio packet to OPUS,
|
||||
// we may get more than one OPUS packets, we set these OPUS packets in extra payloads.
|
||||
void set_extra_payloads(SrsSample* payloads, int nn_payloads);
|
||||
|
|
|
@ -129,15 +129,15 @@ extern ISrsThreadContext* _srs_context;
|
|||
#endif
|
||||
|
||||
// TODO: FIXME: Add more verbose and info logs.
|
||||
#ifndef SRS_AUTO_VERBOSE
|
||||
#ifndef SRS_VERBOSE
|
||||
#undef srs_verbose
|
||||
#define srs_verbose(msg, ...) (void)0
|
||||
#endif
|
||||
#ifndef SRS_AUTO_INFO
|
||||
#ifndef SRS_INFO
|
||||
#undef srs_info
|
||||
#define srs_info(msg, ...) (void)0
|
||||
#endif
|
||||
#ifndef SRS_AUTO_TRACE
|
||||
#ifndef SRS_TRACE
|
||||
#undef srs_trace
|
||||
#define srs_trace(msg, ...) (void)0
|
||||
#endif
|
||||
|
|
|
@ -124,7 +124,7 @@ srs_utime_t srs_get_system_startup_time()
|
|||
}
|
||||
|
||||
// For utest to mock it.
|
||||
#ifndef SRS_AUTO_OSX
|
||||
#ifndef SRS_OSX
|
||||
_srs_gettimeofday_t _srs_gettimeofday = ::gettimeofday;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ extern int srs_chunk_header_c3(int perfer_cid, uint32_t timestamp, char* cache,
|
|||
|
||||
// For utest to mock it.
|
||||
#include <sys/time.h>
|
||||
#ifdef SRS_AUTO_OSX
|
||||
#ifdef SRS_OSX
|
||||
#define _srs_gettimeofday gettimeofday
|
||||
#else
|
||||
typedef int (*_srs_gettimeofday_t) (struct timeval* tv, struct timezone* tz);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue