Muokkaa

Jaa


Encoder Installation and Registration

The INF file for a driver with an encoder filter must contain entries that define the following:

  • Additional kernel streaming capture components

  • Which COM interface KsProxy should expose

  • Metadata values that describe the encoder filter's capabilities

  • The filter's kernel streaming category

Additional Kernel Streaming Capture Components

The INF file used to install the driver for an encoder device must reference ks.inf and kscaptur.inf in its [DefaultInstall] section as capture drivers because these files add necessary support for encoder components. For example:

[DefaultInstall]
include=ks.inf,kscaptur.inf
needs=[Your driver's DDInstall section],KS.Registration,KSCAPTUR.Registration.NT

Which COM Interface KsProxy Should Expose

In the AddReg section of your driver's INF file, specify one of the following three GUIDs to indicate the COM interface that the KsProxy plug-in (encapi.dll) should expose to clients. The COM interface is determined by the property support you implemented in the encoder filter:

Interface GUID Name Description

{B43C4EEC-8C32-4791-9102-508ADA5EE8E7}

CLSID_IVideoEncoderProxy

Specify this GUID to cause KsProxy to expose the IVideoEncoder COM interface (for backward compatibility with the older generation of encoder support provided by Microsoft). Clients must derive this interface from the IEncoderAPI COM interface.

{7FF0997A-1999-4286-A73C-622B8814E7EB}

CLSID_ICodecAPIProxy

Specify this GUID to cause KsProxy to expose the ICodecAPI COM interface (for non-video encoding devices such as audio-only encoders).

{B05DABD9-56E5-4FDC-AFA4-8A47E91F1C9C}

CLSID_IVideoEncoderCodecAPIProxy

Specify this GUID to cause KsProxy to expose both the IVideoEncoder and ICodecAPI COM interfaces (for backward and forward compatibility).

For example:

[Your driver's AddReg section]
HKR,Interfaces\{B43C4EEC-8C32-4791-9102-508ADA5EE8E7},,,

This would cause KsProxy to expose only the IVideoEncoder (CLSID_IVideoEncoderProxy) COM interface.

These COM interfaces are documented in the DirectShow section of the DirectX 9 and Windows SDKs for Windows XP with SP1 and later.

Metadata Values That Advertise the Encoder Filter's Capabilities

You can specify metadata values in the Device Parameters\Capabilities area of the registry in the encoder's INF file. Applications can use these metadata values to determine what functionality to implement or expose to the user.

For example:

[Your driver's AddReg section]
HKR,Capabilities,,,
HKR,Capabilities,"{12345678-1234-1234-1234-12345678abcd}",,guid1

This would create a metadata item "{12345678-1234-1234-1234-12345678abcd} = guid1" in the Device Parameters\Capabilities area of the encoder's registry settings. The empty line is necessary to create the registry key if it does not already exist.

An encoder filter may specify such static metadata in its INF file for use by applications. For example, Windows XP Media Center Edition checks for encoders that indicate that they are Windows XP Media Center Edition-compliant.

The Filter's Kernel Streaming Category

Kernel streaming filters must specify the kernel streaming category to which they belong. Microsoft defines GUIDs for common categories, including encoder filters and multiplexer (mux) filters.

Filters indicate their respective categories by specifying one or more of the following GUIDs in an AddInterface directive of the filter's section of its minidriver's INF file:

Kernel streaming category GUID Name Description

{19689BF6-C384-48FD-AD51-90E58C79F70B}

KSCATEGORY_ENCODER

Specify this GUID for encoder filters.

{7A5DE1D3-01A1-452C-B481-4FA2B96271E8}

KSCATEGORY_MULTIPLEXER

Specify this GUID for mux filters.

To register an encoder filter, specify the KSCATEGORY_ENCODER GUID in your driver's DDInstall.Interface INF file section. For example:

[Your Driver's DDInstall.Interface section]
AddInterface=%KSCATEGORY_ENCODER%,%KSNAME_Filter%,MyEncoderDevice.AddInterface

[MyEncoderDevice.AddInterface]
AddReg=MyEncoderDevice.AddReg

[MyEncoderDevice.AddReg]
HKR,,CLSID,,%KSProxy.CLSID%
HKR,,FriendlyName,,%MyEncoderDeviceFriendlyName%

[Strings]
KSCATEGORY_ENCODER="{19689BF6-C384-48FD-AD51-90E58C79F70B}"
KSNAME_Filter="{9B365890-165F-11D0-A195-0020AFD156E4}"
KSProxy.CLSID="17CCA71B-ECD7-11D0-B908-00A0C9223196"
MyEncoderDeviceFriendlyName="My Encoder Device"

Note: The GUID specified for KSNAME_Filter must match the ReferenceGuid member you specified in the KSFILTER_DESCRIPTOR structure that describes your filter.