Поделиться через


IWMCodecInfo3::GetCodecFormatProp 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 GetCodecFormatProp method retrieves a property from one format of a codec.

Syntax

HRESULT GetCodecFormatProp(
  [in]      REFGUID           guidType,
  [in]      DWORD             dwCodecIndex,
  [in]      DWORD             dwFormatIndex,
  [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] dwFormatIndex

DWORD containing the format index ranging from zero to one less than the number of supported formats. To retrieve the number of individual formats supported by a codec, use the IWMCodecInfo::GetCodecFormatCount method.

[in] pszName

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

Currently only one codec format property is supported; it is listed in the following table. The format property determines the data type and value of the property; this information is included in the table.

Global constant Data type Description
g_wszSpeechCaps WMT_TYPE_DWORD The value is one from the WMT_MUSICSPEECH_CLASS_MODE enumeration type indicating the supported mode of the format. This property applies only to the Windows Media Audio 9 Voice codec.

[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 pointed to by 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 pointed to by 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 GetCodecFormatProp 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