RTP代理支持完整的事件

This commit is contained in:
xiongziliang
2020-02-28 16:25:14 +08:00
parent 5acdf1f789
commit 109fab2cb1
6 changed files with 114 additions and 8 deletions

View File

@@ -36,14 +36,20 @@ using namespace toolkit;
namespace mediakit{
class RtpSession : public TcpSession , public RtpSplitter{
class RtpSession : public TcpSession , public RtpSplitter , public MediaSourceEvent{
public:
RtpSession(const Socket::Ptr &sock);
~RtpSession() override;
void onRecv(const Buffer::Ptr &) override;
void onError(const SockException &err) override;
void onManager() override;
private:
protected:
// 通知其停止推流
bool close(MediaSource &sender,bool force) override;
// 通知无人观看
void onNoneReader(MediaSource &sender) override;
// 观看总人数
int totalReaderCount(MediaSource &sender) override;
void onRtpPacket(const char *data,uint64_t len) override;
private:
uint32_t _ssrc = 0;