ICodecAPI interface (strmif.h)
[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
The ICodecAPI interface sets and retrieves settings on an encoder or decoder filter.
Note
APIs declared in strmif.h are not supported for Universal Windows Platform (UWP) apps. To use ICodecAPI in a UWP app, use the version declared in icodecapi.h.
Inheritance
The ICodecAPI interface inherits from the IUnknown interface. ICodecAPI also has these types of members:
Methods
The ICodecAPI interface has these methods.
ICodecAPI::GetAllSettings The GetAllSettings method gets the codec's current properties and writes them to a stream. (ICodecAPI.GetAllSettings) |
ICodecAPI::GetDefaultValue The GetDefaultValue method gets the default value of a codec property. (ICodecAPI.GetDefaultValue) |
ICodecAPI::GetParameterRange The GetParameterRange method gets the range of values for a codec property. (ICodecAPI.GetParameterRange) |
ICodecAPI::GetParameterValues The GetParameterValues method gets the list of possible values for a codec property. (ICodecAPI.GetParameterValues) |
ICodecAPI::GetValue The GetValue method gets the current value of a codec property. |
ICodecAPI::IsModifiable The IsModifiable method queries whether a codec property can be changed, given the codec's current configuration. (ICodecAPI.IsModifiable) |
ICodecAPI::IsSupported The IsSupported method queries whether a codec supports a given property. (ICodecAPI.IsSupported) |
ICodecAPI::RegisterForEvent The RegisterForEvent method registers the application to receive events from the codec. (ICodecAPI.RegisterForEvent) |
ICodecAPI::SetAllDefaults The SetAllDefaults method resets all codec properties to their default values. (ICodecAPI.SetAllDefaults) |
ICodecAPI::SetAllDefaultsWithNotify The SetAllDefaultsWithNotify method resets all codec properties to their default values, and returns a list of the properties that changed. (ICodecAPI.SetAllDefaultsWithNotify) |
ICodecAPI::SetAllSettings The SetAllSettings method reads codec properties from a stream and sets them on the codec. (ICodecAPI.SetAllSettings) |
ICodecAPI::SetAllSettingsWithNotify The SetAllSettingsWithNotify method reads codec properties from a stream, sets them on the codec, and returns a list of the properties that changed. (ICodecAPI.SetAllSettingsWithNotify) |
ICodecAPI::SetValue The SetValue method sets the value of a codec property. (ICodecAPI.SetValue) |
ICodecAPI::SetValueWithNotify The SetValueWithNotify method sets a property on a codec and returns a list of other properties that changed as a result. (ICodecAPI.SetValueWithNotify) |
ICodecAPI::UnregisterForEvent The UnregisterForEvent method unregisters the application for a specified encoder event. (ICodecAPI.UnregisterForEvent) |
Remarks
This interface defines a generic mechanism for setting properties on a codec (encoder or decoder). A codec property is a key/value pair, where the key is a GUID and the value is a VARIANT. The interpretation of the VARIANT data depends on the property GUID. For a list of codec property GUIDs, see Codec API Properties.
Codec Profiles
Codecs can optionally store profile and capability information in the system registry. This information enables applications to query the device during device enumeration. Default profiles are stored in the following registry key:HKEY_LOCAL_MACHINE Software Classes CLSID Category ProfilesEach profile is a registry key whose default string is a text description of the profile. Each value has a GUID name, followed by a string value containing the numeric GUID value. For example:
C++ |
---|
HLKM\Software\Classes\CLSID\<category>\Profiles\DVD default "HQ DVD" REG_SZ {...} = "0" REG_SZ {...} = "1234" |
Default codec capabilities are stored under HLKM\Software\Classes\CLSID<category>\Instance<Filter CLSID>\Capabilities. Each value has a GUID name, followed by a string value containing the numeric GUID value. For example:
C++ |
---|
HLKM\Software\Classes\CLSID\<category>\Instance\<My DVD encoder>\Capabilities default "My DVD encoder" REG_SZ_MULTI {...} |
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP with SP2 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2003 R2 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | strmif.h (include Dshow.h) |