本文整理汇总了C++中CBuffer::Data方法的典型用法代码示例。如果您正苦于以下问题:C++ CBuffer::Data方法的具体用法?C++ CBuffer::Data怎么用?C++ CBuffer::Data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBuffer
的用法示例。
在下文中一共展示了CBuffer::Data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadStringWithDecompress
void CUdpBizPacket::ReadStringWithDecompress(string& str)
{
CBuffer Buffer;
str.clear();
ReadBlob(Buffer);
if (Buffer.GetSize() > 0)
{
if (ZlibUncompress(Buffer))
str.assign(Buffer.Data(), Buffer.GetSize());
}
}
示例2: FillBuffer
//.........这里部分代码省略.........
}
pSample->SetDiscontinuity(TRUE);
m_bDiscontinuity=FALSE;
}
//LogDebug("vidPin: video buffer type = %d", buffer->GetVideoServiceType());
if (HasTimestamp)
{
//now we have the final timestamp, set timestamp in sample
REFERENCE_TIME refTime=(REFERENCE_TIME)cRefTime;
pSample->SetSyncPoint(TRUE);
bool stsDiscon = TimestampDisconChecker(refTime); //Update with current timestamp
refTime = (REFERENCE_TIME)((double)refTime/m_dRateSeeking);
pSample->SetTime(&refTime,&refTime);
if (m_pTsReaderFilter->m_bFastSyncFFDShow && (m_dRateSeeking == 1.0))
{
if (stsDiscon || (pSample->IsDiscontinuity()==S_OK))
{
pSample->SetDiscontinuity(TRUE);
m_delayedDiscont = 2;
}
if ((m_delayedDiscont > 0) && (buffer->GetFrameType() == 'I'))
{
if ((buffer->GetVideoServiceType() == SERVICE_TYPE_VIDEO_MPEG1 ||
buffer->GetVideoServiceType() == SERVICE_TYPE_VIDEO_MPEG2))
{
//Use delayed discontinuity
pSample->SetDiscontinuity(TRUE);
m_delayedDiscont--;
LogDebug("vidPin:set I-frame discontinuity, count %d", m_delayedDiscont);
}
else
{
m_delayedDiscont = 0;
}
}
}
if (m_pTsReaderFilter->m_ShowBufferVideo || ((fTime < 0.02) && (m_dRateSeeking == 1.0)) || (m_sampleCount < 3))
{
int cntA, cntV;
CRefTime firstAudio, lastAudio;
CRefTime firstVideo, lastVideo, zeroVideo;
cntA = demux.GetAudioBufferPts(firstAudio, lastAudio);
cntV = demux.GetVideoBufferPts(firstVideo, lastVideo, zeroVideo);
LogDebug("Vid/Ref : %03.3f, %c-frame(%02d), Compensated = %03.3f ( %0.3f A/V buffers=%02d/%02d), Clk : %f, SampCnt %d, stallPt %03.3f", (float)RefTime.Millisecs()/1000.0f,buffer->GetFrameType(),buffer->GetFrameCount(), (float)cRefTime.Millisecs()/1000.0f, fTime, cntA,cntV,clock, m_sampleCount, (float)stallPoint);
}
if (m_pTsReaderFilter->m_ShowBufferVideo) m_pTsReaderFilter->m_ShowBufferVideo--;
}
else
{
//buffer has no timestamp
pSample->SetTime(NULL,NULL);
pSample->SetSyncPoint(FALSE);
}
// copy buffer into the sample
BYTE* pSampleBuffer;
pSample->SetActualDataLength(buffer->Length());
pSample->GetPointer(&pSampleBuffer);
memcpy(pSampleBuffer,buffer->Data(),buffer->Length());
// delete the buffer
delete buffer;
demux.EraseVideoBuff();
//m_sampleCount++ ;
}
else
{ // Buffer was not displayed because it was out of date, search for next.
delete buffer;
demux.EraseVideoBuff();
m_bDiscontinuity = TRUE; //Next good sample will be discontinuous
buffer = NULL;
m_FillBuffSleepTime = 1;
}
}
earlyStall = false;
} while (buffer == NULL);
m_bInFillBuffer = false;
return NOERROR;
}
catch(...)
{
LogDebug("vidPin:fillbuffer exception");
}
m_FillBuffSleepTime = 5;
CreateEmptySample(pSample);
m_bDiscontinuity = TRUE; //Next good sample will be discontinuous
m_bInFillBuffer = false;
return NOERROR;
}