mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge 5.0.100, v5.0-a1 into develop.
This commit is contained in:
commit
fa177679a6
13 changed files with 1088 additions and 108 deletions
17
.github/workflows/test.yml
vendored
17
.github/workflows/test.yml
vendored
|
@ -82,22 +82,6 @@ jobs:
|
|||
outputs:
|
||||
SRS_BUILD_CENTOS7_DONE: ok
|
||||
|
||||
build-centos6:
|
||||
name: build-centos6
|
||||
runs-on: ubuntu-20.04
|
||||
needs:
|
||||
- utest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
# Build for CentOS 6
|
||||
- name: Build on CentOS6, baseline
|
||||
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos6-baseline .
|
||||
- name: Build on CentOS6, with all features
|
||||
run: DOCKER_BUILDKIT=1 docker build -f trunk/Dockerfile.builds --target centos6-all .
|
||||
outputs:
|
||||
SRS_BUILD_CENTOS6_DONE: ok
|
||||
|
||||
build-ubuntu16:
|
||||
name: build-ubuntu16
|
||||
runs-on: ubuntu-20.04
|
||||
|
@ -176,7 +160,6 @@ jobs:
|
|||
name: build
|
||||
needs:
|
||||
- build-centos7
|
||||
- build-centos6
|
||||
- build-ubuntu16
|
||||
- build-ubuntu18
|
||||
- build-ubuntu20
|
||||
|
|
|
@ -137,6 +137,7 @@ but some third-party libraries are distributed using their [own licenses](https:
|
|||
|
||||
## Releases
|
||||
|
||||
* 2022-12-01, [Release v5.0-a1](https://github.com/ossrs/srs/releases/tag/v5.0-a1), v5.0-a1, 5.0 alpha1, v5.0.100, 160817 lines.
|
||||
* 2022-11-25, [Release v5.0-a0](https://github.com/ossrs/srs/releases/tag/v5.0-a0), v5.0-a0, 5.0 alpha0, v5.0.98, 159813 lines.
|
||||
* 2022-11-22, Release [v4.0-r4](https://github.com/ossrs/srs/releases/tag/v4.0-r4), v4.0-r4, 4.0 release4, v4.0.268, 145482 lines.
|
||||
* 2022-09-16, Release [v4.0-r3](https://github.com/ossrs/srs/releases/tag/v4.0-r3), v4.0-r3, 4.0 release3, v4.0.265, 145328 lines.
|
||||
|
|
|
@ -34,12 +34,6 @@ RUN cp -R conf /usr/local/srs/conf && \
|
|||
cp -R research/players /usr/local/srs/objs/nginx/html/ && \
|
||||
cp -R 3rdparty/signaling/www/demos /usr/local/srs/objs/nginx/html/
|
||||
|
||||
# Copy the shared libraries for FFmpeg.
|
||||
RUN mkdir -p /usr/local/shared && \
|
||||
cp $(ldd /usr/local/bin/ffmpeg |grep libxml2 |awk '{print $3}') /usr/local/shared/ && \
|
||||
cp $(ldd /usr/local/bin/ffmpeg |grep libicuuc |awk '{print $3}') /usr/local/shared/ && \
|
||||
cp $(ldd /usr/local/bin/ffmpeg |grep libicudata |awk '{print $3}') /usr/local/shared/
|
||||
|
||||
############################################################
|
||||
# dist
|
||||
############################################################
|
||||
|
@ -53,7 +47,6 @@ RUN echo "BUILDPLATFORM: $BUILDPLATFORM, TARGETPLATFORM: $TARGETPLATFORM"
|
|||
EXPOSE 1935 1985 8080 8000/udp 10080/udp
|
||||
|
||||
# FFMPEG 4.1
|
||||
COPY --from=build /usr/local/shared/* /lib/
|
||||
COPY --from=build /usr/local/bin/ffmpeg /usr/local/srs/objs/ffmpeg/bin/ffmpeg
|
||||
# SRS binary, config files and srs-console.
|
||||
COPY --from=build /usr/local/srs /usr/local/srs
|
||||
|
|
|
@ -19,15 +19,6 @@ FROM ossrs/srs:dev-cache AS centos7-ansi-no-ffmpeg
|
|||
COPY . /srs
|
||||
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --cxx11=off --cxx14=off --ffmpeg-fit=off && make
|
||||
|
||||
########################################################
|
||||
FROM ossrs/srs:dev6-cache AS centos6-baseline
|
||||
COPY . /srs
|
||||
RUN cd /srs/trunk && ./configure --srt=off --gb28181=off --cxx11=off --cxx14=off --sanitizer=off && make
|
||||
|
||||
FROM ossrs/srs:dev6-cache AS centos6-all
|
||||
COPY . /srs
|
||||
RUN cd /srs/trunk && ./configure --srt=on --gb28181=on --h265=on --cxx11=off --cxx14=off --sanitizer=off && make
|
||||
|
||||
########################################################
|
||||
FROM ossrs/srs:ubuntu16-cache AS ubuntu16-baseline
|
||||
COPY . /srs
|
||||
|
|
|
@ -914,6 +914,7 @@ vhost scope.vhost.srs.com {
|
|||
# the default chunk size is 128, max is 65536,
|
||||
# some client does not support chunk size change,
|
||||
# vhost chunk size will override the global value.
|
||||
# Overwrite by env SRS_VHOST_CHUNK_SIZE for all vhosts.
|
||||
# default: global chunk size.
|
||||
chunk_size 128;
|
||||
|
||||
|
@ -922,11 +923,13 @@ vhost scope.vhost.srs.com {
|
|||
# but for some peer(encoder), it never send message but use a different ack size.
|
||||
# We can chnage the default ack size in server-side, to send acknowledge message,
|
||||
# or the encoder maybe blocked after publishing for some time.
|
||||
# Overwrite by env SRS_VHOST_IN_ACK_SIZE for all vhosts.
|
||||
# Default: 0
|
||||
in_ack_size 0;
|
||||
|
||||
# The output ack size, 0 to not set.
|
||||
# This is used to notify the peer(player) to send acknowledge to server.
|
||||
# Overwrite by env SRS_VHOST_OUT_ACK_SIZE for all vhosts.
|
||||
# Default: 2500000
|
||||
out_ack_size 2500000;
|
||||
}
|
||||
|
@ -1099,6 +1102,7 @@ vhost play.srs.com {
|
|||
|
||||
# Limit the max frames in gop cache. It might cause OOM if video stream has no IDR frame, so we limit to N
|
||||
# frames by default. Note that it's the size of gop cache, including videos, audios and other messages.
|
||||
# Overwrite by env SRS_VHOST_PLAY_GOP_CACHE_MAX_FRAMES for all vhosts.
|
||||
# default: 2500
|
||||
gop_cache_max_frames 2500;
|
||||
|
||||
|
@ -1700,6 +1704,7 @@ vhost hls.srs.com {
|
|||
hls_ts_ctx on;
|
||||
|
||||
# the hls fragment in seconds, the duration of a piece of ts.
|
||||
# Overwrite by env SRS_VHOST_HLS_HLS_FRAGMENT for all vhosts.
|
||||
# default: 10
|
||||
hls_fragment 10;
|
||||
# the hls m3u8 target duration ratio,
|
||||
|
@ -1892,7 +1897,7 @@ vhost hds.srs.com {
|
|||
# default: off
|
||||
enabled on;
|
||||
# the hds fragment in seconds.
|
||||
# Overwrite by env SRS_VHOST_HDS_FRAGMENT for all vhosts.
|
||||
# Overwrite by env SRS_VHOST_HDS_HDS_FRAGMENT for all vhosts.
|
||||
# default: 10
|
||||
hds_fragment 10;
|
||||
# the hds window in seconds, erase the segment when exceed the window.
|
||||
|
|
|
@ -18,6 +18,8 @@ The changelog for SRS.
|
|||
|
||||
## SRS 5.0 Changelog
|
||||
|
||||
* v5.0, 2022-12-01, Config: Add utest for configuring with ENV variables. v5.0.100
|
||||
* v5.0, 2022-12-01, Live: Fix bug for gop cache limits. v5.0.99
|
||||
* v5.0, 2022-11-25, SRT: Support transform tlpkdrop to tlpktdrop. 5.0.98
|
||||
* v5.0, 2022-11-25, Config: Add ENV tips for config. 5.0.97
|
||||
* v5.0, 2022-11-24, For [#299](https://github.com/ossrs/srs/issues/299), DASH: Fix number mode bug to make it run. 5.0.96
|
||||
|
|
|
@ -2805,7 +2805,7 @@ bool SrsConfig::get_daemon()
|
|||
|
||||
bool SrsConfig::get_in_docker()
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.in_docker");
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.in_docker"); // SRS_IN_DOCKER
|
||||
|
||||
static bool DEFAULT = false;
|
||||
|
||||
|
@ -2897,7 +2897,7 @@ string SrsConfig::get_server_id()
|
|||
// Get the server id from env, config or DEFAULT.
|
||||
string server_id;
|
||||
|
||||
if (!srs_getenv("srs.server_id").empty()) {
|
||||
if (!srs_getenv("srs.server_id").empty()) { // SRS_SERVER_ID
|
||||
server_id = srs_getenv("srs.server_id");
|
||||
} else {
|
||||
SrsConfDirective* conf = root->get("server_id");
|
||||
|
@ -2935,8 +2935,7 @@ vector<string> SrsConfig::get_listens()
|
|||
std::vector<string> ports;
|
||||
|
||||
if (!srs_getenv("srs.listen").empty()) { // SRS_LISTEN
|
||||
ports.push_back(srs_getenv("srs.listen"));
|
||||
return ports;
|
||||
return srs_string_split(srs_getenv("srs.listen"), " ");
|
||||
}
|
||||
|
||||
SrsConfDirective* conf = root->get("listen");
|
||||
|
@ -3311,7 +3310,7 @@ int SrsConfig::get_dying_threshold()
|
|||
|
||||
int SrsConfig::get_dying_pulse()
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_INT("srs.circuit_breaker.dying_threshold"); // SRS_CIRCUIT_BREAKER_DYING_THRESHOLD
|
||||
SRS_OVERWRITE_BY_ENV_INT("srs.circuit_breaker.dying_pulse"); // SRS_CIRCUIT_BREAKER_DYING_PULSE
|
||||
|
||||
static int DEFAULT = 5;
|
||||
|
||||
|
@ -4505,7 +4504,7 @@ srs_utime_t SrsConfig::get_rtc_pli_for_rtmp(string vhost)
|
|||
static srs_utime_t DEFAULT = 6 * SRS_UTIME_SECONDS;
|
||||
srs_utime_t v = 0;
|
||||
|
||||
if (!srs_getenv("srs.vhost.rtc.pli_for_rtmp").empty()) { // SRS_
|
||||
if (!srs_getenv("srs.vhost.rtc.pli_for_rtmp").empty()) { // SRS_VHOST_RTC_PLI_FOR_RTMP
|
||||
v = (srs_utime_t)(::atof(srs_getenv("srs.vhost.rtc.pli_for_rtmp").c_str()) * SRS_UTIME_SECONDS);
|
||||
} else {
|
||||
SrsConfDirective* conf = get_rtc(vhost);
|
||||
|
@ -4769,8 +4768,8 @@ bool SrsConfig::get_atc_auto(string vhost)
|
|||
|
||||
int SrsConfig::get_time_jitter(string vhost)
|
||||
{
|
||||
if (!srs_getenv("srs.vhost.play.mw_latency").empty()) { // SRS_
|
||||
return srs_time_jitter_string2int(srs_getenv("srs.vhost.play.mw_latency"));
|
||||
if (!srs_getenv("srs.vhost.play.time_jitter").empty()) { // SRS_VHOST_PLAY_TIME_JITTER
|
||||
return srs_time_jitter_string2int(srs_getenv("srs.vhost.play.time_jitter"));
|
||||
}
|
||||
|
||||
static string DEFAULT = "full";
|
||||
|
@ -4916,6 +4915,8 @@ SrsConfDirective* SrsConfig::get_refer_publish(string vhost)
|
|||
|
||||
int SrsConfig::get_in_ack_size(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_INT("srs.vhost.in_ack_size"); // SRS_VHOST_IN_ACK_SIZE
|
||||
|
||||
static int DEFAULT = 0;
|
||||
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
@ -4933,6 +4934,8 @@ int SrsConfig::get_in_ack_size(string vhost)
|
|||
|
||||
int SrsConfig::get_out_ack_size(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_INT("srs.vhost.out_ack_size"); // SRS_VHOST_OUT_ACK_SIZE
|
||||
|
||||
static int DEFAULT = 2500000;
|
||||
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
@ -4950,6 +4953,8 @@ int SrsConfig::get_out_ack_size(string vhost)
|
|||
|
||||
int SrsConfig::get_chunk_size(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_INT("srs.vhost.chunk_size"); // SRS_VHOST_CHUNK_SIZE
|
||||
|
||||
if (vhost.empty()) {
|
||||
return get_global_chunk_size();
|
||||
}
|
||||
|
@ -5069,7 +5074,7 @@ srs_utime_t SrsConfig::get_mr_sleep(string vhost)
|
|||
|
||||
srs_utime_t SrsConfig::get_mw_sleep(string vhost, bool is_rtc)
|
||||
{
|
||||
if (!srs_getenv("srs.vhost.play.mw_latency").empty()) { // SRS_
|
||||
if (!srs_getenv("srs.vhost.play.mw_latency").empty()) { // SRS_VHOST_PLAY_MW_LATENCY
|
||||
int v = ::atoi(srs_getenv("srs.vhost.play.mw_latency").c_str());
|
||||
if (is_rtc && v > 0) {
|
||||
srs_warn("For RTC, we ignore mw_latency");
|
||||
|
@ -5110,7 +5115,7 @@ srs_utime_t SrsConfig::get_mw_sleep(string vhost, bool is_rtc)
|
|||
|
||||
int SrsConfig::get_mw_msgs(string vhost, bool is_realtime, bool is_rtc)
|
||||
{
|
||||
if (!srs_getenv("srs.vhost.play.mw_msgs").empty()) { // SRS_
|
||||
if (!srs_getenv("srs.vhost.play.mw_msgs").empty()) { // SRS_VHOST_PLAY_MW_MSGS
|
||||
int v = ::atoi(srs_getenv("srs.vhost.play.mw_msgs").c_str());
|
||||
if (v > SRS_PERF_MW_MSGS) {
|
||||
srs_warn("reset mw_msgs %d to max %d", v, SRS_PERF_MW_MSGS);
|
||||
|
@ -5303,7 +5308,7 @@ srs_utime_t SrsConfig::get_publish_normal_timeout(string vhost)
|
|||
|
||||
int SrsConfig::get_global_chunk_size()
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_INT("srs.chunk_size"); // SRS_CHUNK_SIZE
|
||||
SRS_OVERWRITE_BY_ENV_INT("srs.vhost.chunk_size"); // SRS_VHOST_CHUNK_SIZE
|
||||
|
||||
SrsConfDirective* conf = root->get("chunk_size");
|
||||
if (!conf || conf->arg0().empty()) {
|
||||
|
@ -6639,6 +6644,8 @@ bool SrsConfig::get_hls_enabled(string vhost)
|
|||
|
||||
bool SrsConfig::get_hls_enabled(SrsConfDirective* vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.hls.enabled"); // SRS_VHOST_HLS_ENABLED
|
||||
|
||||
static bool DEFAULT = false;
|
||||
|
||||
SrsConfDirective* conf = vhost->get("hls");
|
||||
|
@ -6733,6 +6740,8 @@ string SrsConfig::get_hls_ts_file(string vhost)
|
|||
|
||||
bool SrsConfig::get_hls_ts_floor(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.hls.hls_ts_floor"); // SRS_VHOST_HLS_HLS_TS_FLOOR
|
||||
|
||||
static bool DEFAULT = false;
|
||||
|
||||
SrsConfDirective* conf = get_hls(vhost);
|
||||
|
@ -7239,6 +7248,8 @@ bool SrsConfig::get_dvr_enabled(string vhost)
|
|||
|
||||
bool SrsConfig::get_dvr_enabled(SrsConfDirective* vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.dvr.enabled"); // SRS_VHOST_DVR_ENABLED
|
||||
|
||||
static bool DEFAULT = false;
|
||||
|
||||
SrsConfDirective* conf = vhost->get("dvr");
|
||||
|
@ -7347,8 +7358,8 @@ bool SrsConfig::get_dvr_wait_keyframe(string vhost)
|
|||
|
||||
int SrsConfig::get_dvr_time_jitter(string vhost)
|
||||
{
|
||||
if (!srs_getenv("srs.vhost.dvr.dvr_wait_keyframe").empty()) { // SRS_
|
||||
return srs_time_jitter_string2int(srs_getenv("srs.vhost.dvr.dvr_wait_keyframe"));
|
||||
if (!srs_getenv("srs.vhost.dvr.time_jitter").empty()) { // SRS_VHOST_DVR_TIME_JITTER
|
||||
return srs_time_jitter_string2int(srs_getenv("srs.vhost.dvr.time_jitter"));
|
||||
}
|
||||
|
||||
static string DEFAULT = "full";
|
||||
|
@ -8103,7 +8114,7 @@ string SrsConfig::get_https_stream_ssl_cert()
|
|||
|
||||
bool SrsConfig::get_vhost_http_enabled(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.http_static.enabled"); // SRS_HTTP_STATIC_ENABLED
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.http_static.enabled"); // SRS_VHOST_HTTP_STATIC_ENABLED
|
||||
|
||||
static bool DEFAULT = false;
|
||||
|
||||
|
@ -8127,7 +8138,7 @@ bool SrsConfig::get_vhost_http_enabled(string vhost)
|
|||
|
||||
string SrsConfig::get_vhost_http_mount(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_STRING("srs.http_static.mount"); // SRS_HTTP_STATIC_MOUNT
|
||||
SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.http_static.mount"); // SRS_VHOST_HTTP_STATIC_MOUNT
|
||||
|
||||
static string DEFAULT = "[vhost]/";
|
||||
|
||||
|
@ -8151,7 +8162,7 @@ string SrsConfig::get_vhost_http_mount(string vhost)
|
|||
|
||||
string SrsConfig::get_vhost_http_dir(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_STRING("srs.http_static.dir"); // SRS_HTTP_STATIC_DIR
|
||||
SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.http_static.dir"); // SRS_VHOST_HTTP_STATIC_DIR
|
||||
|
||||
static string DEFAULT = "./objs/nginx/html";
|
||||
|
||||
|
@ -8175,6 +8186,8 @@ string SrsConfig::get_vhost_http_dir(string vhost)
|
|||
|
||||
bool SrsConfig::get_vhost_http_remux_enabled(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.http_remux.enabled"); // SRS_VHOST_HTTP_REMUX_ENABLED
|
||||
|
||||
static bool DEFAULT = false;
|
||||
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
@ -8187,7 +8200,7 @@ bool SrsConfig::get_vhost_http_remux_enabled(string vhost)
|
|||
|
||||
bool SrsConfig::get_vhost_http_remux_enabled(SrsConfDirective* vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.http_remux.enabled"); // SRS_HTTP_REMUX_ENABLED
|
||||
SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.http_remux.enabled"); // SRS_VHOST_HTTP_REMUX_ENABLED
|
||||
|
||||
static bool DEFAULT = false;
|
||||
|
||||
|
@ -8206,7 +8219,7 @@ bool SrsConfig::get_vhost_http_remux_enabled(SrsConfDirective* vhost)
|
|||
|
||||
srs_utime_t SrsConfig::get_vhost_http_remux_fast_cache(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.http_remux.fast_cache"); // SRS_HTTP_REMUX_FAST_CACHE
|
||||
SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.http_remux.fast_cache"); // SRS_VHOST_HTTP_REMUX_FAST_CACHE
|
||||
|
||||
static srs_utime_t DEFAULT = 0;
|
||||
|
||||
|
@ -8230,7 +8243,7 @@ srs_utime_t SrsConfig::get_vhost_http_remux_fast_cache(string vhost)
|
|||
|
||||
string SrsConfig::get_vhost_http_remux_mount(string vhost)
|
||||
{
|
||||
SRS_OVERWRITE_BY_ENV_STRING("srs.http_remux.mount"); // SRS_HTTP_REMUX_MOUNT
|
||||
SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.http_remux.mount"); // SRS_VHOST_HTTP_REMUX_MOUNT
|
||||
|
||||
static string DEFAULT = "[vhost]/[app]/[stream].flv";
|
||||
|
||||
|
|
|
@ -1065,6 +1065,11 @@ srs_error_t SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandle
|
|||
}
|
||||
srs_assert(s != NULL);
|
||||
|
||||
bool enabled_cache = _srs_config->get_gop_cache(r->vhost);
|
||||
int gcmf = _srs_config->get_gop_cache_max_frames(r->vhost);
|
||||
s->set_cache(enabled_cache);
|
||||
s->set_gop_cache_max_frames(gcmf);
|
||||
|
||||
// create http streaming handler.
|
||||
if ((err = http_mount(s, r)) != srs_success) {
|
||||
return srs_error_wrap(err, "http mount");
|
||||
|
|
|
@ -661,7 +661,7 @@ srs_error_t SrsGopCache::cache(SrsSharedPtrMessage* shared_msg)
|
|||
gop_cache.push_back(msg->copy());
|
||||
|
||||
// Clear gop cache if exceed the max frames.
|
||||
if (gop_cache.size() > (size_t)gop_cache_max_frames_) {
|
||||
if (gop_cache_max_frames_ > 0 && gop_cache.size() > (size_t)gop_cache_max_frames_) {
|
||||
srs_warn("Gop cache exceed max frames=%d, total=%d, videos=%d, aalvc=%d",
|
||||
gop_cache_max_frames_, (int)gop_cache.size(), cached_video_count, audio_after_last_video_count);
|
||||
clear();
|
||||
|
|
|
@ -367,6 +367,13 @@ srs_error_t SrsMpegtsSrtConn::acquire_publish()
|
|||
return srs_error_wrap(err, "create source");
|
||||
}
|
||||
|
||||
srs_assert(live_source != NULL);
|
||||
|
||||
bool enabled_cache = _srs_config->get_gop_cache(req_->vhost);
|
||||
int gcmf = _srs_config->get_gop_cache_max_frames(req_->vhost);
|
||||
live_source->set_cache(enabled_cache);
|
||||
live_source->set_gop_cache_max_frames(gcmf);
|
||||
|
||||
SrsRtmpFromSrtBridge *bridger = new SrsRtmpFromSrtBridge(live_source);
|
||||
if ((err = bridger->initialize(req_)) != srs_success) {
|
||||
srs_freep(bridger);
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 98
|
||||
#define VERSION_REVISION 100
|
||||
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -41,5 +41,27 @@ protected:
|
|||
virtual srs_error_t build_buffer(std::string src, srs_internal::SrsConfigBuffer** pbuffer);
|
||||
};
|
||||
|
||||
class ISrsSetEnvConfig
|
||||
{
|
||||
private:
|
||||
std::string key;
|
||||
public:
|
||||
ISrsSetEnvConfig(const std::string& k, const std::string& v, bool overwrite) {
|
||||
key = k;
|
||||
srs_setenv(k, v, overwrite);
|
||||
}
|
||||
virtual ~ISrsSetEnvConfig() {
|
||||
srs_unsetenv(key);
|
||||
}
|
||||
private:
|
||||
// Adds, changes environment variables, which may starts with $.
|
||||
int srs_setenv(const std::string& key, const std::string& value, bool overwrite);
|
||||
// Deletes environment variables, which may starts with $.
|
||||
int srs_unsetenv(const std::string& key);
|
||||
};
|
||||
|
||||
#define SrsSetEnvConfig(instance, key, value) \
|
||||
ISrsSetEnvConfig _SRS_free_##instance(key, value, true)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue