Started here: How can I overlay timestamp on the image? on microsoft.public.win32.programmer.directx.video
Let us see if RGB conversion adds any noticeable effect on streaming YUY2 video, typical output of video decompressor.
As a reference I am taking a simple YUY2 source -> Video Mixing Render Filter (VMR) graph, where source filter streams the same pre-allocated and pre-initialized data in an infinite loop:
while(WaitForSingleObject(TerminationEvent, 0) == WAIT_TIMEOUT)
{
ATLENSURE_SUCCEEDED(m_pSourceFilter->InjectMediaSample(m_pnData, m_nDataSize));
CRoCriticalSectionLock DataLock(m_DataCriticalSection);
m_pnInjectedFrameCounts[0]++;
}
Video resolution is 640×480 pixels.
What is actually consuming CPU resources here is data copy into VMR’s media sample buffer and actually streaming. VMR might be blocking control waiting on rendering completion, I am leaving this for default VMR to decide (it might be hardware dependent etc).

Running at full pace, the application is rendering 510 frames per second consuming virtually no CPU. That is VMR is waiting until meida sample is rendered, this only allows streaming mentioned number of media samples per second, however rendering process does not take CPU resource, just waiting for video hardware to complete.
Continue Reading »