Freigeben über


IWMCodecInfo3::GetCodecProp method (wmsdkidl.h)

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The GetCodecProp method retrieves a codec property.

Syntax

HRESULT GetCodecProp(
  [in]      REFGUID           guidType,
  [in]      DWORD             dwCodecIndex,
  [in]      LPCWSTR           pszName,
  [out]     WMT_ATTR_DATATYPE *pType,
  [out]     BYTE              *pValue,
  [in, out] DWORD             *pdwSize
);

Parameters

[in] guidType

GUID identifying the major type of digital media. This must be one of the following constants.

Constant Description
WMMEDIATYPE_Video Specifies a video codec.
WMMEDIATYPE_Audio Specifies an audio codec.

[in] dwCodecIndex

DWORD containing the codec index ranging from zero to one less than the number of supported codecs of the type specified by guidType. To retrieve the number of individual codecs supporting a major type, use the IWMCodecInfo::GetCodecInfoCount method.

[in] pszName

Pointer to a null-terminated string containing the name of the property to retrieve.

The following table lists the codec properties you can retrieve. The property dictates the data type and value; this information is also included in the table.

Global constant Data type Description
g_wszComplexityMax WMT_TYPE_DWORD The value is the maximum complexity value for the codec. Codec complexity applies only to video codecs. The range of complexity values is from 0 to this value.
g_wszComplexityOffline WMT_TYPE_DWORD The value is the suggested complexity value for the codec when encoding files for local playback. Codec complexity applies only to video codecs. The range of complexity values is from 0 to the value retrieved with g_wszComplexityMax.
g_wszComplexityLive WMT_TYPE_DWORD The value is the suggested complexity value for the codec when encoding files for streaming playback. Codec complexity applies only to video codecs. The range of complexity values is from 0 to the value retrieved with g_wszComplexityMax.
g_wszIsVBRSupported WMT_TYPE_BOOL The value indicates whether the codec supports VBR.

[out] pType

Pointer to a variable that will receive a member of the WMT_ATTR_DATATYPE enumeration type. This value specifies the type of information returned to the buffer at pValue.

[out] pValue

Pointer to a buffer that will receive the value of the property. The data returned is of a type specified by pType.

[in, out] pdwSize

Pointer to a DWORD value specifying the length of the buffer at pValue.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
E_INVALIDARG
pszName or pType or pdwSize is NULL.

OR

guidType specifies an invalid input type.

OR

pszName specifies an invalid property name.

Remarks

You should make two calls to GetCodecProp for each property you want to retrieve. On the first call, pass NULL as pValue. On return, the value of pdwSize will be set to the buffer size required to hold the value of the specified property. Then you can allocate the required amount of memory for the buffer and pass a pointer to it as pValue on the second call.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only],Windows Media Format 9 Series SDK, or later versions of the SDK
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wmsdkidl.h (include Wmsdk.h)
Library Wmvcore.lib; WMStubDRM.lib (if you use DRM)

See also

IWMCodecInfo3 Interface