G711支持多种规格

This commit is contained in:
xiongziliang
2020-04-18 22:13:11 +08:00
parent 5c3418a412
commit bacf8f100b
17 changed files with 203 additions and 197 deletions

View File

@@ -196,7 +196,7 @@ void DevChannel::initAudio(const AudioInfo& info) {
}
case CodecG711A :
case CodecG711U : addTrack(std::make_shared<G711Track>(info.codecId)); break;
case CodecG711U : addTrack(std::make_shared<G711Track>(info.codecId, info.iSampleRate, info.iChannel, info.iSampleBit)); break;
default: WarnL << "不支持该类型的音频编码类型:" << info.codecId; break;
}
}

View File

@@ -42,8 +42,8 @@ void MediaSink::addTrack(const Track::Ptr &track_in) {
if (_allTrackReady) {
//运行至这里说明Track状态由未就绪切换为已就绪状态,那么这帧就不应该丢弃
onTrackFrame(frame);
} else {
ErrorL << "some track is unreadydrop frame of: " << frame->getCodecName();
} else if(frame->keyFrame()){
WarnL << "some track is unreadydrop key frame of: " << frame->getCodecName();
}
}));
}