整理MediaSource派生类代码

This commit is contained in:
xiongziliang
2019-12-25 11:04:12 +08:00
parent bb4e8b73b5
commit 1bfe4937cd
10 changed files with 246 additions and 153 deletions

View File

@@ -57,12 +57,12 @@ public:
}
virtual ~RtmpToRtspMediaSource(){}
void onGetMetaData(const AMFValue &metadata) override {
void setMetaData(const AMFValue &metadata) override {
if(!_demuxer){
//在未调用onWrite前设置Metadata能触发生成RtmpDemuxer
_demuxer = std::make_shared<RtmpDemuxer>(metadata);
}
RtmpMediaSource::onGetMetaData(metadata);
RtmpMediaSource::setMetaData(metadata);
}
void onWrite(const RtmpPacket::Ptr &pkt,bool key_pos = true) override {