AACEncoder.h 1.02 KB
Newer Older
xiongziliang committed
1
/*
xiongziliang committed
2
 * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
xiongziliang committed
3
 *
4
 * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
xiongziliang committed
5
 *
xiongziliang committed
6 7 8
 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
xzl committed
9 10 11 12 13
 */

#ifndef CODEC_AACENCODER_H_
#define CODEC_AACENCODER_H_

xiongziliang committed
14
namespace mediakit {
xzl committed
15 16 17

class AACEncoder {
public:
18 19 20 21
    AACEncoder(void);
    virtual ~AACEncoder(void);
    bool init(int iSampleRate, int iAudioChannel, int iAudioSampleBit);
    int inputData(char *pcData, int iLen, unsigned char **ppucOutBuffer);
xzl committed
22 23

private:
24 25
    unsigned char *_pucPcmBuf = nullptr;
    unsigned int _uiPcmLen = 0;
xzl committed
26

27 28
    unsigned char *_pucAacBuf = nullptr;
    void *_hEncoder = nullptr;
xzl committed
29

30 31 32
    unsigned long _ulInputSamples = 0;
    unsigned long _ulMaxInputBytes = 0;
    unsigned long _ulMaxOutputBytes = 0;
xzl committed
33 34 35

};

xiongziliang committed
36
} /* namespace mediakit */
xzl committed
37 38

#endif /* CODEC_AACENCODER_H_ */