mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 08:39:34 +08:00
节省内存、修复MediaSource不注册的bug
This commit is contained in:
parent
91a766243b
commit
a01d083f15
@ -39,8 +39,8 @@ namespace mediakit{
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
CodecInvalid = -1,
|
CodecInvalid = -1,
|
||||||
CodecH264 = 0,
|
CodecH264 = 0,
|
||||||
CodecAAC = 0x0100,
|
CodecAAC,
|
||||||
CodecMax
|
CodecMax = 0x7FFF
|
||||||
} CodecId;
|
} CodecId;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -48,7 +48,7 @@ typedef enum {
|
|||||||
TrackVideo = 0,
|
TrackVideo = 0,
|
||||||
TrackAudio,
|
TrackAudio,
|
||||||
TrackTitle,
|
TrackTitle,
|
||||||
TrackMax
|
TrackMax = 0x7FFF
|
||||||
} TrackType;
|
} TrackType;
|
||||||
|
|
||||||
class CodecInfo {
|
class CodecInfo {
|
||||||
@ -148,7 +148,6 @@ public:
|
|||||||
typedef std::shared_ptr<FrameRing> Ptr;
|
typedef std::shared_ptr<FrameRing> Ptr;
|
||||||
|
|
||||||
FrameRing(){
|
FrameRing(){
|
||||||
_frameRing = std::make_shared<RingType>();
|
|
||||||
}
|
}
|
||||||
virtual ~FrameRing(){}
|
virtual ~FrameRing(){}
|
||||||
|
|
||||||
@ -212,7 +211,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
mutex _mtx;
|
mutex _mtx;
|
||||||
map<void *,FrameRingWriterInterface::Ptr> _delegateMap;
|
map<void *,FrameRingWriterInterface::Ptr> _delegateMap;
|
||||||
FrameRing::Ptr _frameRing;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ void RtmpMuxer::inputFrame(const Frame::Ptr &frame) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
it->second->inputFrame(frame);
|
it->second->inputFrame(frame);
|
||||||
if(!_trackReadyCallback.empty() && it->second->ready()){
|
if(!_inited && !_trackReadyCallback.empty() && it->second->ready()){
|
||||||
//Track由未就绪状态装换成就绪状态,我们就生成metedata以及Rtmp编码器
|
//Track由未就绪状态装换成就绪状态,我们就生成metedata以及Rtmp编码器
|
||||||
auto it_callback = _trackReadyCallback.find(codec_id);
|
auto it_callback = _trackReadyCallback.find(codec_id);
|
||||||
if(it_callback != _trackReadyCallback.end()){
|
if(it_callback != _trackReadyCallback.end()){
|
||||||
|
@ -78,7 +78,7 @@ void RtspMuxer::inputFrame(const Frame::Ptr &frame) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
it->second->inputFrame(frame);
|
it->second->inputFrame(frame);
|
||||||
if(!_trackReadyCallback.empty() && it->second->ready()){
|
if(!_inited && !_trackReadyCallback.empty() && it->second->ready()){
|
||||||
//Track由未就绪状态装换成就绪状态,我们就生成sdp以及rtp编码器
|
//Track由未就绪状态装换成就绪状态,我们就生成sdp以及rtp编码器
|
||||||
auto it_callback = _trackReadyCallback.find(codec_id);
|
auto it_callback = _trackReadyCallback.find(codec_id);
|
||||||
if(it_callback != _trackReadyCallback.end()){
|
if(it_callback != _trackReadyCallback.end()){
|
||||||
|
Loading…
Reference in New Issue
Block a user