mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 20:01:56 +00:00
RTC: Rename ISrsRtcPublisher to ISrsRtcPublishStream
This commit is contained in:
parent
0cdfd062f2
commit
4c73b9a819
4 changed files with 18 additions and 17 deletions
|
@ -813,7 +813,7 @@ srs_error_t SrsRtcPlayer::on_rtcp_ps_feedback(char* buf, int nb_buf)
|
|||
|
||||
switch (fmt) {
|
||||
case kPLI: {
|
||||
ISrsRtcPublisher* publisher = session_->source_->rtc_publisher();
|
||||
ISrsRtcPublishStream* publisher = session_->source_->publish_stream();
|
||||
if (publisher) {
|
||||
publisher->request_keyframe();
|
||||
srs_trace("RTC request PLI");
|
||||
|
@ -873,7 +873,7 @@ SrsRtcPublisher::~SrsRtcPublisher()
|
|||
{
|
||||
// TODO: FIXME: Do unpublish when session timeout.
|
||||
if (source) {
|
||||
source->set_rtc_publisher(NULL);
|
||||
source->set_publish_stream(NULL);
|
||||
source->on_unpublish();
|
||||
}
|
||||
|
||||
|
@ -923,7 +923,7 @@ srs_error_t SrsRtcPublisher::initialize(uint32_t vssrc, uint32_t assrc, int twcc
|
|||
return srs_error_wrap(err, "on publish");
|
||||
}
|
||||
|
||||
source->set_rtc_publisher(this);
|
||||
source->set_publish_stream(this);
|
||||
|
||||
if (_srs_rtc_hijacker) {
|
||||
if ((err = _srs_rtc_hijacker->on_start_publish(session_, this, req)) != srs_success) {
|
||||
|
|
|
@ -242,7 +242,7 @@ private:
|
|||
srs_error_t on_rtcp_rr(char* data, int nb_data);
|
||||
};
|
||||
|
||||
class SrsRtcPublisher : virtual public ISrsHourGlass, virtual public ISrsRtpPacketDecodeHandler, virtual public ISrsRtcPublisher
|
||||
class SrsRtcPublisher : virtual public ISrsHourGlass, virtual public ISrsRtpPacketDecodeHandler, virtual public ISrsRtcPublishStream
|
||||
{
|
||||
private:
|
||||
SrsHourGlass* report_timer;
|
||||
|
|
|
@ -235,18 +235,18 @@ SrsRtcSource* SrsRtcSourceManager::fetch(SrsRequest* r)
|
|||
|
||||
SrsRtcSourceManager* _srs_rtc_sources = new SrsRtcSourceManager();
|
||||
|
||||
ISrsRtcPublisher::ISrsRtcPublisher()
|
||||
ISrsRtcPublishStream::ISrsRtcPublishStream()
|
||||
{
|
||||
}
|
||||
|
||||
ISrsRtcPublisher::~ISrsRtcPublisher()
|
||||
ISrsRtcPublishStream::~ISrsRtcPublishStream()
|
||||
{
|
||||
}
|
||||
|
||||
SrsRtcSource::SrsRtcSource()
|
||||
{
|
||||
_can_publish = true;
|
||||
rtc_publisher_ = NULL;
|
||||
publish_stream_ = NULL;
|
||||
|
||||
req = NULL;
|
||||
#ifdef SRS_FFMPEG_FIT
|
||||
|
@ -399,14 +399,14 @@ void SrsRtcSource::on_unpublish()
|
|||
// TODO: FIXME: Handle by statistic.
|
||||
}
|
||||
|
||||
ISrsRtcPublisher* SrsRtcSource::rtc_publisher()
|
||||
ISrsRtcPublishStream* SrsRtcSource::publish_stream()
|
||||
{
|
||||
return rtc_publisher_;
|
||||
return publish_stream_;
|
||||
}
|
||||
|
||||
void SrsRtcSource::set_rtc_publisher(ISrsRtcPublisher* v)
|
||||
void SrsRtcSource::set_publish_stream(ISrsRtcPublishStream* v)
|
||||
{
|
||||
rtc_publisher_ = v;
|
||||
publish_stream_ = v;
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcSource::on_rtp(SrsRtpPacket2* pkt)
|
||||
|
|
|
@ -93,11 +93,12 @@ private:
|
|||
// Global singleton instance.
|
||||
extern SrsRtcSourceManager* _srs_rtc_sources;
|
||||
|
||||
class ISrsRtcPublisher
|
||||
// A publish stream interface, for source to callback with.
|
||||
class ISrsRtcPublishStream
|
||||
{
|
||||
public:
|
||||
ISrsRtcPublisher();
|
||||
virtual ~ISrsRtcPublisher();
|
||||
ISrsRtcPublishStream();
|
||||
virtual ~ISrsRtcPublishStream();
|
||||
public:
|
||||
virtual void request_keyframe() = 0;
|
||||
};
|
||||
|
@ -113,7 +114,7 @@ private:
|
|||
// previous source id.
|
||||
SrsContextId _pre_source_id;
|
||||
SrsRequest* req;
|
||||
ISrsRtcPublisher* rtc_publisher_;
|
||||
ISrsRtcPublishStream* publish_stream_;
|
||||
// Transmux RTMP to RTC.
|
||||
ISrsSourceBridger* bridger_;
|
||||
private:
|
||||
|
@ -153,8 +154,8 @@ public:
|
|||
virtual void on_unpublish();
|
||||
public:
|
||||
// Get and set the publisher, passed to consumer to process requests such as PLI.
|
||||
ISrsRtcPublisher* rtc_publisher();
|
||||
void set_rtc_publisher(ISrsRtcPublisher* v);
|
||||
ISrsRtcPublishStream* publish_stream();
|
||||
void set_publish_stream(ISrsRtcPublishStream* v);
|
||||
// Consume the shared RTP packet, user must free it.
|
||||
srs_error_t on_rtp(SrsRtpPacket2* pkt);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue