修复rtp tcp推流情况下获取Origin相关失败的问题

This commit is contained in:
xiongziliang
2020-10-24 23:34:22 +08:00
parent d74604e014
commit b5a25793c4
4 changed files with 20 additions and 26 deletions

View File

@@ -19,7 +19,7 @@ using namespace mediakit;
namespace mediakit {
class RtpProcess : public SockInfo, public MediaSinkInterface, public std::enable_shared_from_this<RtpProcess>{
class RtpProcess : public SockInfo, public MediaSinkInterface, public MediaSourceEventInterceptor, public std::enable_shared_from_this<RtpProcess>{
public:
typedef std::shared_ptr<RtpProcess> Ptr;
friend class RtpProcessHelper;
@@ -68,6 +68,11 @@ protected:
void addTrack(const Track::Ptr & track) override;
void resetTracks() override {};
//// MediaSourceEvent override ////
MediaOriginType getOriginType(MediaSource &sender) const override;
string getOriginUrl(MediaSource &sender) const override;
std::shared_ptr<SockInfo> getOriginSock(MediaSource &sender) const override;
private:
void emitOnPublish();
@@ -81,7 +86,6 @@ private:
function<void()> _on_detach;
std::shared_ptr<FILE> _save_file_rtp;
std::shared_ptr<FILE> _save_file_video;
std::weak_ptr<MediaSourceEvent> _listener;
ProcessInterface::Ptr _process;
MultiMediaSourceMuxer::Ptr _muxer;
};