mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-25 03:02:22 +08:00
优化函数命名
isCfgFrame -> isConfigFrame getAacCfg -> getConfig
This commit is contained in:
@@ -246,7 +246,7 @@ AACTrack::AACTrack(const string &aac_cfg) {
|
||||
onReady();
|
||||
}
|
||||
|
||||
const string &AACTrack::getAacCfg() const {
|
||||
const string &AACTrack::getConfig() const {
|
||||
return _cfg;
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ Sdp::Ptr AACTrack::getSdp() {
|
||||
WarnL << getCodecName() << " Track未准备好";
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_shared<AACSdp>(getAacCfg(), getAudioSampleRate(), getAudioChannel(), getBitRate() / 1024);
|
||||
return std::make_shared<AACSdp>(getConfig(), getAudioSampleRate(), getAudioChannel(), getBitRate() / 1024);
|
||||
}
|
||||
|
||||
}//namespace mediakit
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
/**
|
||||
* 获取aac 配置信息
|
||||
*/
|
||||
const std::string &getAacCfg() const;
|
||||
const std::string &getConfig() const;
|
||||
|
||||
bool ready() override;
|
||||
CodecId getCodecId() const override;
|
||||
|
||||
@@ -16,7 +16,7 @@ using namespace toolkit;
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
static string getAacCfg(const RtmpPacket &thiz) {
|
||||
static string getConfig(const RtmpPacket &thiz) {
|
||||
string ret;
|
||||
if ((RtmpAudioCodec)thiz.getRtmpCodecId() != RtmpAudioCodec::aac) {
|
||||
return ret;
|
||||
@@ -30,8 +30,8 @@ static string getAacCfg(const RtmpPacket &thiz) {
|
||||
}
|
||||
|
||||
void AACRtmpDecoder::inputRtmp(const RtmpPacket::Ptr &pkt) {
|
||||
if (pkt->isCfgFrame()) {
|
||||
_aac_cfg = getAacCfg(*pkt);
|
||||
if (pkt->isConfigFrame()) {
|
||||
_aac_cfg = getConfig(*pkt);
|
||||
if (!_aac_cfg.empty()) {
|
||||
onGetAAC(nullptr, 0, 0);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ AACRtmpEncoder::AACRtmpEncoder(const Track::Ptr &track) {
|
||||
void AACRtmpEncoder::makeConfigPacket() {
|
||||
if (_track && _track->ready()) {
|
||||
//从track中和获取aac配置信息
|
||||
_aac_cfg = _track->getAacCfg();
|
||||
_aac_cfg = _track->getConfig();
|
||||
}
|
||||
|
||||
if (!_aac_cfg.empty()) {
|
||||
|
||||
@@ -64,7 +64,7 @@ AACRtpDecoder::AACRtpDecoder(const Track::Ptr &track) {
|
||||
if (!aacTrack || !aacTrack->ready()) {
|
||||
WarnL << "该aac track无效!";
|
||||
} else {
|
||||
_aac_cfg = aacTrack->getAacCfg();
|
||||
_aac_cfg = aacTrack->getConfig();
|
||||
}
|
||||
obtainFrame();
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ static bool getH264Config(const RtmpPacket &thiz, string &sps, string &pps) {
|
||||
}
|
||||
|
||||
void H264RtmpDecoder::inputRtmp(const RtmpPacket::Ptr &pkt) {
|
||||
if (pkt->isCfgFrame()) {
|
||||
if (pkt->isConfigFrame()) {
|
||||
//缓存sps pps,后续插入到I帧之前
|
||||
if (!getH264Config(*pkt, _sps, _pps)) {
|
||||
WarnL << "get h264 sps/pps failed, rtmp packet is: " << hexdump(pkt->data(), pkt->size());
|
||||
|
||||
@@ -124,7 +124,7 @@ void H265RtmpDecoder::inputRtmp(const RtmpPacket::Ptr &pkt) {
|
||||
}
|
||||
|
||||
// 国内扩展(12) H265 rtmp
|
||||
if (pkt->isCfgFrame()) {
|
||||
if (pkt->isConfigFrame()) {
|
||||
#ifdef ENABLE_MP4
|
||||
string config;
|
||||
if (getH265ConfigFrame(*pkt, config)) {
|
||||
|
||||
Reference in New Issue
Block a user