新增Frame多转发代理

This commit is contained in:
xiongziliang
2018-10-26 16:09:48 +08:00
parent 6870292fd6
commit f26076635d
10 changed files with 145 additions and 79 deletions

View File

@@ -84,7 +84,7 @@ void RtmpDemuxer::makeVideoTrack(const AMFValue &videoCodec) {
_videoRtmpDecoder = Factory::getRtmpCodecByTrack(_videoTrack);
if (_videoRtmpDecoder) {
//设置rtmp解码器代理生成的frame写入该Track
_videoRtmpDecoder->setDelegate(_videoTrack);
_videoRtmpDecoder->addDelegate(_videoTrack);
} else {
//找不到相应的rtmp解码器该track无效
_videoTrack.reset();
@@ -100,7 +100,7 @@ void RtmpDemuxer::makeAudioTrack(const AMFValue &audioCodec) {
_audioRtmpDecoder = Factory::getRtmpCodecByTrack(_audioTrack);
if (_audioRtmpDecoder) {
//设置rtmp解码器代理生成的frame写入该Track
_audioRtmpDecoder->setDelegate(_audioTrack);
_audioRtmpDecoder->addDelegate(_audioTrack);
} else {
//找不到相应的rtmp解码器该track无效
_audioTrack.reset();

View File

@@ -60,7 +60,7 @@ void RtmpMuxer::addTrack(const Track::Ptr &track) {
_metedata.set(key,value);
});
//设置Track的代理这样输入frame至Track时最终数据将输出到RtmpEncoder中
track->setDelegate(encoder);
track->addDelegate(encoder);
//Rtmp编码器共用同一个环形缓存
encoder->setRtmpRing(_rtmpRing);
};