I am using the code to create a C# DirectShow push source filter from the following open source article, that builds a filter called VirtualCam:
http://www.codeproject.com/Articles/437617/DirectShow-Virtual-Video-Capture-Source-Filter-in
The GraphEdit utility can find it and shows it in the Video Capture Sources group with the name CSharp Virtual Camera, and I can build a filter graph with it and it works fine. Skype can find it too. However, all the other software I want to use it with can't find it because it does not show up in a device enumeration call when using VideoInputSource as the main group. I believe this is the class ID for that group:
/// <summary> CLSID_VideoInputDeviceCategory, video capture category </summary>
public static readonly Guid VideoInputDevice = new Guid(0x860BB310, 0x5D01, 0x11d0, 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86);
I got that class ID from an open source utility that scans for video input devices. It's one of the apps that can't find the VirtualCam filter either. These apps can only find devices like my web cam (in other words, VirtualCam does not show up in the available device list).
What do I need to do to the VirtualCam source code so that it declares/registers itself as a video input device and will show up in a device enumeration scan in the VideoInputDevice category so most software can see it and use it?
UPDATE: Upon closer inspection in GraphEdit the main difference I see between the VirtualCam filter that can't be found by most apps and the video capture devices that can be found is that the VirtualCam filter does not have any pins defined, while the other video capture devices do. If this is the problem, how should I define a pin properly that will allow VirtualCam to be discovered and will work properly to service the declared interface?
There is no subgroup, and the group is refered to as "category". Filters are registered into categories. The category of your interest here is CLSID_VideoInputDeviceCategory
also known as "Video Capture Sources".
From registration standpoint, the only issue I can think of is 32/64 bitness. Filters registered as 32-bit filters are not visible to 64-bit apps and vice versa. This might be tricky because your project is C# and you might have it built for AnyCPU
, however in any event you can use 32- and 64-bit GraphEdit (or rather GraphStudioNext) to make sure your filter is in the list. Presence in the list of filters ensures that registration step was passed.
From there on it is up to implementation of the application to show or not show specific video source. Some applications show every registered source, other like Skype attempt to instantiate source and do some initial check. If they don't like the source, it is removed from the list of choices.
The implementation requirements for the video source are not well defined, but most applications expect to get a filter compatible with WDM Video Capture Filter
. Better applications accept video source if SDK AmCap sample can preview it, worse implementations have other assumptions.
In general the video source MUST implement IBaseFilter
in the filter class, and IPin
, IAMStreamConfig
interfaces in the pins. It SHOULD implement IQualityControl
and IKsPropertySet
in pins as well. It would also be good to implement ISpecifyPropertyPages
as poor implementations also might expect it there (even if no pages are attached).