RtpMakerAAC.h 1.01 KB
Newer Older
xzl committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
/*
 * RtpMakerAAC.h
 *
 *  Created on: 2016年8月12日
 *      Author: xzl
 */

#ifndef RTP_RTPMAKERAAC_H_
#define RTP_RTPMAKERAAC_H_
#include "Rtsp/RtspMediaSource.h"
#include "Util/logger.h"
#include "Util/RingBuffer.hpp"
#include "RtpMaker.h"
#include <memory>
#include "Util/ResourcePool.h"
using namespace std;

using namespace ZL::Util;

namespace ZL {
namespace Rtsp {

class RtpMaker_AAC: public RtpMaker {
public:
	typedef std::shared_ptr<RtpMaker_AAC> Ptr;
	RtpMaker_AAC(const onGetRTP &cb,
			uint32_t ui32Ssrc, int iMtuSize , int iSampleRate, uint8_t ui8PlayloadType = 97,
			uint8_t ui8Interleaved = 2) :
			RtpMaker(cb, ui32Ssrc, iMtuSize,iSampleRate, ui8PlayloadType, ui8Interleaved) {
	}
	virtual ~RtpMaker_AAC() {
	}
	void makeRtp(const char *pcData, int iDataLen, uint32_t uiStamp) override;
private:
	inline void makeAACRtp(const void *pData, unsigned int uiLen, bool bMark, uint32_t uiStamp);
	unsigned char m_aucSectionBuf[1600];
};

} /* namespace RTP */
} /* namespace ZL */

#endif /* RTP_RTPMAKERAAC_H_ */