Commit 37fdb8d1 by ziyue

MediaSource: 继承改成私有

parent 34d833a1
...@@ -31,7 +31,7 @@ public: ...@@ -31,7 +31,7 @@ public:
}; };
//FMP4直播源 //FMP4直播源
class FMP4MediaSource : public MediaSource, public RingDelegate<FMP4Packet::Ptr>, public PacketCache<FMP4Packet>{ class FMP4MediaSource : public MediaSource, public RingDelegate<FMP4Packet::Ptr>, private PacketCache<FMP4Packet>{
public: public:
using Ptr = std::shared_ptr<FMP4MediaSource>; using Ptr = std::shared_ptr<FMP4MediaSource>;
using RingDataType = std::shared_ptr<List<FMP4Packet::Ptr> >; using RingDataType = std::shared_ptr<List<FMP4Packet::Ptr> >;
......
...@@ -40,7 +40,7 @@ namespace mediakit { ...@@ -40,7 +40,7 @@ namespace mediakit {
* 只要生成了这三要素,那么要实现rtmp推流、rtmp服务器就很简单了 * 只要生成了这三要素,那么要实现rtmp推流、rtmp服务器就很简单了
* rtmp推拉流协议中,先传递metadata,然后传递config帧,然后一直传递普通帧 * rtmp推拉流协议中,先传递metadata,然后传递config帧,然后一直传递普通帧
*/ */
class RtmpMediaSource : public MediaSource, public RingDelegate<RtmpPacket::Ptr>, public PacketCache<RtmpPacket>{ class RtmpMediaSource : public MediaSource, public RingDelegate<RtmpPacket::Ptr>, private PacketCache<RtmpPacket>{
public: public:
typedef std::shared_ptr<RtmpMediaSource> Ptr; typedef std::shared_ptr<RtmpMediaSource> Ptr;
typedef std::shared_ptr<List<RtmpPacket::Ptr> > RingDataType; typedef std::shared_ptr<List<RtmpPacket::Ptr> > RingDataType;
......
...@@ -27,7 +27,7 @@ using namespace std; ...@@ -27,7 +27,7 @@ using namespace std;
using namespace toolkit; using namespace toolkit;
namespace mediakit { namespace mediakit {
class RtmpMediaSourceImp: public RtmpMediaSource, public TrackListener , public MultiMediaSourceMuxer::Listener { class RtmpMediaSourceImp: public RtmpMediaSource, private TrackListener, public MultiMediaSourceMuxer::Listener {
public: public:
typedef std::shared_ptr<RtmpMediaSourceImp> Ptr; typedef std::shared_ptr<RtmpMediaSourceImp> Ptr;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
namespace mediakit{ namespace mediakit{
class RtpCache : public PacketCache<Buffer> { class RtpCache : private PacketCache<Buffer> {
public: public:
using onFlushed = function<void(std::shared_ptr<List<Buffer::Ptr> >)>; using onFlushed = function<void(std::shared_ptr<List<Buffer::Ptr> >)>;
RtpCache(onFlushed cb); RtpCache(onFlushed cb);
......
...@@ -36,7 +36,7 @@ namespace mediakit { ...@@ -36,7 +36,7 @@ namespace mediakit {
* 只要生成了这两要素,那么要实现rtsp推流、rtsp服务器就很简单了 * 只要生成了这两要素,那么要实现rtsp推流、rtsp服务器就很简单了
* rtsp推拉流协议中,先传递sdp,然后再协商传输方式(tcp/udp/组播),最后一直传递rtp * rtsp推拉流协议中,先传递sdp,然后再协商传输方式(tcp/udp/组播),最后一直传递rtp
*/ */
class RtspMediaSource : public MediaSource, public RingDelegate<RtpPacket::Ptr>, public PacketCache<RtpPacket> { class RtspMediaSource : public MediaSource, public RingDelegate<RtpPacket::Ptr>, private PacketCache<RtpPacket> {
public: public:
typedef ResourcePool<RtpPacket> PoolType; typedef ResourcePool<RtpPacket> PoolType;
typedef std::shared_ptr<RtspMediaSource> Ptr; typedef std::shared_ptr<RtspMediaSource> Ptr;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
using namespace toolkit; using namespace toolkit;
namespace mediakit { namespace mediakit {
class RtspMediaSourceImp : public RtspMediaSource, public TrackListener, public MultiMediaSourceMuxer::Listener { class RtspMediaSourceImp : public RtspMediaSource, private TrackListener, public MultiMediaSourceMuxer::Listener {
public: public:
typedef std::shared_ptr<RtspMediaSourceImp> Ptr; typedef std::shared_ptr<RtspMediaSourceImp> Ptr;
......
...@@ -31,7 +31,7 @@ public: ...@@ -31,7 +31,7 @@ public:
}; };
//TS直播源 //TS直播源
class TSMediaSource : public MediaSource, public RingDelegate<TSPacket::Ptr>, public PacketCache<TSPacket>{ class TSMediaSource : public MediaSource, public RingDelegate<TSPacket::Ptr>, private PacketCache<TSPacket>{
public: public:
using Ptr = std::shared_ptr<TSMediaSource>; using Ptr = std::shared_ptr<TSMediaSource>;
using RingDataType = std::shared_ptr<List<TSPacket::Ptr> >; using RingDataType = std::shared_ptr<List<TSPacket::Ptr> >;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论