完成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

@@ -49,7 +49,7 @@ using namespace toolkit;
namespace mediakit {
class RtspMediaSource: public MediaSource {
class RtspMediaSource: public MediaSource , public RingDelegate<RtpPacket::Ptr> {
public:
typedef ResourcePool<RtpPacket> PoolType;
typedef std::shared_ptr<RtspMediaSource> Ptr;
@@ -93,6 +93,11 @@ public:
trackRef.type = rtppt->type;
_pRing->write(rtppt,keyPos);
}
private:
void onWrite(const RtpPacket::Ptr &rtppt, bool keyPos) override {
onGetRTP(rtppt,keyPos);
}
protected:
unordered_map<int, RtspTrack> _mapTracks;
string _strSdp; //媒体描述信息