mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 14:45:55 +08:00
内部生成时间戳
This commit is contained in:
parent
28cc1433e5
commit
3726721dd9
@ -117,6 +117,9 @@ void DevChannel::inputH264(char* pcData, int iDataLen, uint32_t uiStamp) {
|
||||
if (memcmp("\x00\x00\x01", pcData, 3) == 0) {
|
||||
iOffset = 3;
|
||||
}
|
||||
if(uiStamp == 0){
|
||||
uiStamp = (uint32_t)m_aTicker[0].elapsedTime();
|
||||
}
|
||||
m_pRtpMaker_h264->makeRtp(pcData + iOffset, iDataLen - iOffset, uiStamp);
|
||||
}
|
||||
|
||||
@ -136,6 +139,9 @@ void DevChannel::inputAAC(char *pcDataWithoutAdts,int iDataLen, uint32_t uiStamp
|
||||
if (!m_bSdp_gotAAC && m_audio && pcAdtsHeader) {
|
||||
makeSDP_AAC((unsigned char*) pcAdtsHeader);
|
||||
}
|
||||
if(uiStamp == 0){
|
||||
uiStamp = (uint32_t)m_aTicker[1].elapsedTime();
|
||||
}
|
||||
if(pcDataWithoutAdts && iDataLen){
|
||||
m_pRtpMaker_aac->makeRtp(pcDataWithoutAdts, iDataLen, uiStamp);
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "RTP/RtpMakerAAC.h"
|
||||
#include "RTP/RtpMakerH264.h"
|
||||
#include "Rtsp/RtspToRtmpMediaSource.h"
|
||||
#include "Util/TimeTicker.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace ZL::Rtsp;
|
||||
@ -115,6 +116,7 @@ private:
|
||||
unsigned int m_uiPPSLen = 0;
|
||||
std::shared_ptr<VideoInfo> m_video;
|
||||
std::shared_ptr<AudioInfo> m_audio;
|
||||
SmoothTicker m_aTicker[2];
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user