添加注释

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

View File

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

View File

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