DirectShow on DirectX Surface

From: Austin Harvey (auz_at_splendid-software.co.uk)
Date: 12/08/04


Date: Wed, 8 Dec 2004 15:40:19 -0000

Ok an update to this,

I have a DDSCAPS_PRIMARYSURFACE (m_lpDDSFront->m_lpDDs), and a
DDSCAPS_OFFSCREENPLAIN background surface (m_lpDDSBack->m_lpDDs), all of my
graphics (boxes, buttons, images) are loaded into the background surface,
whenever a graphic is updated the following is called (Flip) ;

Flip()
{
RECT Window;
POINT pt;

GetClientRect((HWND)m_hWnd,&Window);
pt.x=0;
pt.y=0;
ClientToScreen((HWND)m_hWnd,&pt);
OffsetRect(&Window,pt.x,pt.y);
m_lpDDSFront->m_lpDDS->Blt(&Window,m_lpDDSBack->m_lpDDS,NULL,DDBLT_WAIT,NULL);
}

When creating the DirectShow graph (with capture filter) I add a VMR, then
call all the usual as follows ;

SetRenderingMode(VMRMode_Windowless);
SetVideoClippingWindow(m_hwnd);
SetVideoPosition(&rcSrc, &rcDest);

The graph is run and I display my screen, with graphics. The live video
displays fine until I do a 'Flip()' at which point the video turns black
then re-appears.

Should I create another surface for the video window, and use some of the
VMR functions to pass it the surfaces to use.

Thanks in advance.

Best Regards,

Austin.