优化类命名以及添加注释

This commit is contained in:
xiongziliang 2019-07-25 09:38:16 +08:00
parent 7baa35e594
commit d2a889b463

View File

@ -292,9 +292,12 @@ private:
map<void *,FrameWriterInterface::Ptr> _delegateMap; map<void *,FrameWriterInterface::Ptr> _delegateMap;
}; };
class FrameNoCacheAble : public Frame{ /**
* Frame接口包装指针便使ZLMediaKit
*/
class FrameFromPtr : public Frame{
public: public:
typedef std::shared_ptr<FrameNoCacheAble> Ptr; typedef std::shared_ptr<FrameFromPtr> Ptr;
char *data() const override{ char *data() const override{
return _ptr; return _ptr;
} }
@ -316,14 +319,6 @@ public:
uint32_t prefixSize() const override{ uint32_t prefixSize() const override{
return _prefixSize; return _prefixSize;
} }
/**
*
* @return
*/
bool cacheAble() const override {
return false;
}
protected: protected:
char *_ptr; char *_ptr;
uint32_t _size; uint32_t _size;
@ -332,7 +327,31 @@ protected:
uint32_t _prefixSize; uint32_t _prefixSize;
}; };
class FrameCacheAble : public FrameNoCacheAble { /**
* DevChannel类中有用到
* 使
* ZLMediaKit是同步对帧数据进行使用和处理的
*
* Frame::getCacheAbleFrame方法拷贝一个可缓存的帧
*/
class FrameNoCacheAble : public FrameFromPtr{
public:
typedef std::shared_ptr<FrameNoCacheAble> Ptr;
/**
*
* @return
*/
bool cacheAble() const override {
return false;
}
};
/**
*
* @see FrameNoCacheAble
*/
class FrameCacheAble : public FrameFromPtr {
public: public:
typedef std::shared_ptr<FrameCacheAble> Ptr; typedef std::shared_ptr<FrameCacheAble> Ptr;