FORUMS: list search recent posts

push source rate

COW Forums : Blackmagic Design

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Hung Han
push source rate
on Oct 15, 2010 at 7:48:53 pm

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; // ARGB

BYTE* 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]