From 3eb046612b0c376920ff4deab0892aecbd1f6c12 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 6 Sep 2022 18:48:46 +0800 Subject: [PATCH] Fix #3170: WebRTC: Support WHIP(WebRTC-HTTP ingestion protocol). v5.0.61 --- trunk/doc/CHANGELOG.md | 1 + trunk/src/app/srs_app_rtc_api.cpp | 21 ++++++--------------- trunk/src/core/srs_core_version5.hpp | 2 +- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 7f5275b258..41b5386040 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -7,6 +7,7 @@ The changelog for SRS. ## SRS 5.0 Changelog +* v5.0, 2022-09-06, Fix [#3170](https://github.com/ossrs/srs/issues/3170): WebRTC: Support WHIP(WebRTC-HTTP ingestion protocol). v5.0.61 * v5.0, 2022-09-04, Fix [#2852](https://github.com/ossrs/srs/issues/2852): WebRTC: WebRTC over TCP directly, not TURN. v5.0.60 * v5.0, 2022-09-01, Fix [#1405](https://github.com/ossrs/srs/issues/1405): Restore the stream when parsing failed. v5.0.59 * v5.0, 2022-09-01, Fix [#1405](https://github.com/ossrs/srs/issues/1405): Support guessing IBMF first. v5.0.58 diff --git a/trunk/src/app/srs_app_rtc_api.cpp b/trunk/src/app/srs_app_rtc_api.cpp index e89f56061e..2b5882212a 100644 --- a/trunk/src/app/srs_app_rtc_api.cpp +++ b/trunk/src/app/srs_app_rtc_api.cpp @@ -164,14 +164,6 @@ srs_error_t SrsGoApiRtcPlay::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMe return srs_error_wrap(err, "parse sdp failed: %s", remote_sdp_str.c_str()); } - if ((err = check_remote_sdp(ruc.remote_sdp_)) != srs_success) { - return srs_error_wrap(err, "remote sdp check failed"); - } - - if ((err = http_hooks_on_play(ruc.req_)) != srs_success) { - return srs_error_wrap(err, "RTC: http_hooks_on_play"); - } - if ((err = serve_http(w, r, &ruc)) != srs_success) { return srs_error_wrap(err, "serve"); } @@ -190,6 +182,10 @@ srs_error_t SrsGoApiRtcPlay::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa { srs_error_t err = srs_success; + if ((err = check_remote_sdp(ruc->remote_sdp_)) != srs_success) { + return srs_error_wrap(err, "remote sdp check failed"); + } + SrsSdp local_sdp; // Config for SDP and session. @@ -230,7 +226,7 @@ srs_error_t SrsGoApiRtcPlay::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessa } // We must do hook after stat, because depends on it. - if ((err = http_hooks_on_play(ruc.req_)) != srs_success) { + if ((err = http_hooks_on_play(ruc->req_)) != srs_success) { return srs_error_wrap(err, "RTC: http_hooks_on_play"); } @@ -325,7 +321,6 @@ SrsGoApiRtcPublish::~SrsGoApiRtcPublish() { } - // Request: // POST /rtc/v1/publish/ // { @@ -472,10 +467,6 @@ srs_error_t SrsGoApiRtcPublish::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMe return srs_error_wrap(err, "remote sdp check failed"); } - if ((err = http_hooks_on_publish(ruc->req_)) != srs_success) { - return srs_error_wrap(err, "RTC: http_hooks_on_publish"); - } - SrsSdp local_sdp; // TODO: FIXME: move to create_session. @@ -502,7 +493,7 @@ srs_error_t SrsGoApiRtcPublish::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMe } // We must do hook after stat, because depends on it. - if ((err = http_hooks_on_publish(ruc.req_)) != srs_success) { + if ((err = http_hooks_on_publish(ruc->req_)) != srs_success) { return srs_error_wrap(err, "RTC: http_hooks_on_publish"); } diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index 2dfa82d4fd..25079460df 100644 --- a/trunk/src/core/srs_core_version5.hpp +++ b/trunk/src/core/srs_core_version5.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 0 -#define VERSION_REVISION 60 +#define VERSION_REVISION 61 #endif