Skip to content

Commit d6477c2

Browse files
xiaozhihongwinlinvipchen-guanghua
committed
RTC: fix rtc publisher pli cid (#3318)
* RTC: fix rtc publisher pli cid * RTC: log bridge request keyframe * Update release v6.0.19 v5.0.138 PICK 7922057 Co-authored-by: Winlin <[email protected]> Co-authored-by: ChenGH <[email protected]>
1 parent 9600e49 commit d6477c2

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

trunk/doc/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The changelog for SRS.
88

99
## SRS 5.0 Changelog
1010

11+
* v5.0, 2023-01-19, Merge [#3318](https://github.com/ossrs/srs/pull/3318): RTC: fix rtc publisher pli cid. v5.0.138 (#3318)
1112
* 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)
1213
* 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)
1314
* 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)

trunk/src/app/srs_app_rtc_conn.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ srs_error_t SrsRtcPlayStream::do_request_keyframe(uint32_t ssrc, SrsContextId ci
912912
return err;
913913
}
914914

915-
publisher->request_keyframe(ssrc);
915+
publisher->request_keyframe(ssrc, cid);
916916

917917
return err;
918918
}
@@ -1611,15 +1611,14 @@ srs_error_t SrsRtcPublishStream::on_rtcp_xr(SrsRtcpXr* rtcp)
16111611
return err;
16121612
}
16131613

1614-
void SrsRtcPublishStream::request_keyframe(uint32_t ssrc)
1614+
void SrsRtcPublishStream::request_keyframe(uint32_t ssrc, SrsContextId cid)
16151615
{
1616-
SrsContextId sub_cid = _srs_context->get_id();
1617-
pli_worker_->request_keyframe(ssrc, sub_cid);
1616+
pli_worker_->request_keyframe(ssrc, cid);
16181617

16191618
uint32_t nn = 0;
16201619
if (pli_epp->can_print(ssrc, &nn)) {
16211620
// The player(subscriber) cid, which requires PLI.
1622-
srs_trace("RTC: Need PLI ssrc=%u, play=[%s], publish=[%s], count=%u/%u", ssrc, sub_cid.c_str(),
1621+
srs_trace("RTC: Need PLI ssrc=%u, play=[%s], publish=[%s], count=%u/%u", ssrc, cid.c_str(),
16231622
cid_.c_str(), nn, pli_epp->nn_count);
16241623
}
16251624
}

trunk/src/app/srs_app_rtc_conn.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ class SrsRtcPublishStream : public ISrsRtspPacketDecodeHandler
384384
srs_error_t on_rtcp_sr(SrsRtcpSR* rtcp);
385385
srs_error_t on_rtcp_xr(SrsRtcpXr* rtcp);
386386
public:
387-
void request_keyframe(uint32_t ssrc);
387+
void request_keyframe(uint32_t ssrc, SrsContextId cid);
388388
virtual srs_error_t do_request_keyframe(uint32_t ssrc, SrsContextId cid);
389389
public:
390390
void simulate_nack_drop(int nn);

trunk/src/app/srs_app_rtc_source.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,8 @@ srs_error_t SrsRtcSource::on_timer(srs_utime_t interval)
703703

704704
for (int i = 0; i < (int)stream_desc_->video_track_descs_.size(); i++) {
705705
SrsRtcTrackDescription* desc = stream_desc_->video_track_descs_.at(i);
706-
publish_stream_->request_keyframe(desc->ssrc_);
706+
srs_trace("RTC: to rtmp bridge request key frame, ssrc=%u, publisher cid=%s", desc->ssrc_, publish_stream_->context_id().c_str());
707+
publish_stream_->request_keyframe(desc->ssrc_, publish_stream_->context_id());
707708
}
708709

709710
return err;

trunk/src/app/srs_app_rtc_source.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ class ISrsRtcPublishStream
128128
virtual ~ISrsRtcPublishStream();
129129
public:
130130
// Request keyframe(PLI) from publisher, for fresh consumer.
131-
virtual void request_keyframe(uint32_t ssrc) = 0;
131+
virtual void request_keyframe(uint32_t ssrc, SrsContextId cid) = 0;
132+
// Get context id.
133+
virtual const SrsContextId& context_id() = 0;
132134
};
133135

134136
class ISrsRtcSourceEventHandler

trunk/src/core/srs_core_version5.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
#define VERSION_MAJOR 5
1111
#define VERSION_MINOR 0
12-
#define VERSION_REVISION 137
12+
#define VERSION_REVISION 138
1313

1414
#endif

0 commit comments

Comments
 (0)