添加注释

This commit is contained in:
xiongziliang 2018-10-27 22:54:16 +08:00
parent 820da43832
commit 83a0ee8595
3 changed files with 49 additions and 2 deletions

View File

@ -37,6 +37,10 @@ using namespace toolkit;
namespace mediakit{
/**
* Track ready()true也就是就绪后再通知派生类进行下一步的操作
* Frame前由Track截取处理下便sps pps aa_cfg
*/
class MediaSink : public FrameWriterInterface , public std::enable_shared_from_this<MediaSink>{
public:
typedef std::shared_ptr<MediaSink> Ptr;

View File

@ -52,6 +52,9 @@ typedef enum {
TrackMax = 0x7FFF
} TrackType;
/**
*
*/
class CodecInfo {
public:
typedef std::shared_ptr<CodecInfo> Ptr;
@ -70,6 +73,9 @@ public:
virtual CodecId getCodecId() const = 0;
};
/**
*
*/
class Frame : public Buffer, public CodecInfo{
public:
typedef std::shared_ptr<Frame> Ptr;
@ -92,6 +98,10 @@ public:
virtual bool keyFrame() const = 0;
};
/**
*
* @tparam T
*/
template <typename T>
class ResourcePoolHelper{
public:
@ -107,6 +117,9 @@ private:
ResourcePool<T> _pool;
};
/**
*
*/
class FrameWriterInterface {
public:
typedef std::shared_ptr<FrameWriterInterface> Ptr;
@ -120,11 +133,18 @@ public:
virtual void inputFrame(const Frame::Ptr &frame) = 0;
};
/**
* function
*/
class FrameWriterInterfaceHelper : public FrameWriterInterface {
public:
typedef std::shared_ptr<FrameWriterInterfaceHelper> Ptr;
typedef std::function<void(const Frame::Ptr &frame)> onWriteFrame;
/**
* inputFrame后触发onWriteFrame回调
* @param cb
*/
FrameWriterInterfaceHelper(const onWriteFrame& cb){
_writeCallback = cb;
}
@ -165,6 +185,9 @@ public:
virtual void setFrameRing(const RingType::Ptr &ring) = 0;
};
/**
*
*/
class FrameRing : public FrameRingInterface{
public:
typedef std::shared_ptr<FrameRing> Ptr;
@ -202,6 +225,9 @@ protected:
RingType::Ptr _frameRing;
};
/**
*
*/
class FrameRingInterfaceDelegate : public FrameRing {
public:
typedef std::shared_ptr<FrameRingInterfaceDelegate> Ptr;

View File

@ -37,6 +37,9 @@ using namespace toolkit;
namespace mediakit{
/**
*
*/
class Track : public FrameRingInterfaceDelegate , public CodecInfo{
public:
typedef std::shared_ptr<Track> Ptr;
@ -45,25 +48,30 @@ public:
virtual ~Track(){}
/**
*
* sps pps等信息
* @return
*/
virtual bool ready() = 0;
/**
*
*
*
* @return
*/
virtual Track::Ptr clone() = 0;
/**
*
*
*
* @param that
*/
Track(const Track &that){}
};
/**
* Track类fps信息
*/
class VideoTrack : public Track {
public:
typedef std::shared_ptr<VideoTrack> Ptr;
@ -89,6 +97,9 @@ public:
virtual float getVideoFps() const = 0;
};
/**
* Track派生类
*/
class AudioTrack : public Track {
public:
typedef std::shared_ptr<AudioTrack> Ptr;
@ -114,6 +125,9 @@ public:
virtual int getAudioChannel() const = 0;
};
/**
* 264
*/
class H264Track : public VideoTrack{
public:
typedef std::shared_ptr<H264Track> Ptr;
@ -270,6 +284,9 @@ private:
float _fps = 0;
};
/**
* aac音频通道
*/
class AACTrack : public AudioTrack{
public:
typedef std::shared_ptr<AACTrack> Ptr;