mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-05 02:38:10 +08:00
整理代码
This commit is contained in:
@@ -8,30 +8,44 @@
|
||||
|
||||
#include "RtpCodec.h"
|
||||
|
||||
class AACRtpCodec : public RtpEncoder {
|
||||
class AACRtpDecoder : public RtpCodec {
|
||||
public:
|
||||
AACRtpCodec(uint32_t ui32Ssrc,
|
||||
uint32_t ui32MtuSize ,
|
||||
uint32_t ui32SampleRate,
|
||||
uint8_t ui8PlayloadType = 97,
|
||||
uint8_t ui8Interleaved = TrackAudio * 2) :
|
||||
RtpEncoder(ui32Ssrc,ui32MtuSize,ui32SampleRate,ui8PlayloadType,ui8Interleaved) {
|
||||
AACRtpDecoder() {
|
||||
m_framePool.setSize(32);
|
||||
m_adts = m_framePool.obtain();
|
||||
}
|
||||
~AACRtpCodec(){}
|
||||
|
||||
void inputFame(const Frame::Ptr &frame,bool key_pos) override;
|
||||
void inputRtp(const RtpPacket::Ptr &rtp, bool key_pos) override ;
|
||||
~AACRtpDecoder() {}
|
||||
|
||||
void inputRtp(const RtpPacket::Ptr &rtp, bool key_pos) override;
|
||||
|
||||
private:
|
||||
void makeAACRtp(const void *pData, unsigned int uiLen, bool bMark, uint32_t uiStamp);
|
||||
void onGetAdts(const AdtsFrame::Ptr &frame);
|
||||
|
||||
private:
|
||||
unsigned char m_aucSectionBuf[1600];
|
||||
AdtsFrame::Ptr m_adts;
|
||||
ResourcePool<AdtsFrame> m_framePool;
|
||||
};
|
||||
|
||||
|
||||
class AACRtpEncoder : public RtpInfo, public RtpCodec {
|
||||
public:
|
||||
AACRtpEncoder(uint32_t ui32Ssrc,
|
||||
uint32_t ui32MtuSize,
|
||||
uint32_t ui32SampleRate,
|
||||
uint8_t ui8PlayloadType = 97,
|
||||
uint8_t ui8Interleaved = TrackAudio * 2);
|
||||
|
||||
~AACRtpEncoder() {}
|
||||
|
||||
void inputFame(const Frame::Ptr &frame, bool key_pos) override;
|
||||
|
||||
private:
|
||||
void makeAACRtp(const void *pData, unsigned int uiLen, bool bMark, uint32_t uiStamp);
|
||||
|
||||
private:
|
||||
unsigned char m_aucSectionBuf[1600];
|
||||
};
|
||||
|
||||
|
||||
#endif //ZLMEDIAKIT_AACRTPCODEC_H
|
||||
|
||||
Reference in New Issue
Block a user