完成Track对象与SDP对象的转换

This commit is contained in:
xiongziliang
2018-10-23 22:16:54 +08:00
parent be9af50dbb
commit b6c64fb4ed
4 changed files with 95 additions and 39 deletions

View File

@@ -95,7 +95,6 @@ public:
virtual void inputFrame(const Frame::Ptr &frame) = 0;
};
class FrameRing : public FrameRingInterface{
public:
typedef std::shared_ptr<FrameRing> Ptr;
@@ -132,6 +131,53 @@ protected:
RingType::Ptr _frameRing;
};
class FrameRingInterfaceDelegate : public FrameRingInterface {
public:
typedef std::shared_ptr<FrameRingInterfaceDelegate> Ptr;
FrameRingInterfaceDelegate(){
_delegate = std::make_shared<FrameRing>();
}
virtual ~FrameRingInterfaceDelegate(){}
void setDelegate(const FrameRingInterface::Ptr &delegate){
_delegate = delegate;
}
/**
* 获取帧环形缓存
* @return
*/
FrameRingInterface::RingType::Ptr getFrameRing() const override {
if(_delegate){
return _delegate->getFrameRing();
}
return nullptr;
}
/**
* 设置帧环形缓存
* @param ring
*/
void setFrameRing(const FrameRingInterface::RingType::Ptr &ring) override {
if(_delegate){
_delegate->setFrameRing(ring);
}
}
/**
* 写入帧数据
* @param frame 帧
*/
void inputFrame(const Frame::Ptr &frame) override{
if(_delegate){
_delegate->inputFrame(frame);
}
}
private:
FrameRingInterface::Ptr _delegate;
};
/**
* 264帧类
*/