If the source has a preview pin you can just render it using
ICaptureGraphBuilder::RenderStream. Not all video sources have a preview
pin. If they don't you can use a Smart Tee filter in your graph to
implement a preview. The DVapp sample shows use of the Smart Tee.
> Overlay - To set overlay mode
There is a sample filter called OvTool on http://www.gdcl.co.uk. As noted
in the docs for the Ovleray Mixer, the VMR9 is now the preferred except if
you need VPE:
http://msdn.microsoft.com/library/en-us/multimed/htm/_win32_video_capture.3a_.a_minimal_approach.asp
Basically you accomplish task with few lines of code (the example provided
is not in C or any language, is just a pseudocode):
hwndC = capCreateCaptureWindow("Video Capture", _Or(WS_CHILD,WS_VISIBLE,
WS_DLGFRAME),0,0,640,480, WindowPTR,7777) // WindowPTR = owner or parent of
the capture window
SendMessage( hwndC, WM_CAP_DRIVER_CONNECT, wIndex, 0L ) // WIndex: Capture
Device 0->9
// check if device is able to use overlay
// use SendMessage( Self:pCap, WM_CAP_DRIVER_GET_CAPS, nSize, oCaps )
// where oCaps is a pointer to the structure CAPDRIVERCAPS and nsize is the
size of the pointer
// If oCaps.fHasOverlay
SendMessage( hwndC, WM_CAP_SET_OVERLAY, 1, 0L ) > 0
//Else
// if not overlay is possible then do normal preview using the next two
lines
SendMessage(hwndC,WM_CAP_SET_PREVIEWRATE,15,0L) //Frame display rate en
milisegundos
SendMessage (hwndC, WM_CAP_SET_PREVIEW, 0, 0L)
//Endif
Regards
HPeter