
Layout of the Registry Keys
The DLL that contains the filter is registered as the filter's COM server. When an application calls CoCreateInstance to create the filter, the Microsoft Windows COM library uses this registry entry to locate the DLL.
The registry entry for the DLL is as follows. See %_WINCEROOT%\Public\DirectX\Oak\Files\DirectX.reg for further examples.
DirectShow filter DLLs are registered by their class ID values. The complete registry entry for a DirectShow filter DLL begins with the HKEY_CLASSES_ROOT\CLSID\<Filter CLSID> key. The following table shows the values for this key.
| Value : type | Description |
| @ : REG_SZ | No default setting. The value of the <Filter CLSID> subkey is the friendly name of the filter. |
| Merit : REG_DWORD | Filter merit value. Filters with higher merit values are enumerated first. |
The registry key for the filter DLL's file is HKEY_CLASSES_ROOT\CLSID\<Filter CLSID>\InprocServer32. The following table shows the values for this key.
| Value : type | Description |
| @ : REG_SZ | No default setting. This is the file name of the filter DLL. |
| ThreadingModel : REG_SZ | You must set this value to "Both". |
Each filter pin is registered with its own registry key. The registry key for a pin is HKEY_CLASSES_ROOT\CLSID\<Filter CLSID>\Pins\<Pin Name>. Many filters just use a single input pin named "Input" and a single output pin named "Output". The following table shows the possible values for a filter pin subkey.
| Value : type | Description |
| Direction : REG_DWORD | No default setting. Set this value to 0 for input pins and 1 for output pins. |
| IsRendered : REG_DWORD | No default setting. Set this value to 0 if the pin renders its data and set to 1 if it does not. |
| AllowedZero : REG_DWORD | No default setting. Set this value to 0 if the filter requires this pin to be connected and set to 1 if it does not. |
| AllowedMany : REG_DWORD | No default setting. Set this value to 0 if the filter can only have a single pin of this type and set to 1 if it can have many pins of this type. |
| ConnectsToPin : REG_SZ | No default setting. Set this value to the name of the pin that this pin connects to. |
To register a media type and subtype that a pin supports, create the registry key HKEY_CLASSES_ROOT\CLSID\<Filter CLSID>\Pins\<Pin Name>\Types\{<Major type GUID>}\{<Subtype GUID>}. Use a subtype GUID of 00000000-0000-0000-0000-000000000000 (GUID_NULL) to indicate that the pin can be queried to accept connections with any subtype within the major type. A pin can have multiple entries for the Types subkey and a filter can have multiple pins.
The graph builder tries to assemble the correct filters to play back a specified source media during the intelligent connect process in the IGraphBuilder::RenderFile method. For more information, see Graph Building with Intelligent Connect. The graph builder enumerates the filter CLSIDs listed under the HKEY_CLASSES_ROOT\Filter\<Filter CLSID> registry key to find candidates for the filter graph. The following table shows the allowable values for this key.
| Value : type | Description |
| @ : REG_SZ | No default setting. The value of the <Filter CLSID> subkey is the friendly name of the filter. |
The HKEY_CLASSES_ROOT\CLSID\<Filter CLSID> registry key and subkeys are required to expose your filter to DirectShow and therefore make it available to applications through COM interfaces. The HKEY_CLASSES_ROOT\Filter\<Filter CLSID> is only required if you want to make your filter to be discoverable by the intelligent connect process.
The following example shows a filter graph registry entry from DirectX.reg.
; DV Video Codec
[HKEY_CLASSES_ROOT\Filter\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}]
@="DV Video Decoder"
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}]
@="DV Video Decoder"
"Merit"=dword:00600000
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\InprocServer32]
@="quartz.DLL"
"ThreadingModel"="Both"
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins]
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins\Input]
"Direction"=dword:00000000
"IsRendered"=dword:00000000
"AllowedZero"=dword:00000000
"AllowedMany"=dword:00000000
"ConnectsToPin"="Output"
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins\Input\Types]
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins\Input\Types\{73646976-0000-0010-8000-00AA00389B71}]
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins\Input\Types\{73646976-0000-0010-8000-00AA00389B71}\]
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins\Input\Types\{73646976-0000-0010-8000-00AA00389B71}\{00000000-0000-0000-0000-000000000000}]
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins\Output]
"Direction"=dword:00000001
"IsRendered"=dword:00000000
"AllowedZero"=dword:00000000
"AllowedMany"=dword:00000000
"ConnectsToPin"="Input"
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins\Output\Types]
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins\Output\Types\{73646976-0000-0010-8000-00AA00389B71}]
[HKEY_CLASSES_ROOT\CLSID\{B1B77C00-C3E4-11cf-AF79-00AA00B67A42}\Pins\Output\Types\{73646976-0000-0010-8000-00AA00389B71}\{00000000-0000-0000-0000-000000000000}]