I am using a source filter of a webcam. When I use the filter in graphstudio it has two output pins. However in code the call to IEnumPins->next always returns S_FALSE. I also l
This is an indication that your code deals with another filter or has bugs otherwise. You normally don't "create" pins, especially on video device backed source filter. Typical reasons are: (a) you are effectively creating a different filter, (b) direct bug in your code, (c) 32/64-bit issue with different filters in the two environments. There can hardly be anything else. Stepping and inspecting your code thoroughly, adding debug output should take you to the solution.
UPDATE. Video capture devices like this cannot be instantiated using CoCreateInstance
. You have to create them using monikers. typically through enumeration, as described on MSDN (with source code snippet): Selecting a Capture Device.
The code below is incorrect, FYI this GUID is declared in SDK as CLSID_Proxy
.
static const GUID CLSID_Webcam =
{ 0x17CCA71B, 0xECD7, 0x11D0, { 0xB9, 0x08, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 } };
hr = CoCreateInstance(CLSID_Webcam, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&source);