This commit is contained in:
xiongziliang
2020-04-18 18:46:20 +08:00
parent 1f43359b31
commit 5c3418a412
21 changed files with 277 additions and 364 deletions

View File

@@ -102,10 +102,12 @@ void AACRtmpEncoder::inputFrame(const Frame::Ptr &frame) {
RtmpPacket::Ptr rtmpPkt = ResourcePoolHelper<RtmpPacket>::obtainObj();
rtmpPkt->strBuf.clear();
//////////header
//header
uint8_t is_config = false;
rtmpPkt->strBuf.push_back(_ui8AudioFlags);
rtmpPkt->strBuf.push_back(!is_config);
//aac data
rtmpPkt->strBuf.append(frame->data() + frame->prefixSize(), frame->size() - frame->prefixSize());
rtmpPkt->bodySize = rtmpPkt->strBuf.size();
@@ -150,10 +152,11 @@ void AACRtmpEncoder::makeAudioConfigPkt() {
RtmpPacket::Ptr rtmpPkt = ResourcePoolHelper<RtmpPacket>::obtainObj();
rtmpPkt->strBuf.clear();
//////////header
//header
uint8_t is_config = true;
rtmpPkt->strBuf.push_back(_ui8AudioFlags);
rtmpPkt->strBuf.push_back(!is_config);
//aac config
rtmpPkt->strBuf.append(_aac_cfg);
rtmpPkt->bodySize = rtmpPkt->strBuf.size();