From 75530efbc4fe2a143c7ee02397a2035609d9c07b Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 30 Jun 2021 07:32:28 +0800 Subject: [PATCH] Squash: Merge #2448, #2440 --- CHANGELOG.md | 1 + README.md | 36 ++++++++++++++++-------- trunk/src/app/srs_app_latest_version.cpp | 7 +---- trunk/src/app/srs_app_rtmp_conn.cpp | 12 ++++---- trunk/src/core/srs_core_version4.hpp | 2 +- 5 files changed, 34 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 733131a7e..c7db753a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* 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 * v4.0, 2021-06-28, Merge [#2435](https://github.com/ossrs/srs/pull/2435), fix bug for HTTP-RAW-API to check vhost. 4.0.136 * v4.0, 2021-06-28, Fix [#2431](https://github.com/ossrs/srs/issues/2431), configure FFmpeg bug. 4.0.135 * v4.0, 2021-06-28, Merge [#2444](https://github.com/ossrs/srs/pull/2444), add libavcodec/crystalhd.c for FFmpeg. 4.0.134 diff --git a/README.md b/README.md index 953ebdef2..71c18e9e9 100755 --- a/README.md +++ b/README.md @@ -106,26 +106,40 @@ A big THANK YOU goes to: The ports used by SRS, kernel services: -* tcp://1935, for RTMP live streaming server([CN][v4_CN_DeliveryRTMP],[EN][v4_EN_DeliveryRTMP]). -* tcp://1985, HTTP API server, for HTTP-API([CN][v4_CN_HTTPApi], [EN][v4_EN_HTTPApi]), WebRTC([CN][v4_CN_WebRTC], [EN][v4_EN_WebRTC]), etc. -* tcp://8080, HTTP live streaming server, HTTP-FLV([CN][v4_CN_SampleHttpFlv], [EN][v4_EN_SampleHttpFlv]), HLS([CN][v4_CN_SampleHLS], [EN][v4_EN_SampleHLS]) as such. -* udp://8000, WebRTC Media([CN][v4_CN_WebRTC], [EN][v4_EN_WebRTC]) server. +* `tcp://1935`, for RTMP live streaming server([CN][v4_CN_DeliveryRTMP],[EN][v4_EN_DeliveryRTMP]). +* `tcp://1985`, HTTP API server, for HTTP-API([CN][v4_CN_HTTPApi], [EN][v4_EN_HTTPApi]), WebRTC([CN][v4_CN_WebRTC], [EN][v4_EN_WebRTC]), etc. +* `tcp://8080`, HTTP live streaming server, HTTP-FLV([CN][v4_CN_SampleHttpFlv], [EN][v4_EN_SampleHttpFlv]), HLS([CN][v4_CN_SampleHLS], [EN][v4_EN_SampleHLS]) as such. +* `udp://8000`, WebRTC Media([CN][v4_CN_WebRTC], [EN][v4_EN_WebRTC]) server. For optional HTTPS services, which might be provided by other web servers: -* tcp://8088, HTTPS live streaming server. -* tcp://1990, HTTPS API server. +* `tcp://8088`, HTTPS live streaming server. +* `tcp://1990`, HTTPS API server. For optional stream caster services, to push streams to SRS: -* udp://8935, Stream Caster: [Push MPEGTS over UDP](https://github.com/ossrs/srs/wiki/v4_CN_Streamer#push-mpeg-ts-over-udp) server. -* tcp://554, Stream Caster: [Push RTSP](https://github.com/ossrs/srs/wiki/v4_CN_Streamer#push-rtsp-to-srs) server. -* tcp://8936, Stream Caster: [Push HTTP-FLV](https://github.com/ossrs/srs/wiki/v4_CN_Streamer#push-http-flv-to-srs) server. -* udp://10080, Stream Caster: [Push SRT Media](https://github.com/ossrs/srs/issues/1147#issuecomment-577469119) server. +* `udp://8935`, Stream Caster: [Push MPEGTS over UDP](https://github.com/ossrs/srs/wiki/v4_CN_Streamer#push-mpeg-ts-over-udp) server. +* `tcp://554`, Stream Caster: [Push RTSP](https://github.com/ossrs/srs/wiki/v4_CN_Streamer#push-rtsp-to-srs) server. +* `tcp://8936`, Stream Caster: [Push HTTP-FLV](https://github.com/ossrs/srs/wiki/v4_CN_Streamer#push-http-flv-to-srs) server. +* `udp://10080`, Stream Caster: [Push SRT Media](https://github.com/ossrs/srs/issues/1147#issuecomment-577469119) server. For external services to work with SRS: -* udp://1989, [WebRTC Signaling](https://github.com/ossrs/signaling#usage) server. +* `udp://1989`, [WebRTC Signaling](https://github.com/ossrs/signaling#usage) server. + +## APIs + +The API used by SRS: + +* `/api/v1/` The HTTP API path. +* `/rtc/v1/` The HTTP API path for RTC. +* `/sig/v1/` The [demo signaling](https://github.com/ossrs/signaling) API. + +Other API used by [ossrs.net](https://ossrs.net): + +* `/gif/v1` The statistic API. +* `/service/v1/` The latest available version API. +* `/ws-service/v1/` The latest available version API, by websocket. ## Features diff --git a/trunk/src/app/srs_app_latest_version.cpp b/trunk/src/app/srs_app_latest_version.cpp index c66b198e9..a3168c1d3 100644 --- a/trunk/src/app/srs_app_latest_version.cpp +++ b/trunk/src/app/srs_app_latest_version.cpp @@ -54,12 +54,7 @@ srs_error_t SrsLatestVersion::start() return srs_success; } - char buf[10]; - srs_random_generate(buf, sizeof(buf)); - for (int i = 0; i < (int)sizeof(buf); i++) { - buf[i] = 'a' + uint8_t(buf[i])%25; - } - server_id_ = string(buf, sizeof(buf)); + server_id_ = srs_random_str(10); return trd_->start(); } diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 78ce829f8..246dcfd62 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -944,6 +944,11 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsLiveSource* source) SrsRequest* req = info->req; + // Check whether RTMP stream is busy. + if (!source->can_publish(info->edge)) { + return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtmp: stream %s is busy", req->get_stream_url().c_str()); + } + // Check whether RTC stream is busy. #ifdef SRS_RTC SrsRtcSource *rtc = NULL; @@ -955,16 +960,11 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsLiveSource* source) } if (!rtc->can_publish()) { - return srs_error_new(ERROR_RTC_SOURCE_BUSY, "rtc stream %s busy", req->get_stream_url().c_str()); + return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtc stream %s busy", req->get_stream_url().c_str()); } } #endif - // Check whether RTMP stream is busy. - if (!source->can_publish(info->edge)) { - return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtmp: stream %s is busy", req->get_stream_url().c_str()); - } - // Bridge to RTC streaming. #if defined(SRS_RTC) && defined(SRS_FFMPEG_FIT) if (rtc) { diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index f9ba8dad6..df8223768 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 136 +#define VERSION_REVISION 137 #endif