mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge branch 'develop' into merge/develop
This commit is contained in:
commit
7a6f77bb80
7 changed files with 60 additions and 33 deletions
2
trunk/configure
vendored
2
trunk/configure
vendored
|
@ -200,7 +200,7 @@ MODULE_ID="CORE"
|
||||||
MODULE_DEPENDS=()
|
MODULE_DEPENDS=()
|
||||||
ModuleLibIncs=(${SRS_OBJS_DIR})
|
ModuleLibIncs=(${SRS_OBJS_DIR})
|
||||||
MODULE_FILES=("srs_core" "srs_core_version5" "srs_core_autofree" "srs_core_performance"
|
MODULE_FILES=("srs_core" "srs_core_version5" "srs_core_autofree" "srs_core_performance"
|
||||||
"srs_core_time")
|
"srs_core_time" "srs_core_platform")
|
||||||
CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh
|
CORE_INCS="src/core"; MODULE_DIR=${CORE_INCS} . auto/modules.sh
|
||||||
CORE_OBJS="${MODULE_OBJS[@]}"
|
CORE_OBJS="${MODULE_OBJS[@]}"
|
||||||
#
|
#
|
||||||
|
|
|
@ -1626,7 +1626,7 @@ srs_error_t SrsServerAdapter::initialize()
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsServerAdapter::run()
|
srs_error_t SrsServerAdapter::run(SrsWaitGroup* wg)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
|
@ -1663,7 +1663,7 @@ srs_error_t SrsServerAdapter::run()
|
||||||
return srs_error_wrap(err, "ingest");
|
return srs_error_wrap(err, "ingest");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((err = srs->start()) != srs_success) {
|
if ((err = srs->start(wg)) != srs_success) {
|
||||||
return srs_error_wrap(err, "start");
|
return srs_error_wrap(err, "start");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -343,7 +343,7 @@ public:
|
||||||
virtual ~SrsServerAdapter();
|
virtual ~SrsServerAdapter();
|
||||||
public:
|
public:
|
||||||
virtual srs_error_t initialize();
|
virtual srs_error_t initialize();
|
||||||
virtual srs_error_t run();
|
virtual srs_error_t run(SrsWaitGroup* wg);
|
||||||
virtual void stop();
|
virtual void stop();
|
||||||
public:
|
public:
|
||||||
virtual SrsServer* instance();
|
virtual SrsServer* instance();
|
||||||
|
|
|
@ -32,34 +32,8 @@
|
||||||
#define VERSION_STABLE 4
|
#define VERSION_STABLE 4
|
||||||
#define VERSION_STABLE_BRANCH SRS_XSTR(VERSION_STABLE) ".0release"
|
#define VERSION_STABLE_BRANCH SRS_XSTR(VERSION_STABLE) ".0release"
|
||||||
|
|
||||||
// For 32bit os, 2G big file limit for unistd io,
|
// For platform specified headers and defines.
|
||||||
// ie. read/write/lseek to use 64bits size for huge file.
|
#include <srs_core_platform.hpp>
|
||||||
#ifndef _FILE_OFFSET_BITS
|
|
||||||
#define _FILE_OFFSET_BITS 64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// For int64_t print using PRId64 format.
|
|
||||||
#ifndef __STDC_FORMAT_MACROS
|
|
||||||
#define __STDC_FORMAT_MACROS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// For RTC/FFMPEG build.
|
|
||||||
#if defined(SRS_RTC) && !defined(__STDC_CONSTANT_MACROS)
|
|
||||||
#define __STDC_CONSTANT_MACROS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// For srs-librtmp, @see https://github.com/ossrs/srs/issues/213
|
|
||||||
#ifndef _WIN32
|
|
||||||
#include <inttypes.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#ifndef srs_assert
|
|
||||||
#define srs_assert(expression) assert(expression)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
// The time unit for timeout, interval or duration.
|
// The time unit for timeout, interval or duration.
|
||||||
#include <srs_core_time.hpp>
|
#include <srs_core_time.hpp>
|
||||||
|
|
8
trunk/src/core/srs_core_platform.cpp
Normal file
8
trunk/src/core/srs_core_platform.cpp
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013-2021 The SRS Authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <srs_core_platform.hpp>
|
||||||
|
|
45
trunk/src/core/srs_core_platform.hpp
Normal file
45
trunk/src/core/srs_core_platform.hpp
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
//
|
||||||
|
// Copyright (c) 2013-2021 The SRS Authors
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef SRS_CORE_PLATFORM_HPP
|
||||||
|
#define SRS_CORE_PLATFORM_HPP
|
||||||
|
|
||||||
|
// 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.
|
||||||
|
#ifndef __STDC_FORMAT_MACROS
|
||||||
|
#define __STDC_FORMAT_MACROS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For RTC/FFMPEG build.
|
||||||
|
#if defined(SRS_RTC) && !defined(__STDC_CONSTANT_MACROS)
|
||||||
|
#define __STDC_CONSTANT_MACROS
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For srs-librtmp, @see https://github.com/ossrs/srs/issues/213
|
||||||
|
#ifndef _WIN32
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#ifndef srs_assert
|
||||||
|
#define srs_assert(expression) assert(expression)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
// For CentOS 6 or C++98, @see https://github.com/ossrs/srs/issues/2815
|
||||||
|
#ifndef UINT32_MAX
|
||||||
|
#define UINT32_MAX (4294967295U)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -1010,7 +1010,7 @@ srs_error_t SrsRtcpTWCC::process_pkt_chunk(SrsRtcpTWCC::SrsRtcpTWCCChunk& chunk,
|
||||||
size_t needed_chunk_size = chunk.size == 0 ? kTwccFbChunkBytes : 0;
|
size_t needed_chunk_size = chunk.size == 0 ? kTwccFbChunkBytes : 0;
|
||||||
|
|
||||||
size_t might_occupied = pkt_len + needed_chunk_size + delta_size;
|
size_t might_occupied = pkt_len + needed_chunk_size + delta_size;
|
||||||
if (might_occupied > kRtcpPacketSize) {
|
if (might_occupied > (size_t)kRtcpPacketSize) {
|
||||||
return srs_error_new(ERROR_RTC_RTCP, "might_occupied %zu", might_occupied);
|
return srs_error_new(ERROR_RTC_RTCP, "might_occupied %zu", might_occupied);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue