-
push source rate
Hi
I’m trying to paint on the PUSH SOURCE FILTER and i’m having a problem that i suspect it is the push source rate… do you know if i need to put a sleep in the loop? Because the output it is showing “t2-t1 = 0” frequently which does not make sense to me.
m_sResolution.width = 1920;
m_sResolution.height = 1080;
m_sResolution.bytes = 4; // ARGBBYTE* bmpBuffer=(BYTE*)GlobalAlloc(GPTR, uiDataSize);//allocate memory for image
DWORD t1, t2
HRESULT hr;while (true)
{
int i=0;
for (; i < m_sResolution.width*m_sResolution.height*m_sResolution.bytes; ++i)
{
bmpBuffer[i] = rand();
}t1 = GetTickCount();
IMediaSample* pSample = NULL;
hr = pIPushSourceVideo->GetFrameBuffer(&pSample);
if (hr == S_OK)
{
BYTE* pData = NULL;
hr = pSample->GetPointer(&pData);
if (hr == S_OK)
{
memcpy(pData, bmpBuffer, Width * Height * 4);
hr = pIPushSourceVideo->Deliver(pSample);
}
}t2 = GetTickCount();
printf("t2-t1 = %lu", t2-t1);
}GlobalFree(bmpBuffer);
Regards
Hung
Sorry, there were no replies found.