初步完成H264 的 RTMP打包解包

This commit is contained in:
xiongziliang
2018-10-24 12:01:40 +08:00
parent 3850ecec96
commit 6c9d50b04b
11 changed files with 404 additions and 17 deletions

View File

@@ -72,7 +72,6 @@ public:
typedef std::shared_ptr<RtpRing> Ptr;
RtpRing(){
//禁用缓存
_rtpRing = std::make_shared<RingType>();
}
virtual ~RtpRing(){}
@@ -111,7 +110,6 @@ public:
m_ui32MtuSize = ui32MtuSize;
m_ui8PlayloadType = ui8PlayloadType;
m_ui8Interleaved = ui8Interleaved;
m_rtpPool.setSize(32);
}
virtual ~RtpInfo(){}
@@ -141,10 +139,6 @@ public:
uint32_t getMtuSize() const {
return m_ui32MtuSize;
}
protected:
RtpPacket::Ptr obtainRtp(){
return m_rtpPool.obtain();
}
protected:
uint32_t m_ui32Ssrc;
uint32_t m_ui32SampleRate;
@@ -153,10 +147,9 @@ protected:
uint8_t m_ui8Interleaved;
uint16_t m_ui16Sequence = 0;
uint32_t m_ui32TimeStamp = 0;
ResourcePool<RtpPacket> m_rtpPool;
};
class RtpCodec : public RtpRing, public FrameRingInterfaceDelegate , public CodecInfo{
class RtpCodec : public RtpRing, public FrameRingInterfaceDelegate , public CodecInfo , public ResourcePoolHelper<RtpPacket>{
public:
typedef std::shared_ptr<RtpCodec> Ptr;
RtpCodec(){}