完成MediaSource生成器

This commit is contained in:
xiongziliang
2018-10-25 16:46:00 +08:00
parent 84dbe5597d
commit 1ff490d119
8 changed files with 161 additions and 21 deletions

View File

@@ -48,7 +48,7 @@ using namespace toolkit;
namespace mediakit {
class RtmpMediaSource: public MediaSource {
class RtmpMediaSource: public MediaSource ,public RingDelegate<RtmpPacket::Ptr> {
public:
typedef std::shared_ptr<RtmpMediaSource> Ptr;
typedef RingBuffer<RtmpPacket::Ptr> RingType;
@@ -107,6 +107,10 @@ private:
lock_guard<recursive_mutex> lock(_mtxMap);
return _iCfgFrameSize != -1 && _iCfgFrameSize == _mapCfgFrame.size();
}
void onWrite(const RtmpPacket::Ptr &pkt,bool isKey = true) override {
onGetMedia(pkt);
}
protected:
AMFValue _metadata;
unordered_map<int, RtmpPacket::Ptr> _mapCfgFrame;