本文整理汇总了C++中COutBuffer::setSeqNo方法的典型用法代码示例。如果您正苦于以下问题:C++ COutBuffer::setSeqNo方法的具体用法?C++ COutBuffer::setSeqNo怎么用?C++ COutBuffer::setSeqNo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COutBuffer
的用法示例。
在下文中一共展示了COutBuffer::setSeqNo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildPacket
COutBuffer* COutBufPacket::buildPacket(unsigned char* pBuf,unsigned int nBufLen,unsigned char nRTPPayloadType
,unsigned int nTimestamp,bool isFirstPacket)
{
if(pBuf == NULL || nBufLen == 0 )
return NULL;
unsigned int nCopySize = 0;
COutBuffer * pOutBuf = getFreeOutBuffer(nBufLen);
if(pOutBuf)
{
m_IsFirstPacket = isFirstPacket;
// Set up the RTP header:
unsigned rtpHdr = 0x80000000; // RTP version 2
rtpHdr |= (nRTPPayloadType<<16);
if(nRTPPayloadType == 0)
{
unsigned short nSeqNo = m_nSeqNo++;
pOutBuf->setSeqNo(nSeqNo);
rtpHdr |= nSeqNo; // sequence number
}
else
{
rtpHdr |= 0;
}
pOutBuf->enqueueWord(rtpHdr);
m_nTimestampPosition = pOutBuf->curPacketSize();
pOutBuf->skipBytes(4);
pOutBuf->enqueueWord(m_nSSRC);
// RTP header:
//m_nSpecialHeaderPosition = pOutBuf->curPacketSize();
//m_nSpecialHeaderSize = specialHeaderSize();
//pOutBuf->skipBytes(m_nSpecialHeaderSize);
//m_nTotalFrameSpecificHeaderSizes = 0;
if(pOutBuf->wouldOverflow(nBufLen))
{
pOutBuf->enqueue(pBuf, nBufLen);
setMarkerBit(pOutBuf);
pOutBuf->insertWord(nTimestamp, m_nTimestampPosition);
return pOutBuf;
}
else
{
PutFreeOutBuffer(pOutBuf);
pOutBuf = NULL;
}
}
return NULL;
}