mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Refine source, pass-by RTC publisher for player
This commit is contained in:
parent
20b4984af4
commit
1688d53f7d
3 changed files with 12 additions and 13 deletions
|
@ -754,7 +754,10 @@ srs_error_t SrsRtcSenderThread::cycle()
|
||||||
|
|
||||||
// For RTC, notify the source to fetch keyframe for this client.
|
// For RTC, notify the source to fetch keyframe for this client.
|
||||||
// TODO: FIXME: Should triggle by PLI from client.
|
// TODO: FIXME: Should triggle by PLI from client.
|
||||||
source->request_keyframe();
|
SrsRtcPublisher* publisher = source->rtc_publisher();
|
||||||
|
if (publisher) {
|
||||||
|
publisher->request_keyframe();
|
||||||
|
}
|
||||||
|
|
||||||
SrsMessageArray msgs(SRS_PERF_MW_MSGS);
|
SrsMessageArray msgs(SRS_PERF_MW_MSGS);
|
||||||
SrsRtcPackets pkts(SRS_PERF_RTC_RTP_PACKETS);
|
SrsRtcPackets pkts(SRS_PERF_RTC_RTP_PACKETS);
|
||||||
|
|
|
@ -1921,7 +1921,7 @@ SrsSource::SrsSource()
|
||||||
atc = false;
|
atc = false;
|
||||||
|
|
||||||
#ifdef SRS_RTC
|
#ifdef SRS_RTC
|
||||||
rtc_publisher = NULL;
|
rtc_publisher_ = NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2706,16 +2706,14 @@ SrsMetaCache* SrsSource::cached_meta()
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsSource::request_keyframe()
|
SrsRtcPublisher* SrsSource::rtc_publisher()
|
||||||
{
|
{
|
||||||
if (rtc_publisher) {
|
return rtc_publisher_;
|
||||||
rtc_publisher->request_keyframe();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsSource::set_rtc_publisher(SrsRtcPublisher* v)
|
void SrsSource::set_rtc_publisher(SrsRtcPublisher* v)
|
||||||
{
|
{
|
||||||
rtc_publisher = v;
|
rtc_publisher_ = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsSource::on_rtc_audio(SrsSharedPtrMessage* audio)
|
srs_error_t SrsSource::on_rtc_audio(SrsSharedPtrMessage* audio)
|
||||||
|
|
|
@ -551,7 +551,7 @@ private:
|
||||||
srs_utime_t die_at;
|
srs_utime_t die_at;
|
||||||
#ifdef SRS_RTC
|
#ifdef SRS_RTC
|
||||||
private:
|
private:
|
||||||
SrsRtcPublisher* rtc_publisher;
|
SrsRtcPublisher* rtc_publisher_;
|
||||||
#endif
|
#endif
|
||||||
public:
|
public:
|
||||||
SrsSource();
|
SrsSource();
|
||||||
|
@ -621,12 +621,10 @@ public:
|
||||||
virtual std::string get_curr_origin();
|
virtual std::string get_curr_origin();
|
||||||
#ifdef SRS_RTC
|
#ifdef SRS_RTC
|
||||||
public:
|
public:
|
||||||
// Get the cached meta, as such the sps/pps.
|
// For RTC, we need to package SPS/PPS(in cached meta) before each IDR.
|
||||||
SrsMetaCache* cached_meta();
|
SrsMetaCache* cached_meta();
|
||||||
// Request keyframe for new client.
|
// Get and set the publisher, passed to consumer to process requests such as PLI.
|
||||||
// TODO: FIXME: Maybe we could cache the keyframe.
|
SrsRtcPublisher* rtc_publisher();
|
||||||
// TODO: FIXME: Maybe we should only response for the new clients.
|
|
||||||
void request_keyframe();
|
|
||||||
void set_rtc_publisher(SrsRtcPublisher* v);
|
void set_rtc_publisher(SrsRtcPublisher* v);
|
||||||
// When got RTC audio message, which is encoded in opus.
|
// When got RTC audio message, which is encoded in opus.
|
||||||
// TODO: FIXME: Merge with on_audio.
|
// TODO: FIXME: Merge with on_audio.
|
||||||
|
|
Loading…
Reference in a new issue