1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Support hijack play and consuming

This commit is contained in:
winlin 2020-05-24 21:40:23 +08:00
parent a5265c5753
commit f501d5b63d
2 changed files with 17 additions and 0 deletions

View file

@ -536,6 +536,12 @@ srs_error_t SrsRtcPlayer::initialize(const uint32_t& vssrc, const uint32_t& assr
srs_trace("RTC publisher video(ssrc=%d, pt=%d), audio(ssrc=%d, pt=%d), nack=%d",
video_ssrc, video_payload_type, audio_ssrc, audio_payload_type, nack_enabled_);
if (_srs_rtc_hijacker) {
if ((err = _srs_rtc_hijacker->on_start_play(session_, this, session_->req)) != srs_success) {
return srs_error_wrap(err, "on start play");
}
}
return err;
}
@ -628,6 +634,12 @@ srs_error_t SrsRtcPlayer::cycle()
vector<SrsRtpPacket2*> pkts;
SrsRtcOutgoingInfo info;
if (_srs_rtc_hijacker) {
if ((err = _srs_rtc_hijacker->on_start_consume(session_, this, session_->req, consumer)) != srs_success) {
return srs_error_wrap(err, "on start consuming");
}
}
while (true) {
if ((err = trd->pull()) != srs_success) {
return srs_error_wrap(err, "rtc sender thread");