添加媒体生成源信息

This commit is contained in:
xiongziliang
2020-09-27 11:32:49 +08:00
parent 2cf66594e8
commit 5cd8e8ae1c
20 changed files with 249 additions and 12 deletions

View File

@@ -1105,6 +1105,18 @@ int RtspSession::totalReaderCount(MediaSource &sender) {
return _push_src ? _push_src->totalReaderCount() : sender.readerCount();
}
MediaOriginType RtspSession::getOriginType(MediaSource &sender) const{
return MediaOriginType::rtsp_push;
}
string RtspSession::getOriginUrl(MediaSource &sender) const {
return _media_info._full_url;
}
std::shared_ptr<SockInfo> RtspSession::getOriginSock(MediaSource &sender) const {
return const_cast<RtspSession *>(this)->shared_from_this();
}
inline void RtspSession::onSendRtpPacket(const RtpPacket::Ptr &pkt){
#if RTSP_SERVER_SEND_RTCP
int track_index = getTrackIndexByTrackType(pkt->type);

View File

@@ -74,11 +74,22 @@ protected:
void onRtpPacket(const char *data, uint64_t len) override;
//从rtsp头中获取Content长度
int64_t getContentLength(Parser &parser) override;
////RtpReceiver override////
void onRtpSorted(const RtpPacket::Ptr &rtp, int track_idx) override;
////MediaSourceEvent override////
bool close(MediaSource &sender, bool force) override ;
///////MediaSourceEvent override///////
// 关闭
bool close(MediaSource &sender, bool force) override;
// 播放总人数
int totalReaderCount(MediaSource &sender) override;
// 获取媒体源类型
MediaOriginType getOriginType(MediaSource &sender) const override;
// 获取媒体源url或者文件路径
string getOriginUrl(MediaSource &sender) const override;
// 获取媒体源客户端相关信息
std::shared_ptr<SockInfo> getOriginSock(MediaSource &sender) const override;
/////TcpSession override////
int send(const Buffer::Ptr &pkt) override;
//收到RTCP包回调