完善对高规格aac的支持

This commit is contained in:
xiongziliang
2020-06-11 19:21:46 +08:00
parent b9006a90d4
commit efa92752c7
6 changed files with 107 additions and 66 deletions

View File

@@ -17,9 +17,9 @@
namespace mediakit{
string makeAacConfig(const uint8_t *hex);
void dumpAacConfig(const string &config, int length, uint8_t *out);
void parseAacConfig(const string &config, int &samplerate, int &channels);
string makeAacConfig(const uint8_t *hex, int length);
int dumpAacConfig(const string &config, int length, uint8_t *out, int out_size);
bool parseAacConfig(const string &config, int &samplerate, int &channels);
/**
* aac帧包含adts头
@@ -137,9 +137,9 @@ public:
void inputFrame(const Frame::Ptr &frame) override{
if (_cfg.empty()) {
//未获取到aac_cfg信息
if (frame->prefixSize() >= ADTS_HEADER_LEN) {
if (frame->prefixSize()) {
//7个字节的adts头
_cfg = makeAacConfig((uint8_t *) (frame->data()));
_cfg = makeAacConfig((uint8_t *) (frame->data()), frame->prefixSize());
onReady();
} else {
WarnL << "无法获取adts头!";