mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-04 18:17:34 +08:00
完善Rtmp复用器,可以灵活设置sps pps等信息
This commit is contained in:
@@ -196,18 +196,19 @@ RtpCodec::Ptr Factory::getRtpDecoderById(CodecId codecId, uint32_t ui32SampleRat
|
||||
}
|
||||
}
|
||||
|
||||
RtmpCodec::Ptr Factory::getRtmpCodecById(CodecId codecId) {
|
||||
switch (codecId){
|
||||
RtmpCodec::Ptr Factory::getRtmpCodecByTrack(const Track::Ptr &track) {
|
||||
switch (track->getCodecId()){
|
||||
case CodecH264:
|
||||
return std::make_shared<H264RtmpEncoder>();
|
||||
return std::make_shared<H264RtmpEncoder>(track);
|
||||
case CodecAAC:
|
||||
return std::make_shared<AACRtmpEncoder>();
|
||||
return std::make_shared<AACRtmpEncoder>(track);
|
||||
default:
|
||||
WarnL << "暂不支持该CodecId:" << codecId;
|
||||
WarnL << "暂不支持该CodecId:" << track->getCodecId();
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}//namespace mediakit
|
||||
|
||||
|
||||
@@ -106,11 +106,11 @@ public:
|
||||
static CodecId getCodecIdByAmf(const AMFValue &val);
|
||||
|
||||
/**
|
||||
* 根据CodecId获取Rtmp的编解码器
|
||||
* @param codecId CodecId
|
||||
* 根据Track获取Rtmp的编解码器
|
||||
* @param track 媒体描述对象
|
||||
* @return
|
||||
*/
|
||||
static RtmpCodec::Ptr getRtmpCodecById(CodecId codecId);
|
||||
static RtmpCodec::Ptr getRtmpCodecByTrack(const Track::Ptr &track);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user