新增若干音视频编码类型的默认实现

部分支持VP8/VP9/AV1/JPEG/MP3/H266/ADPCM/SVAC/G722/G723/G729
This commit is contained in:
xia-chu
2024-11-29 23:38:27 +08:00
parent 87b42ab492
commit 892108d6ba
19 changed files with 202 additions and 266 deletions

View File

@@ -90,7 +90,8 @@ void DecoderImp::onStream(int stream, int codecid, const void *extra, size_t byt
}
// G711传统只支持 8000/1/16的规格FFmpeg貌似做了扩展但是这里不管它了 [AUTO-TRANSLATED:851813f7]
// G711 traditionally only supports the 8000/1/16 specification. FFmpeg seems to have extended it, but we'll ignore that here.
auto track = Factory::getTrackByCodecId(getCodecByMpegId(codecid), 8000, 1, 16);
auto codec = getCodecByMpegId(codecid);
auto track= Factory::getTrackByCodecId(codec);
if (track) {
onTrack(stream, std::move(track));
}
@@ -113,7 +114,7 @@ void DecoderImp::onDecode(int stream, int codecid, int flags, int64_t pts, int64
}
auto &ref = _tracks[stream];
if (!ref.first) {
onTrack(stream, Factory::getTrackByCodecId(codec, 8000, 1, 16));
onTrack(stream, Factory::getTrackByCodecId(codec));
}
if (!ref.first) {
WarnL << "Unsupported codec :" << getCodecName(codec);