
i
i
i
i
i
i
i
i
15.4. Video Sources 405
NULL, pDestFilter
). If the graph needs to use a compression filter
(i.e.,
pCompress), the whole chain can be established in one call using
the last three arguments (pSrcFilter, pCompress, pDestFilter).
2.
FindCaptureDevice(). This is the most important function, and its
code is given in Listing 15.8.
HRESULT FindCaptureDevice(IBaseFilter
**
ppSrcFilter){
HRESULT hr;
IBaseFilter
*
pSrc = NULL;
CComPtr <IMoniker> pMoniker =NULL;
ULONG cFetched;
// Create the system device enumerator
CComPtr <ICreateDevEnum> pDevEnum =NULL;
hr = CoCreateInstance (CLSID_SystemDeviceEnum,NULL,CLSCTX_INPROC,
IID_ICreateDevEnum,(void
**
)&pDevEnum);
// Create ...