mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Merge
This commit is contained in:
commit
a020e8a3b7
14 changed files with 518 additions and 1143 deletions
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
|
@ -21,6 +21,7 @@ jobs:
|
||||||
# SRS_TAG=v4.0-r8
|
# SRS_TAG=v4.0-r8
|
||||||
# SRS_TAG=v4.0.145
|
# SRS_TAG=v4.0.145
|
||||||
# SRS_VERSION=4.0.145
|
# SRS_VERSION=4.0.145
|
||||||
|
# SRS_VERSION=4.0-r8
|
||||||
# SRS_MAJOR=4
|
# SRS_MAJOR=4
|
||||||
# @see https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
|
# @see https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
|
||||||
- name: Generate varaiables
|
- name: Generate varaiables
|
||||||
|
@ -63,7 +64,7 @@ jobs:
|
||||||
run: docker build --tag srs:test -f trunk/Dockerfile.test .
|
run: docker build --tag srs:test -f trunk/Dockerfile.test .
|
||||||
# For utest
|
# For utest
|
||||||
- name: Run SRS utest
|
- name: Run SRS utest
|
||||||
run: docker run --rm srs:test bash -c 'make && ./objs/srs_utest'
|
run: docker run --rm srs:test bash -c 'make utest && ./objs/srs_utest'
|
||||||
# For regression-test
|
# For regression-test
|
||||||
- name: Run SRS regression-test
|
- name: Run SRS regression-test
|
||||||
run: docker run --rm srs:test bash -c 'make && ./objs/srs -c conf/regression-test.conf && cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
run: docker run --rm srs:test bash -c 'make && ./objs/srs -c conf/regression-test.conf && cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
||||||
|
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -93,7 +93,7 @@ jobs:
|
||||||
run: docker build --tag srs:test -f trunk/Dockerfile.test .
|
run: docker build --tag srs:test -f trunk/Dockerfile.test .
|
||||||
# For utest
|
# For utest
|
||||||
- name: Run SRS utest
|
- name: Run SRS utest
|
||||||
run: docker run --rm srs:test bash -c 'make && ./objs/srs_utest'
|
run: docker run --rm srs:test bash -c 'make utest && ./objs/srs_utest'
|
||||||
# For regression-test
|
# For regression-test
|
||||||
- name: Run SRS regression-test
|
- name: Run SRS regression-test
|
||||||
run: docker run --rm srs:test bash -c 'make && ./objs/srs -c conf/regression-test.conf && cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
run: docker run --rm srs:test bash -c 'make && ./objs/srs -c conf/regression-test.conf && cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'
|
||||||
|
@ -124,7 +124,7 @@ jobs:
|
||||||
SRS_PR=$(echo ${{ github.ref }}| awk -F 'refs/pull/' '{print $2}'| awk -F '/' '{print $1}')
|
SRS_PR=$(echo ${{ github.ref }}| awk -F 'refs/pull/' '{print $2}'| awk -F '/' '{print $1}')
|
||||||
echo "For ref=${{ github.ref }}, sha=${{ github.sha }}, SRS_BRANCH=$SRS_BRANCH, SRS_PR=$SRS_PR, SRS_SHA=$SRS_SHA, SRS_PROJECT=$SRS_PROJECT"
|
echo "For ref=${{ github.ref }}, sha=${{ github.sha }}, SRS_BRANCH=$SRS_BRANCH, SRS_PR=$SRS_PR, SRS_SHA=$SRS_SHA, SRS_PROJECT=$SRS_PROJECT"
|
||||||
docker run --rm --env SRS_BRANCH=$SRS_BRANCH --env SRS_PR=$SRS_PR --env SRS_SHA=$SRS_SHA --env SRS_PROJECT=$SRS_PROJECT \
|
docker run --rm --env SRS_BRANCH=$SRS_BRANCH --env SRS_PR=$SRS_PR --env SRS_SHA=$SRS_SHA --env SRS_PROJECT=$SRS_PROJECT \
|
||||||
srs:cov bash -c 'make && ./objs/srs_utest && bash auto/codecov.sh'
|
srs:cov bash -c 'make utest && ./objs/srs_utest && bash auto/codecov.sh'
|
||||||
|
|
||||||
done:
|
done:
|
||||||
name: actions-test-done
|
name: actions-test-done
|
||||||
|
|
10
README.md
10
README.md
|
@ -8,6 +8,11 @@
|
||||||
[](../../wikis/Contact#wechat)
|
[](../../wikis/Contact#wechat)
|
||||||
[](https://github.com/ossrs/srs/issues/2716)
|
[](https://github.com/ossrs/srs/issues/2716)
|
||||||
[](http://mulanos.cn)
|
[](http://mulanos.cn)
|
||||||
|
[](https://alternativeto.net/software/srs/about/)
|
||||||
|
[](https://www.facebook.com/winlinvip)
|
||||||
|
[](https://twitter.com/winlinvip)
|
||||||
|
[](https://www.youtube.com/channel/UCP6ZblCL_fIJoEyUzZxC1ng)
|
||||||
|
[](https://www.twitch.tv/winlinvip)
|
||||||
|
|
||||||
SRS/5.0 是一个简单高效的实时视频服务器,支持RTMP/WebRTC/HLS/HTTP-FLV/SRT。
|
SRS/5.0 是一个简单高效的实时视频服务器,支持RTMP/WebRTC/HLS/HTTP-FLV/SRT。
|
||||||
|
|
||||||
|
@ -15,6 +20,10 @@ SRS/5.0 is a simple, high efficiency and realtime video server, supports RTMP/We
|
||||||
|
|
||||||
SRS is licenced under [MIT](https://github.com/ossrs/srs/blob/develop/LICENSE), but some depended libraries are distributed using their [own licenses](https://github.com/ossrs/srs/wiki/LicenseMixing).
|
SRS is licenced under [MIT](https://github.com/ossrs/srs/blob/develop/LICENSE), but some depended libraries are distributed using their [own licenses](https://github.com/ossrs/srs/wiki/LicenseMixing).
|
||||||
|
|
||||||
|
[](https://gitee.com/winlinvip/srs-wiki/raw/master/images/SRS-Overview-4.0.png)
|
||||||
|
|
||||||
|
> Note: Please see https://www.processon.com/view/link/619f29791efad425fd699fd2
|
||||||
|
|
||||||
<a name="product"></a>
|
<a name="product"></a>
|
||||||
<a name="usage-docker"></a>
|
<a name="usage-docker"></a>
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -93,6 +102,7 @@ A big `THANK YOU` also goes to:
|
||||||
|
|
||||||
## Releases
|
## Releases
|
||||||
|
|
||||||
|
* 2021-12-01, Release [v4.0-b0][https://github.com/ossrs/srs/releases/tag/v4.0-b0], v4.0-b0, 4.0 beta0, v4.0.201, 144022 lines.
|
||||||
* 2021-11-15, Release [v4.0.198](https://github.com/ossrs/srs/releases/tag/v4.0.198), 4.0 dev8, v4.0.198, 144010 lines.
|
* 2021-11-15, Release [v4.0.198](https://github.com/ossrs/srs/releases/tag/v4.0.198), 4.0 dev8, v4.0.198, 144010 lines.
|
||||||
* 2021-11-02, Release [v4.0.191](https://github.com/ossrs/srs/releases/tag/v4.0.191), 4.0 dev7, v4.0.191, 143890 lines.
|
* 2021-11-02, Release [v4.0.191](https://github.com/ossrs/srs/releases/tag/v4.0.191), 4.0 dev7, v4.0.191, 143890 lines.
|
||||||
* 2021-10-12, Release [v4.0.177](https://github.com/ossrs/srs/releases/tag/v4.0.177), 4.0 dev6, v4.0.177, 143686 lines.
|
* 2021-10-12, Release [v4.0.177](https://github.com/ossrs/srs/releases/tag/v4.0.177), 4.0 dev6, v4.0.177, 143686 lines.
|
||||||
|
|
|
@ -12,5 +12,5 @@ ENV SRS_AUTO_PACKAGER ossrs
|
||||||
# Build and install SRS.
|
# Build and install SRS.
|
||||||
ADD srs-server-${version}.tar.gz /srs
|
ADD srs-server-${version}.tar.gz /srs
|
||||||
WORKDIR /srs/srs-server-${version}/trunk
|
WORKDIR /srs/srs-server-${version}/trunk
|
||||||
RUN ./scripts/package.sh --x86-x64 --jobs=2
|
RUN ./scripts/package.sh --x86-x64 --jobs=2 --tag=${version}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ RUN yum install -y gcc make gcc-c++ patch unzip perl git
|
||||||
# Build and install SRS.
|
# Build and install SRS.
|
||||||
COPY . /srs
|
COPY . /srs
|
||||||
WORKDIR /srs/trunk
|
WORKDIR /srs/trunk
|
||||||
RUN ./configure --srt=on --utest=on --jobs=2 && make -j2
|
RUN ./configure --srt=on --utest=on --jobs=2 && make -j2 utest
|
||||||
RUN cd 3rdparty/srs-bench && make
|
RUN cd 3rdparty/srs-bench && make
|
||||||
|
|
||||||
# Run utest
|
# Run utest
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# In .circleci/config.yml, generate *.gcno with
|
# In .circleci/config.yml, generate *.gcno with
|
||||||
# ./configure --gcov --without-research --without-librtmp && make
|
# ./configure --gcov --without-research --without-librtmp && make utest
|
||||||
# and generate *.gcda by
|
# and generate *.gcda by
|
||||||
# ./objs/srs_utest
|
# ./objs/srs_utest
|
||||||
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
MODULES=""
|
|
||||||
if [[ $# -gt 0 ]]; then
|
|
||||||
for module in $@; do
|
|
||||||
module=$(basename $module)
|
|
||||||
if [[ $module == "src" ]]; then
|
|
||||||
MODULES="objs/src"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
MODULES="$MODULES objs/src/$module"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $MODULES == "" ]]; then
|
|
||||||
MODULES="objs/src"
|
|
||||||
fi
|
|
||||||
|
|
||||||
IS_LINUX=yes
|
|
||||||
uname -s|grep Darwin >/dev/null && IS_DARWIN=yes && IS_LINUX=no
|
|
||||||
echo "IS_LINUX: $IS_LINUX, IS_DARWIN: $IS_DARWIN"
|
|
||||||
|
|
||||||
echo "Clean gcda files"
|
|
||||||
find objs -name *.gcda |xargs rm -f
|
|
||||||
|
|
||||||
echo "Build and run utest"
|
|
||||||
make -j10 && ./objs/srs_utest
|
|
||||||
|
|
||||||
echo "Generating coverage at $MODULES"
|
|
||||||
mkdir -p ./objs/coverage &&
|
|
||||||
gcovr -r src --html --html-details -o ./objs/coverage/srs.html $MODULES &&
|
|
||||||
echo "Coverage report at ./objs/coverage/srs.html" &&
|
|
||||||
open ./objs/coverage/srs.html
|
|
32
trunk/conf/realtime.flv.conf
Normal file
32
trunk/conf/realtime.flv.conf
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
# the config for srs to delivery realtime RTMP stream
|
||||||
|
# @see https://github.com/ossrs/srs/wiki/v2_CN_SampleRealtime
|
||||||
|
# @see full.conf for detail config.
|
||||||
|
|
||||||
|
listen 1935;
|
||||||
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
|
http_server {
|
||||||
|
enabled on;
|
||||||
|
listen 8080;
|
||||||
|
dir ./objs/nginx/html;
|
||||||
|
}
|
||||||
|
vhost __defaultVhost__ {
|
||||||
|
http_remux {
|
||||||
|
enabled on;
|
||||||
|
mount [vhost]/[app]/[stream].flv;
|
||||||
|
}
|
||||||
|
|
||||||
|
tcp_nodelay on
|
||||||
|
min_latency on;
|
||||||
|
|
||||||
|
play {
|
||||||
|
gop_cache off;
|
||||||
|
queue_length 10;
|
||||||
|
mw_latency 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
publish {
|
||||||
|
mr off;
|
||||||
|
}
|
||||||
|
}
|
7
trunk/configure
vendored
7
trunk/configure
vendored
|
@ -447,7 +447,7 @@ mv ${SRS_WORKDIR}/${SRS_MAKEFILE} ${SRS_WORKDIR}/${SRS_MAKEFILE}.bk
|
||||||
|
|
||||||
# generate phony header
|
# generate phony header
|
||||||
cat << END > ${SRS_WORKDIR}/${SRS_MAKEFILE}
|
cat << END > ${SRS_WORKDIR}/${SRS_MAKEFILE}
|
||||||
.PHONY: default _default install help clean destroy server srs_ingest_hls utest _prepare_dir $__mphonys
|
.PHONY: default all _default install help clean destroy server srs_ingest_hls utest _prepare_dir $__mphonys
|
||||||
.PHONY: clean_srs clean_modules clean_openssl clean_srtp2 clean_opus clean_ffmpeg clean_st
|
.PHONY: clean_srs clean_modules clean_openssl clean_srtp2 clean_opus clean_ffmpeg clean_st
|
||||||
.PHONY: st ffmpeg
|
.PHONY: st ffmpeg
|
||||||
|
|
||||||
|
@ -462,8 +462,9 @@ CXXFLAGS = ${CXXFLAGS}
|
||||||
SRS_PREFIX=${SRS_PREFIX}
|
SRS_PREFIX=${SRS_PREFIX}
|
||||||
__REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX)
|
__REAL_INSTALL=\$(DESTDIR)\$(SRS_PREFIX)
|
||||||
|
|
||||||
default:
|
default: server
|
||||||
\$(MAKE) _default
|
|
||||||
|
all: _default
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -47,6 +47,9 @@ function SrsRtcPublisherAsync() {
|
||||||
self.pc.addTransceiver("audio", {direction: "sendonly"});
|
self.pc.addTransceiver("audio", {direction: "sendonly"});
|
||||||
self.pc.addTransceiver("video", {direction: "sendonly"});
|
self.pc.addTransceiver("video", {direction: "sendonly"});
|
||||||
|
|
||||||
|
if (!navigator.mediaDevices && window.location.protocol === 'http:' && window.location.hostname !== 'localhost') {
|
||||||
|
throw new Error(`Please use HTTPS or localhost to publish, read https://github.com/ossrs/srs/issues/2762#issuecomment-983147576`);
|
||||||
|
}
|
||||||
var stream = await navigator.mediaDevices.getUserMedia(self.constraints);
|
var stream = await navigator.mediaDevices.getUserMedia(self.constraints);
|
||||||
|
|
||||||
// @see https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addStream#Migrating_to_addTrack
|
// @see https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/addStream#Migrating_to_addTrack
|
||||||
|
|
|
@ -17,6 +17,8 @@ MIPS=NO
|
||||||
#
|
#
|
||||||
EMBEDED=NO
|
EMBEDED=NO
|
||||||
JOBS=1
|
JOBS=1
|
||||||
|
#
|
||||||
|
SRS_TAG=
|
||||||
|
|
||||||
##################################################################################
|
##################################################################################
|
||||||
##################################################################################
|
##################################################################################
|
||||||
|
@ -27,12 +29,13 @@ do
|
||||||
case "$option" in
|
case "$option" in
|
||||||
-*=*)
|
-*=*)
|
||||||
value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`
|
value=`echo "$option" | sed -e 's|[-_a-zA-Z0-9/]*=||'`
|
||||||
option=`echo "$option" | sed -e 's|=[-_a-zA-Z0-9/~]*||'`
|
option=`echo "$option" | awk -F '=' '{print $1}'`
|
||||||
;;
|
;;
|
||||||
*) value="" ;;
|
*) value="" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$option" in
|
case "$option" in
|
||||||
|
-h) help=yes ;;
|
||||||
--help) help=yes ;;
|
--help) help=yes ;;
|
||||||
|
|
||||||
--x86-x64) X86_X64=YES ;;
|
--x86-x64) X86_X64=YES ;;
|
||||||
|
@ -41,6 +44,7 @@ do
|
||||||
--arm) ARM=YES ;;
|
--arm) ARM=YES ;;
|
||||||
--pi) PI=YES ;;
|
--pi) PI=YES ;;
|
||||||
--jobs) JOBS=$value ;;
|
--jobs) JOBS=$value ;;
|
||||||
|
--tag) SRS_TAG=$value ;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "$0: error: invalid option \"$option\", @see $0 --help"
|
echo "$0: error: invalid option \"$option\", @see $0 --help"
|
||||||
|
@ -51,14 +55,15 @@ done
|
||||||
if [ $help = yes ]; then
|
if [ $help = yes ]; then
|
||||||
cat << END
|
cat << END
|
||||||
|
|
||||||
--help print this message
|
--help Print this message
|
||||||
|
|
||||||
--x86-x64 for x86-x64 platform, configure/make/package.
|
--x86-x64 For x86-x64 platform, configure/make/package.
|
||||||
--arm for arm cross-build platform, configure/make/package.
|
--x86-64 Alias for --x86-x64.
|
||||||
--mips for mips cross-build platform, configure/make/package.
|
--arm For arm cross-build platform, configure/make/package.
|
||||||
--pi for pi platform, configure/make/package.
|
--mips For mips cross-build platform, configure/make/package.
|
||||||
--x86-64 alias for --x86-x64.
|
--pi For pi platform, configure/make/package.
|
||||||
--jobs Set the configure and make jobs.
|
--jobs Set the configure and make jobs.
|
||||||
|
--tag Set the version in zip file.
|
||||||
END
|
END
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -116,7 +121,7 @@ ok_msg "real os is ${os_name}-${os_major_version} ${os_release} ${os_machine}"
|
||||||
|
|
||||||
# build srs
|
# build srs
|
||||||
# @see https://github.com/ossrs/srs/wiki/v1_CN_Build
|
# @see https://github.com/ossrs/srs/wiki/v1_CN_Build
|
||||||
ok_msg "start build srs, ARM: $ARM, MIPS: $MIPS, PI: $PI, X86_64: $X86_X64, JOBS: $JOBS"
|
ok_msg "start build srs, ARM: $ARM, MIPS: $MIPS, PI: $PI, X86_64: $X86_X64, JOBS: $JOBS, TAG: $SRS_TAG"
|
||||||
if [ $ARM = YES ]; then
|
if [ $ARM = YES ]; then
|
||||||
(
|
(
|
||||||
cd $work_dir &&
|
cd $work_dir &&
|
||||||
|
@ -174,15 +179,18 @@ fi
|
||||||
ok_msg "machine: $os_machine"
|
ok_msg "machine: $os_machine"
|
||||||
|
|
||||||
# generate zip dir and zip filename
|
# generate zip dir and zip filename
|
||||||
if [ $EMBEDED = YES ]; then
|
srs_version=$SRS_TAG
|
||||||
srs_version_major=`cat $work_dir/src/core/srs_core.hpp| grep '#define VERSION_MAJOR'| awk '{print $3}'|xargs echo` &&
|
if [[ $srs_version == '' ]]; then
|
||||||
srs_version_minor=`cat $work_dir/src/core/srs_core.hpp| grep '#define VERSION_MINOR'| awk '{print $3}'|xargs echo` &&
|
if [ $EMBEDED = YES ]; then
|
||||||
srs_version_revision=`cat $work_dir/src/core/srs_core.hpp| grep '#define VERSION_REVISION'| awk '{print $3}'|xargs echo` &&
|
srs_version_major=`cat $work_dir/src/core/srs_core.hpp| grep '#define VERSION_MAJOR'| awk '{print $3}'|xargs echo` &&
|
||||||
srs_version=$srs_version_major.$srs_version_minor.$srs_version_revision
|
srs_version_minor=`cat $work_dir/src/core/srs_core.hpp| grep '#define VERSION_MINOR'| awk '{print $3}'|xargs echo` &&
|
||||||
else
|
srs_version_revision=`cat $work_dir/src/core/srs_core.hpp| grep '#define VERSION_REVISION'| awk '{print $3}'|xargs echo` &&
|
||||||
srs_version=`${build_objs}/srs -v 2>/dev/stdout 1>/dev/null`
|
srs_version=$srs_version_major.$srs_version_minor.$srs_version_revision
|
||||||
|
else
|
||||||
|
srs_version=`${build_objs}/srs -v 2>/dev/stdout 1>/dev/null`
|
||||||
|
fi
|
||||||
|
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "get srs version failed"; exit $ret; fi
|
||||||
fi
|
fi
|
||||||
ret=$?; if [[ 0 -ne ${ret} ]]; then failed_msg "get srs version failed"; exit $ret; fi
|
|
||||||
ok_msg "get srs version $srs_version"
|
ok_msg "get srs version $srs_version"
|
||||||
|
|
||||||
zip_dir="SRS-${os_name}${os_major_version}-${os_machine}-${srs_version}"
|
zip_dir="SRS-${os_name}${os_major_version}-${os_machine}-${srs_version}"
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
echo "Usage: $0 [-jN]"
|
|
||||||
echo " -jN The make jobs, for example, -j8 to use 8cpu to make"
|
|
||||||
|
|
||||||
params="$@"
|
|
||||||
echo "params is: $params"
|
|
||||||
|
|
||||||
bash scripts/test_configure.sh $params && ./objs/srs_utest
|
|
||||||
ret=$?; if [[ 0 -ne $ret ]]; then echo "configure test and utest failed."; exit $ret; fi
|
|
||||||
echo "configure test and utest success";
|
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 198
|
#define VERSION_REVISION 201
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue