mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-02 08:17:33 +08:00
优化函数命名
isCfgFrame -> isConfigFrame getAacCfg -> getConfig
This commit is contained in:
@@ -62,7 +62,7 @@ bool FlvPlayer::onRecvMetadata(const AMFValue &metadata) {
|
||||
}
|
||||
|
||||
void FlvPlayer::onRecvRtmpPacket(RtmpPacket::Ptr packet) {
|
||||
if (!_play_result && !packet->isCfgFrame()) {
|
||||
if (!_play_result && !packet->isConfigFrame()) {
|
||||
_play_result = true;
|
||||
onPlayResult(SockException(Err_success, "play http-flv success"));
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ bool RtmpPacket::isVideoKeyFrame() const {
|
||||
return frame_type == RtmpFrameType::key_frame;
|
||||
}
|
||||
|
||||
bool RtmpPacket::isCfgFrame() const {
|
||||
bool RtmpPacket::isConfigFrame() const {
|
||||
switch (type_id) {
|
||||
case MSG_AUDIO: {
|
||||
return (RtmpAudioCodec)getRtmpCodecId() == RtmpAudioCodec::aac && (RtmpAACPacketType)buffer[1] == RtmpAACPacketType::aac_config_header;
|
||||
|
||||
@@ -169,10 +169,15 @@ public:
|
||||
}
|
||||
|
||||
void clear();
|
||||
|
||||
// video config frame和key frame都返回true
|
||||
// 用于gop缓存定位
|
||||
bool isVideoKeyFrame() const;
|
||||
// aac config或h264/h265 config
|
||||
bool isCfgFrame() const;
|
||||
|
||||
// aac config或h264/h265 config返回true,支持增强型rtmp
|
||||
// 用于缓存解码配置信息
|
||||
bool isConfigFrame() const;
|
||||
|
||||
int getRtmpCodecId() const;
|
||||
int getAudioSampleRate() const;
|
||||
int getAudioSampleBit() const;
|
||||
|
||||
@@ -54,7 +54,7 @@ void RtmpMediaSource::onWrite(RtmpPacket::Ptr pkt, bool /*= true*/) {
|
||||
default: break;
|
||||
}
|
||||
|
||||
if (pkt->isCfgFrame()) {
|
||||
if (pkt->isConfigFrame()) {
|
||||
std::lock_guard<std::recursive_mutex> lock(_mtx);
|
||||
_config_frame_map[pkt->type_id] = pkt;
|
||||
if (!_ring) {
|
||||
|
||||
@@ -339,7 +339,7 @@ void RtmpPlayer::onMediaData_l(RtmpPacket::Ptr chunk_data) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (chunk_data->isCfgFrame()) {
|
||||
if (chunk_data->isConfigFrame()) {
|
||||
//输入配置帧以便初始化完成各个track
|
||||
onRtmpPacket(chunk_data);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user