Commit 5b5db045 by xiongziliang

支持自定义环形缓冲大小

parent 41e5cab6
...@@ -53,9 +53,9 @@ public: ...@@ -53,9 +53,9 @@ public:
typedef std::shared_ptr<RtmpMediaSource> Ptr; typedef std::shared_ptr<RtmpMediaSource> Ptr;
typedef RingBuffer<RtmpPacket::Ptr> RingType; typedef RingBuffer<RtmpPacket::Ptr> RingType;
RtmpMediaSource(const string &vhost,const string &strApp, const string &strId) : RtmpMediaSource(const string &vhost,const string &strApp, const string &strId,int ringSize = 32) :
MediaSource(RTMP_SCHEMA,vhost,strApp,strId), MediaSource(RTMP_SCHEMA,vhost,strApp,strId),
_pRing(new RingBuffer<RtmpPacket::Ptr>()) { _pRing(new RingBuffer<RtmpPacket::Ptr>(ringSize)) {
} }
virtual ~RtmpMediaSource() {} virtual ~RtmpMediaSource() {}
......
...@@ -53,7 +53,8 @@ public: ...@@ -53,7 +53,8 @@ public:
const string &app, const string &app,
const string &id, const string &id,
bool bEnableHls = true, bool bEnableHls = true,
bool bEnableMp4 = false):RtmpMediaSource(vhost, app, id){ bool bEnableMp4 = false,
int ringSize = 32):RtmpMediaSource(vhost, app, id,ringSize){
_recorder = std::make_shared<MediaRecorder>(vhost, app, id, bEnableHls, bEnableMp4); _recorder = std::make_shared<MediaRecorder>(vhost, app, id, bEnableHls, bEnableMp4);
} }
virtual ~RtmpToRtspMediaSource(){} virtual ~RtmpToRtspMediaSource(){}
......
...@@ -55,9 +55,9 @@ public: ...@@ -55,9 +55,9 @@ public:
typedef std::shared_ptr<RtspMediaSource> Ptr; typedef std::shared_ptr<RtspMediaSource> Ptr;
typedef RingBuffer<RtpPacket::Ptr> RingType; typedef RingBuffer<RtpPacket::Ptr> RingType;
RtspMediaSource(const string &strVhost,const string &strApp, const string &strId) : RtspMediaSource(const string &strVhost,const string &strApp, const string &strId,int ringSize = 32) :
MediaSource(RTSP_SCHEMA,strVhost,strApp,strId), MediaSource(RTSP_SCHEMA,strVhost,strApp,strId),
_pRing(new RingBuffer<RtpPacket::Ptr>()) { _pRing(new RingBuffer<RtpPacket::Ptr>(ringSize)) {
} }
virtual ~RtspMediaSource() {} virtual ~RtspMediaSource() {}
......
...@@ -46,7 +46,8 @@ public: ...@@ -46,7 +46,8 @@ public:
const string &app, const string &app,
const string &id, const string &id,
bool bEnableHls = true, bool bEnableHls = true,
bool bEnableMp4 = false) : RtspMediaSource(vhost, app, id) { bool bEnableMp4 = false,
int ringSize = 32) : RtspMediaSource(vhost, app, id,ringSize) {
_recorder = std::make_shared<MediaRecorder>(vhost, app, id, bEnableHls, bEnableMp4); _recorder = std::make_shared<MediaRecorder>(vhost, app, id, bEnableHls, bEnableMp4);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论