整理代码

This commit is contained in:
xiongziliang
2020-08-30 10:48:34 +08:00
parent 4255914613
commit fbd711a6bb
28 changed files with 1052 additions and 1011 deletions

View File

@@ -23,14 +23,14 @@ public:
typedef std::shared_ptr<RtmpRing> Ptr;
typedef RingBuffer<RtmpPacket::Ptr> RingType;
RtmpRing(){}
virtual ~RtmpRing(){}
RtmpRing() {}
virtual ~RtmpRing() {}
/**
* 获取rtmp环形缓存
* @return
*/
virtual RingType::Ptr getRtmpRing() const{
virtual RingType::Ptr getRtmpRing() const {
return _rtmpRing;
}
@@ -38,7 +38,7 @@ public:
* 设置rtmp环形缓存
* @param ring
*/
virtual void setRtmpRing(const RingType::Ptr &ring){
virtual void setRtmpRing(const RingType::Ptr &ring) {
_rtmpRing = ring;
}
@@ -48,17 +48,17 @@ public:
* @param key_pos 是否为关键帧
* @return 是否为关键帧
*/
virtual bool inputRtmp(const RtmpPacket::Ptr &rtmp, bool key_pos){
if(_rtmpRing){
_rtmpRing->write(rtmp,key_pos);
virtual bool inputRtmp(const RtmpPacket::Ptr &rtmp, bool key_pos) {
if (_rtmpRing) {
_rtmpRing->write(rtmp, key_pos);
}
return key_pos;
}
protected:
RingType::Ptr _rtmpRing;
};
class RtmpCodec : public RtmpRing, public FrameDispatcher , public CodecInfo{
public:
typedef std::shared_ptr<RtmpCodec> Ptr;
@@ -69,5 +69,4 @@ public:
}//namespace mediakit
#endif //ZLMEDIAKIT_RTMPCODEC_H