From 8f91a90f285642aa20492803fab5050f87d0ca38 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 8 Jul 2021 14:37:18 +0800 Subject: [PATCH 1/3] Squash: Fix padding packets for RTMP2RTC --- CHANGELOG.md | 1 + README.md | 2 +- trunk/research/players/js/srs.sdk.js | 8 ++++---- trunk/src/app/srs_app_rtc_api.cpp | 10 ++++++++-- trunk/src/app/srs_app_rtc_sdp.cpp | 3 +++ trunk/src/core/srs_core_version4.hpp | 2 +- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e17d854ba..fbeba27cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2021-07-08, For [#2403](https://github.com/ossrs/srs/issues/2403), fix padding packets for RTMP2RTC. 4.0.140 * v4.0, 2021-07-04, For [#2424](https://github.com/ossrs/srs/issues/2424), use srandom/random to generate. 4.0.139 * v4.0, 2021-07-01, Merge [#2452](https://github.com/ossrs/srs/pull/2452), fix FFmpeg bug by updating channel_layout. 4.0.138 * v4.0, 2021-06-30, Merge [#2440](https://github.com/ossrs/srs/pull/2440), fix [#2390](https://github.com/ossrs/srs/issues/2390), SRT bug for zerolatency. 4.0.137 diff --git a/README.md b/README.md index f1d593a7b..18234e7f4 100755 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ please set the CANDIDATE ([CN][v4_CN_WebRTC#config-candidate],[EN][v4_EN_WebRTC# ```bash docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 \ --env CANDIDATE=$(ifconfig en0 inet| grep 'inet '|awk '{print $2}') -p 8000:8000/udp \ - ossrs/srs:v4.0.117 ./objs/srs -c conf/srs.conf + ossrs/srs:v4.0.139 ./objs/srs -c conf/srs.conf ``` diff --git a/trunk/research/players/js/srs.sdk.js b/trunk/research/players/js/srs.sdk.js index 5151aebb4..1bfff4d1e 100644 --- a/trunk/research/players/js/srs.sdk.js +++ b/trunk/research/players/js/srs.sdk.js @@ -33,8 +33,8 @@ function SrsRtcPublisherAsync() { // webrtc://r.ossrs.net:11985/live/mystream // or set the api server to myapi.domain.com: // webrtc://myapi.domain.com/live/livestream - // or set the candidate(ip) of answer: - // webrtc://r.ossrs.net/live/livestream?eip=39.107.238.185 + // or set the candidate(eip) of answer: + // webrtc://r.ossrs.net/live/livestream?candidate=39.107.238.185 // or force to access https API: // webrtc://r.ossrs.net/live/livestream?schema=https // or use plaintext, without SRTP: @@ -272,8 +272,8 @@ function SrsRtcPlayerAsync() { // webrtc://r.ossrs.net:11985/live/mystream // or set the api server to myapi.domain.com: // webrtc://myapi.domain.com/live/livestream - // or set the candidate(ip) of answer: - // webrtc://r.ossrs.net/live/livestream?eip=39.107.238.185 + // or set the candidate(eip) of answer: + // webrtc://r.ossrs.net/live/livestream?candidate=39.107.238.185 // or force to access https API: // webrtc://r.ossrs.net/live/livestream?schema=https // or use plaintext, without SRTP: diff --git a/trunk/src/app/srs_app_rtc_api.cpp b/trunk/src/app/srs_app_rtc_api.cpp index 16d6a7b4f..6cba0888c 100644 --- a/trunk/src/app/srs_app_rtc_api.cpp +++ b/trunk/src/app/srs_app_rtc_api.cpp @@ -118,8 +118,11 @@ srs_error_t SrsGoApiRtcPlay::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMe srs_discovery_tc_url(tcUrl, schema, host, vhost, app, stream_name, port, param); } - // For client to specifies the EIP of server. + // For client to specifies the candidate(EIP) of server. string eip = r->query_get("eip"); + if (eip.empty()) { + eip = r->query_get("candidate"); + } string codec = r->query_get("codec"); // For client to specifies whether encrypt by SRTP. string srtp = r->query_get("encrypt"); @@ -338,8 +341,11 @@ srs_error_t SrsGoApiRtcPublish::do_serve_http(ISrsHttpResponseWriter* w, ISrsHtt srs_discovery_tc_url(tcUrl, schema, host, vhost, app, stream_name, port, param); } - // For client to specifies the EIP of server. + // For client to specifies the candidate(EIP) of server. string eip = r->query_get("eip"); + if (eip.empty()) { + eip = r->query_get("candidate"); + } string codec = r->query_get("codec"); srs_trace("RTC publish %s, api=%s, tid=%s, clientip=%s, app=%s, stream=%s, offer=%dB, eip=%s, codec=%s", diff --git a/trunk/src/app/srs_app_rtc_sdp.cpp b/trunk/src/app/srs_app_rtc_sdp.cpp index 15af0699e..d671bbaa1 100644 --- a/trunk/src/app/srs_app_rtc_sdp.cpp +++ b/trunk/src/app/srs_app_rtc_sdp.cpp @@ -747,6 +747,9 @@ srs_error_t SrsSdp::parse(const std::string& sdp_str) line.erase(line.size()-1, 1); } + // Strip the space of line, for pion WebRTC client. + line = srs_string_trim_end(line, " "); + if ((err = parse_line(line)) != srs_success) { return srs_error_wrap(err, "parse sdp line failed"); } diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index dfb188e12..46bfd26be 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 139 +#define VERSION_REVISION 140 #endif From dca0397c47a9a61e83e7737e92d51a2e473b1cac Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 9 Jul 2021 08:13:36 +0800 Subject: [PATCH 2/3] Update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18234e7f4..14709ce44 100755 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ Other important wiki: ## AUTHORS -The [TOC(Technical Oversight Committee)](trunk/AUTHORS.md#toc): +The [TOC(Technical Oversight Committee)](trunk/AUTHORS.md#toc) and [contributors](trunk/AUTHORS.md#contributors): * [Winlin](https://github.com/winlinvip): All areas of streaming server and documents. * [Wenjie](https://github.com/wenjiegit): The focus of his work is on the [HDS](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_DeliveryHDS) module. @@ -91,7 +91,7 @@ The [TOC(Technical Oversight Committee)](trunk/AUTHORS.md#toc): * [Mozhan](https://github.com/lipeng19811218): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. * [Jinxue](https://github.com/chen-guanghua): Focus on [WebRTC](https://github.com/simple-rtmp-server/srs/wiki/v4_CN_WebRTC) module. -A big `THANK YOU` goes to: +A big `THANK YOU` also goes to: * All [contributors](trunk/AUTHORS.md#contributors) of SRS. * All friends of SRS for [big supports](https://github.com/ossrs/srs/wiki/Product). From 12ba584ea33673600040e0208925ad43b7cfb57a Mon Sep 17 00:00:00 2001 From: winlin Date: Fri, 9 Jul 2021 09:00:35 +0800 Subject: [PATCH 3/3] Fix build failed --- trunk/auto/auto_headers.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index 5b8fab853..d1d650b42 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -182,11 +182,10 @@ echo "" >> $SRS_AUTO_HEADERS_H ##################################################################################### # generated the contributors from AUTHORS.txt ##################################################################################### -if [[ -f AUTHORS.txt ]]; then - RTMP_SIG_SRS_AUTHORS=`cat AUTHORS.txt|grep "^-"|awk -F '`' '{print $2}'` +if [[ -f AUTHORS.md ]]; then + RTMP_SIG_SRS_AUTHORS=$(cat AUTHORS.md|grep "^-"|awk -F '`' '{print $2}') echo "#define RTMP_SIG_SRS_AUTHORS \"\\" >> $SRS_AUTO_HEADERS_H for CONTRIBUTOR in $RTMP_SIG_SRS_AUTHORS; do - CONTRIBUTOR=`echo $CONTRIBUTOR|sed 's/@users.noreply.github.com>/@github>/g'` echo "${CONTRIBUTOR} \\" >> $SRS_AUTO_HEADERS_H done echo "\"" >> $SRS_AUTO_HEADERS_H