1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

Merge branch 'develop' into merge/develop

This commit is contained in:
winlin 2021-10-07 21:07:04 +08:00
commit 19bab40117
6 changed files with 71 additions and 33 deletions

View file

@ -90,7 +90,8 @@ _st_stack_t *_st_stack_new(int stack_size)
ts->stk_bottom = ts->vaddr + REDZONE; ts->stk_bottom = ts->vaddr + REDZONE;
ts->stk_top = ts->stk_bottom + stack_size; ts->stk_top = ts->stk_bottom + stack_size;
#ifdef DEBUG /* For example, in OpenWRT, the memory at the begin minus 16B by mprotect is read-only. */
#if defined(DEBUG) && !defined(MD_NO_PROTECT)
mprotect(ts->vaddr, REDZONE, PROT_NONE); mprotect(ts->vaddr, REDZONE, PROT_NONE);
mprotect(ts->stk_top + extra, REDZONE, PROT_NONE); mprotect(ts->stk_top + extra, REDZONE, PROT_NONE);
#endif #endif

View file

@ -598,36 +598,38 @@ fi
##################################################################################### #####################################################################################
# srtp # srtp
##################################################################################### #####################################################################################
SRTP_OPTIONS="" if [[ $SRS_RTC == YES ]]; then
# If use ASM for SRTP, we enable openssl(with ASM). SRTP_OPTIONS=""
if [[ $SRS_SRTP_ASM == YES ]]; then # If use ASM for SRTP, we enable openssl(with ASM).
SRTP_OPTIONS="--enable-openssl" if [[ $SRS_SRTP_ASM == YES ]]; then
SRTP_CONFIGURE="env PKG_CONFIG_PATH=$(cd ${SRS_OBJS}/${SRS_PLATFORM} && pwd)/openssl/lib/pkgconfig ./configure" SRTP_OPTIONS="--enable-openssl"
else SRTP_CONFIGURE="env PKG_CONFIG_PATH=$(cd ${SRS_OBJS}/${SRS_PLATFORM} && pwd)/openssl/lib/pkgconfig ./configure"
SRTP_CONFIGURE="./configure" else
SRTP_CONFIGURE="./configure"
fi
if [[ $SRS_CROSS_BUILD == YES ]]; then
SRTP_OPTIONS="$SRTP_OPTIONS --host=$SRS_CROSS_BUILD_HOST"
fi
# Patched ST from https://github.com/ossrs/state-threads/tree/srs
if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit/_release/lib/libsrtp2.a ]]; then
echo "The libsrtp-2-fit is ok.";
else
echo "Building libsrtp-2-fit.";
(
rm -rf ${SRS_OBJS}/srtp2 && cd ${SRS_OBJS}/${SRS_PLATFORM} &&
rm -rf libsrtp-2-fit && cp -R ../../3rdparty/libsrtp-2-fit . && cd libsrtp-2-fit &&
$SRTP_CONFIGURE ${SRTP_OPTIONS} --prefix=`pwd`/_release &&
make ${SRS_JOBS} && make install &&
cd .. && rm -rf srtp2 && ln -sf libsrtp-2-fit/_release srtp2
)
fi
# check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "Build libsrtp-2-fit failed, ret=$ret"; exit $ret; fi
# Always update the links.
(cd ${SRS_OBJS}/${SRS_PLATFORM} && rm -rf srtp2 && ln -sf libsrtp-2-fit/_release srtp2)
(cd ${SRS_OBJS} && rm -rf srtp2 && ln -sf ${SRS_PLATFORM}/libsrtp-2-fit/_release srtp2)
if [ ! -f ${SRS_OBJS}/srtp2/lib/libsrtp2.a ]; then echo "Build libsrtp-2-fit static lib failed."; exit -1; fi
fi fi
if [[ $SRS_CROSS_BUILD == YES ]]; then
SRTP_OPTIONS="$SRTP_OPTIONS --host=$SRS_CROSS_BUILD_HOST"
fi
# Patched ST from https://github.com/ossrs/state-threads/tree/srs
if [[ -f ${SRS_OBJS}/${SRS_PLATFORM}/libsrtp-2-fit/_release/lib/libsrtp2.a ]]; then
echo "The libsrtp-2-fit is ok.";
else
echo "Building libsrtp-2-fit.";
(
rm -rf ${SRS_OBJS}/srtp2 && cd ${SRS_OBJS}/${SRS_PLATFORM} &&
rm -rf libsrtp-2-fit && cp -R ../../3rdparty/libsrtp-2-fit . && cd libsrtp-2-fit &&
$SRTP_CONFIGURE ${SRTP_OPTIONS} --prefix=`pwd`/_release &&
make ${SRS_JOBS} && make install &&
cd .. && rm -rf srtp2 && ln -sf libsrtp-2-fit/_release srtp2
)
fi
# check status
ret=$?; if [[ $ret -ne 0 ]]; then echo "Build libsrtp-2-fit failed, ret=$ret"; exit $ret; fi
# Always update the links.
(cd ${SRS_OBJS}/${SRS_PLATFORM} && rm -rf srtp2 && ln -sf libsrtp-2-fit/_release srtp2)
(cd ${SRS_OBJS} && rm -rf srtp2 && ln -sf ${SRS_PLATFORM}/libsrtp-2-fit/_release srtp2)
if [ ! -f ${SRS_OBJS}/srtp2/lib/libsrtp2.a ]; then echo "Build libsrtp-2-fit static lib failed."; exit -1; fi
##################################################################################### #####################################################################################
# libopus, for WebRTC to transcode AAC with Opus. # libopus, for WebRTC to transcode AAC with Opus.

24
trunk/conf/openwrt.conf Normal file
View file

@ -0,0 +1,24 @@
# no-daemon and write log to console config for srs.
# @see full.conf for detail config.
listen 1935;
max_connections 1000;
daemon off;
srs_log_tank console;
http_api {
enabled on;
listen 1985;
}
http_server {
enabled on;
listen 8080;
}
vhost __defaultVhost__ {
hls {
enabled off;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
}
}

View file

@ -8,7 +8,8 @@ The changelog for SRS.
## SRS 5.0 Changelog ## SRS 5.0 Changelog
* v4.0, 2021-10-03, Actions: Create source tar lik srs-server-5.0.14.tar.gz * v5.0, 2021-10-03, OpenWRT: Disable mprotect of ST. 5.0.16
* v5.0, 2021-10-03, Actions: Create source tar lik srs-server-5.0.14.tar.gz
* v5.0, 2021-10-02, ST: Support Cygwin64 and MIPS. 5.0.13 * v5.0, 2021-10-02, ST: Support Cygwin64 and MIPS. 5.0.13
* v5.0, 2021-09-23, Merge [#2578](https://github.com/ossrs/srs/pull/2578) Support http callback on_play/stop. 5.0.12 * v5.0, 2021-09-23, Merge [#2578](https://github.com/ossrs/srs/pull/2578) Support http callback on_play/stop. 5.0.12
* v5.0, 2021-08-07, Fix [#2508](https://github.com/ossrs/srs/pull/2508), Support features query by API. 5.0.10 * v5.0, 2021-08-07, Fix [#2508](https://github.com/ossrs/srs/pull/2508), Support features query by API. 5.0.10

View file

@ -744,6 +744,8 @@ srs_error_t SrsServer::initialize_signal()
srs_error_t SrsServer::acquire_pid_file() srs_error_t SrsServer::acquire_pid_file()
{ {
srs_error_t err = srs_success;
// when srs in dolphin mode, no need the pid file. // when srs in dolphin mode, no need the pid file.
if (_srs_config->is_dolphin()) { if (_srs_config->is_dolphin()) {
return srs_success; return srs_success;
@ -751,6 +753,14 @@ srs_error_t SrsServer::acquire_pid_file()
std::string pid_file = _srs_config->get_pid_file(); std::string pid_file = _srs_config->get_pid_file();
// Try to create dir for pid file.
string pid_dir = srs_path_dirname(pid_file);
if (!srs_path_exists(pid_dir)) {
if ((err = srs_create_dir_recursively(pid_dir)) != srs_success) {
return srs_error_wrap(err, "create %s", pid_dir.c_str());
}
}
// -rw-r--r-- // -rw-r--r--
// 644 // 644
int mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; int mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 5 #define VERSION_MAJOR 5
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 15 #define VERSION_REVISION 16
#endif #endif