From 3a85ae78239e6712686062713c3cbb6f354e884f Mon Sep 17 00:00:00 2001 From: hondaxiao Date: Tue, 17 Jan 2023 15:05:14 +0800 Subject: [PATCH 1/3] RTC: fix rtc publisher pli cid --- trunk/src/app/srs_app_rtc_conn.cpp | 9 ++++----- trunk/src/app/srs_app_rtc_conn.hpp | 2 +- trunk/src/app/srs_app_rtc_source.cpp | 2 +- trunk/src/app/srs_app_rtc_source.hpp | 4 +++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/trunk/src/app/srs_app_rtc_conn.cpp b/trunk/src/app/srs_app_rtc_conn.cpp index 8757067740..b26dfa16a2 100644 --- a/trunk/src/app/srs_app_rtc_conn.cpp +++ b/trunk/src/app/srs_app_rtc_conn.cpp @@ -912,7 +912,7 @@ srs_error_t SrsRtcPlayStream::do_request_keyframe(uint32_t ssrc, SrsContextId ci return err; } - publisher->request_keyframe(ssrc); + publisher->request_keyframe(ssrc, cid); return err; } @@ -1611,15 +1611,14 @@ srs_error_t SrsRtcPublishStream::on_rtcp_xr(SrsRtcpXr* rtcp) return err; } -void SrsRtcPublishStream::request_keyframe(uint32_t ssrc) +void SrsRtcPublishStream::request_keyframe(uint32_t ssrc, SrsContextId cid) { - SrsContextId sub_cid = _srs_context->get_id(); - pli_worker_->request_keyframe(ssrc, sub_cid); + pli_worker_->request_keyframe(ssrc, cid); uint32_t nn = 0; if (pli_epp->can_print(ssrc, &nn)) { // The player(subscriber) cid, which requires PLI. - srs_trace("RTC: Need PLI ssrc=%u, play=[%s], publish=[%s], count=%u/%u", ssrc, sub_cid.c_str(), + srs_trace("RTC: Need PLI ssrc=%u, play=[%s], publish=[%s], count=%u/%u", ssrc, cid.c_str(), cid_.c_str(), nn, pli_epp->nn_count); } } diff --git a/trunk/src/app/srs_app_rtc_conn.hpp b/trunk/src/app/srs_app_rtc_conn.hpp index a2ad43064b..e47ba6f015 100644 --- a/trunk/src/app/srs_app_rtc_conn.hpp +++ b/trunk/src/app/srs_app_rtc_conn.hpp @@ -384,7 +384,7 @@ class SrsRtcPublishStream : public ISrsRtspPacketDecodeHandler srs_error_t on_rtcp_sr(SrsRtcpSR* rtcp); srs_error_t on_rtcp_xr(SrsRtcpXr* rtcp); public: - void request_keyframe(uint32_t ssrc); + void request_keyframe(uint32_t ssrc, SrsContextId cid); virtual srs_error_t do_request_keyframe(uint32_t ssrc, SrsContextId cid); public: void simulate_nack_drop(int nn); diff --git a/trunk/src/app/srs_app_rtc_source.cpp b/trunk/src/app/srs_app_rtc_source.cpp index 3a06f6de69..3b72c73b16 100644 --- a/trunk/src/app/srs_app_rtc_source.cpp +++ b/trunk/src/app/srs_app_rtc_source.cpp @@ -703,7 +703,7 @@ srs_error_t SrsRtcSource::on_timer(srs_utime_t interval) for (int i = 0; i < (int)stream_desc_->video_track_descs_.size(); i++) { SrsRtcTrackDescription* desc = stream_desc_->video_track_descs_.at(i); - publish_stream_->request_keyframe(desc->ssrc_); + publish_stream_->request_keyframe(desc->ssrc_, publish_stream_->context_id()); } return err; diff --git a/trunk/src/app/srs_app_rtc_source.hpp b/trunk/src/app/srs_app_rtc_source.hpp index c1c2e628ca..7f702ff2e2 100644 --- a/trunk/src/app/srs_app_rtc_source.hpp +++ b/trunk/src/app/srs_app_rtc_source.hpp @@ -128,7 +128,9 @@ class ISrsRtcPublishStream virtual ~ISrsRtcPublishStream(); public: // Request keyframe(PLI) from publisher, for fresh consumer. - virtual void request_keyframe(uint32_t ssrc) = 0; + virtual void request_keyframe(uint32_t ssrc, SrsContextId cid) = 0; + // Get context id. + virtual const SrsContextId& context_id() = 0; }; class ISrsRtcSourceEventHandler From 1057ce1e2db60c5dbeff644605453c6c1bf9b97f Mon Sep 17 00:00:00 2001 From: hondaxiao Date: Wed, 18 Jan 2023 10:29:00 +0800 Subject: [PATCH 2/3] RTC: log bridge request keyframe --- trunk/src/app/srs_app_rtc_source.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/trunk/src/app/srs_app_rtc_source.cpp b/trunk/src/app/srs_app_rtc_source.cpp index 3b72c73b16..f18b9518eb 100644 --- a/trunk/src/app/srs_app_rtc_source.cpp +++ b/trunk/src/app/srs_app_rtc_source.cpp @@ -703,6 +703,7 @@ srs_error_t SrsRtcSource::on_timer(srs_utime_t interval) for (int i = 0; i < (int)stream_desc_->video_track_descs_.size(); i++) { SrsRtcTrackDescription* desc = stream_desc_->video_track_descs_.at(i); + srs_trace("RTC: to rtmp bridge request key frame, ssrc=%u, publisher cid=%s", desc->ssrc_, publish_stream_->context_id().c_str()); publish_stream_->request_keyframe(desc->ssrc_, publish_stream_->context_id()); } From 06475e25087f18a213e5015d9108fd337a826a61 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 19 Jan 2023 09:31:37 +0800 Subject: [PATCH 3/3] Update release v6.0.19 v5.0.138 --- trunk/doc/CHANGELOG.md | 2 ++ trunk/src/core/srs_core_version5.hpp | 2 +- trunk/src/core/srs_core_version6.hpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 38b90fb063..fa2e55d408 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 6.0 Changelog +* v6.0, 2023-01-19, Merge [#3318](https://github.com/ossrs/srs/pull/3318): RTC: fix rtc publisher pli cid. v6.0.19 (#3318) * v6.0, 2023-01-18, Merge [#3382](https://github.com/ossrs/srs/pull/3382): Rewrite research/api-server code by Go, remove Python. v6.0.18 (#3382) * v6.0, 2023-01-18, Merge [#3386](https://github.com/ossrs/srs/pull/3386): SRT: fix crash when srt_to_rtmp off. v6.0.17 (#3386) * v5.0, 2023-01-17, Merge [#3385](https://github.com/ossrs/srs/pull/3385): API: Support server/pid/service label for exporter and api. v6.0.16 (#3385) @@ -32,6 +33,7 @@ The changelog for SRS. ## SRS 5.0 Changelog +* v5.0, 2023-01-19, Merge [#3318](https://github.com/ossrs/srs/pull/3318): RTC: fix rtc publisher pli cid. v5.0.138 (#3318) * v5.0, 2023-01-18, Merge [#3382](https://github.com/ossrs/srs/pull/3382): Rewrite research/api-server code by Go, remove Python. v5.0.137 (#3382) * v5.0, 2023-01-18, Merge [#3386](https://github.com/ossrs/srs/pull/3386): SRT: fix crash when srt_to_rtmp off. v5.0.136 (#3386) * v5.0, 2023-01-17, Merge [#3385](https://github.com/ossrs/srs/pull/3385): API: Support server/pid/service label for exporter and api. v5.0.135 (#3385) diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index 74139f7bf2..3d48b023a4 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 137 +#define VERSION_REVISION 138 #endif diff --git a/trunk/src/core/srs_core_version6.hpp b/trunk/src/core/srs_core_version6.hpp index 2077a0c74a..30f596cade 100644 --- a/trunk/src/core/srs_core_version6.hpp +++ b/trunk/src/core/srs_core_version6.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 6 #define VERSION_MINOR 0 -#define VERSION_REVISION 18 +#define VERSION_REVISION 19 #endif