新增加aac不带adts头输入接口

This commit is contained in:
xiongziliang 2017-08-24 09:54:25 +08:00
parent 965bc5d34f
commit a93628bd35
2 changed files with 7 additions and 4 deletions

View File

@ -108,6 +108,9 @@ void DevChannel::inputH264(char* pcData, int iDataLen, uint32_t uiStamp) {
} }
void DevChannel::inputAAC(char* pcData, int iDataLen, uint32_t uiStamp) { void DevChannel::inputAAC(char* pcData, int iDataLen, uint32_t uiStamp) {
inputAAC(pcData+7,iDataLen-7,uiStamp,pcData);
}
void DevChannel::inputAAC(char *pcDataWithoutAdts,int iDataLen, uint32_t uiStamp,char *pcAdtsHeader){
if (!m_pRtpMaker_aac) { if (!m_pRtpMaker_aac) {
uint32_t ssrc; uint32_t ssrc;
memcpy(&ssrc, makeRandStr(8, false).data() + 4, 4); memcpy(&ssrc, makeRandStr(8, false).data() + 4, 4);
@ -118,10 +121,9 @@ void DevChannel::inputAAC(char* pcData, int iDataLen, uint32_t uiStamp) {
m_pRtpMaker_aac.reset(new RtpMaker_AAC(lam, ssrc, audioMtu,m_audio->iSampleRate)); m_pRtpMaker_aac.reset(new RtpMaker_AAC(lam, ssrc, audioMtu,m_audio->iSampleRate));
} }
if (!m_bSdp_gotAAC && m_audio) { if (!m_bSdp_gotAAC && m_audio) {
makeSDP_AAC((unsigned char*) pcData, iDataLen); makeSDP_AAC((unsigned char*) pcAdtsHeader, iDataLen);
} }
m_pRtpMaker_aac->makeRtp(pcData + 7, iDataLen - 7, uiStamp); m_pRtpMaker_aac->makeRtp(pcDataWithoutAdts, iDataLen, uiStamp);
} }
inline void DevChannel::makeSDP_264(unsigned char *pcData, int iDataLen) { inline void DevChannel::makeSDP_264(unsigned char *pcData, int iDataLen) {

View File

@ -59,7 +59,8 @@ public:
void inputPCM(char *pcData, int iDataLen, uint32_t uiStamp); void inputPCM(char *pcData, int iDataLen, uint32_t uiStamp);
void inputH264(char *pcData, int iDataLen, uint32_t uiStamp); void inputH264(char *pcData, int iDataLen, uint32_t uiStamp);
void inputAAC(char *pcData, int iDataLen, uint32_t uiStamp); void inputAAC(char *pcDataWithAdts, int iDataLen, uint32_t uiStamp);
void inputAAC(char *pcDataWithoutAdts,int iDataLen, uint32_t uiStamp,char *pcAdtsHeader);
#ifdef ENABLE_RTSP2RTMP #ifdef ENABLE_RTSP2RTMP
int readerCount() { int readerCount() {
return m_mediaSrc ? m_mediaSrc->readerCount() : 0; return m_mediaSrc ? m_mediaSrc->readerCount() : 0;