mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 11:41:44 +08:00
完成Rtmp解复用器
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
//
|
||||
|
||||
#include "Factory.h"
|
||||
#include "RtmpMuxer/H264RtmpCodec.h"
|
||||
#include "RtmpMuxer/AACRtmpCodec.h"
|
||||
#include "RtspMuxer/H264RtpCodec.h"
|
||||
#include "RtspMuxer/AACRtpCodec.h"
|
||||
|
||||
namespace mediakit{
|
||||
|
||||
@@ -75,7 +79,7 @@ Track::Ptr Factory::getTrackBySdp(const string &sdp) {
|
||||
}
|
||||
|
||||
|
||||
CodecId getCodecIdByAmf(const AMFValue &val){
|
||||
CodecId Factory::getCodecIdByAmf(const AMFValue &val){
|
||||
if (val.type() == AMF_STRING){
|
||||
auto str = val.as_string();
|
||||
if(str == "avc1"){
|
||||
@@ -153,6 +157,17 @@ RtpCodec::Ptr Factory::getRtpDecoderById(CodecId codecId, uint32_t ui32SampleRat
|
||||
}
|
||||
}
|
||||
|
||||
RtmpCodec::Ptr Factory::getRtmpCodecById(CodecId codecId) {
|
||||
switch (codecId){
|
||||
case CodecH264:
|
||||
return std::make_shared<H264RtmpEncoder>();
|
||||
case CodecAAC:
|
||||
return std::make_shared<AACRtmpEncoder>();
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}//namespace mediakit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user