mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Refactor code.
This commit is contained in:
parent
70d51ffc5b
commit
8ca793593d
5 changed files with 32 additions and 13 deletions
|
@ -35,7 +35,6 @@
|
|||
class SrsRequest;
|
||||
class SrsConnection;
|
||||
class SrsMetaCache;
|
||||
class SrsRtcPublisher;
|
||||
class SrsSharedPtrMessage;
|
||||
class SrsCommonMessage;
|
||||
class SrsMessageArray;
|
||||
|
@ -94,6 +93,15 @@ private:
|
|||
// Global singleton instance.
|
||||
extern SrsRtcSourceManager* _srs_rtc_sources;
|
||||
|
||||
class ISrsRtcPublisher
|
||||
{
|
||||
public:
|
||||
ISrsRtcPublisher();
|
||||
virtual ~ISrsRtcPublisher();
|
||||
public:
|
||||
virtual void request_keyframe() = 0;
|
||||
};
|
||||
|
||||
class SrsRtcSource
|
||||
{
|
||||
private:
|
||||
|
@ -105,7 +113,7 @@ private:
|
|||
// previous source id.
|
||||
int _pre_source_id;
|
||||
SrsRequest* req;
|
||||
SrsRtcPublisher* rtc_publisher_;
|
||||
ISrsRtcPublisher* rtc_publisher_;
|
||||
// Transmux RTMP to RTC.
|
||||
SrsRtcFromRtmpBridger* bridger_;
|
||||
private:
|
||||
|
@ -145,8 +153,8 @@ public:
|
|||
virtual void on_unpublish();
|
||||
public:
|
||||
// Get and set the publisher, passed to consumer to process requests such as PLI.
|
||||
SrsRtcPublisher* rtc_publisher();
|
||||
void set_rtc_publisher(SrsRtcPublisher* v);
|
||||
ISrsRtcPublisher* rtc_publisher();
|
||||
void set_rtc_publisher(ISrsRtcPublisher* v);
|
||||
// Consume the shared RTP packet, user must free it.
|
||||
srs_error_t on_rtp(SrsRtpPacket2* pkt);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue