mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 11:41:44 +08:00
webrtc新增对av1的支持
This commit is contained in:
@@ -106,47 +106,27 @@ Frame::Ptr Frame::getCacheAbleFrame(const Frame::Ptr &frame){
|
||||
return std::make_shared<FrameCacheAble>(frame);
|
||||
}
|
||||
|
||||
TrackType getTrackType(CodecId codecId){
|
||||
switch (codecId){
|
||||
case CodecVP8:
|
||||
case CodecVP9:
|
||||
case CodecH264:
|
||||
case CodecH265: return TrackVideo;
|
||||
case CodecAAC:
|
||||
case CodecG711A:
|
||||
case CodecG711U:
|
||||
case CodecOpus:
|
||||
case CodecL16: return TrackAudio;
|
||||
default: return TrackInvalid;
|
||||
TrackType getTrackType(CodecId codecId) {
|
||||
switch (codecId) {
|
||||
#define XX(name, type, value, str) case name : return type;
|
||||
CODEC_MAP(XX)
|
||||
#undef XX
|
||||
default : return TrackInvalid;
|
||||
}
|
||||
}
|
||||
|
||||
const char* getCodecName(CodecId codec){
|
||||
const char *getCodecName(CodecId codec) {
|
||||
switch (codec) {
|
||||
case CodecH264 : return "H264";
|
||||
case CodecH265 : return "H265";
|
||||
case CodecAAC : return "mpeg4-generic";
|
||||
case CodecG711A : return "PCMA";
|
||||
case CodecG711U : return "PCMU";
|
||||
case CodecOpus : return "opus";
|
||||
case CodecVP8 : return "VP8";
|
||||
case CodecVP9 : return "VP9";
|
||||
case CodecL16 : return "L16";
|
||||
default: return "invalid";
|
||||
#define XX(name, type, value, str) case name : return str;
|
||||
CODEC_MAP(XX)
|
||||
#undef XX
|
||||
default : return "invalid";
|
||||
}
|
||||
}
|
||||
|
||||
static map<string, CodecId, StrCaseCompare> codec_map = {
|
||||
{"H264", CodecH264},
|
||||
{"H265", CodecH265},
|
||||
{"mpeg4-generic", CodecAAC},
|
||||
{"PCMA", CodecG711A},
|
||||
{"PCMU", CodecG711U},
|
||||
{"opus", CodecOpus},
|
||||
{"VP8", CodecVP8},
|
||||
{"VP9", CodecVP9},
|
||||
{"L16", CodecL16}
|
||||
};
|
||||
#define XX(name, type, value, str) {str, name},
|
||||
static map<string, CodecId, StrCaseCompare> codec_map = {CODEC_MAP(XX)};
|
||||
#undef XX
|
||||
|
||||
CodecId getCodecId(const string &str){
|
||||
auto it = codec_map.find(str);
|
||||
|
||||
Reference in New Issue
Block a user