Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Blackmagic Design push source rate

  • push source rate

    Posted by Hung Han on October 15, 2010 at 7:48 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

    Hung Han replied 15 years, 9 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy