IWMDMDevice2::GetFormatSupport2
The GetFormatSupport2 method retrieves the formats supported by a device, including audio and video codecs and MIME file formats.
Syntax
HRESULT GetFormatSupport2(
DWORD dwFlags,
_WAVEFORMATEX** ppAudioFormatEx,
UINT* pnAudioFormatCount,
_VIDEOINFOHEADER** ppVideoFormatEx,
UINT* pnVideoFormatCount,
WMFILECAPABILITIES** ppFileType,
UINT* pnFileTypeCount
);
Parameters
dwFlags
[in] DWORD containing audio formats, video formats, and MIME types. This flag specifies what the application is requesting the service provider to fill in. The caller can set one or more of the following three values.
Value | Description |
WMDM_GET_FORMAT_SUPPORT_AUDIO | Service provider should fill in audio parameters. |
WMDM_GET_FORMAT_SUPPORT_VIDEO | Service provider should fill in video parameters. |
WMDM_GET_FORMAT_SUPPORT_FILE | Service provider should fill in file parameters. |
ppAudioFormatEx
[out] Pointer to an array of _WAVEFORMATEX structures containing information about audio codecs and bit rates supported by the device.
pnAudioFormatCount
[out] Pointer to an integer containing the audio format count.
ppVideoFormatEx
[out] Pointer to an array of _VIDEOFORMATEX structures containing information about video codes and formats supported by the device.
pnVideoFormatCount
[out] Pointer to an integer containing the video format count.
ppFileType
[out] Pointer to an array of WMFILECAPABILITIES file-type objects.
pnFileTypeCount
[out] Pointer to an integer containing the file-type count.
Return Values
The method returns an HRESULT. All the interface methods in Windows Media Device Manager and service provider can return any of the following classes of error codes:
- Standard COM error codes
- Windows error codes converted to HRESULT values
- Windows Media Device Manager error codes
For a complete list of possible error codes, see Error Codes.
Possible values include, but are not limited to, those in the following table.
Return code | Description |
S_OK | The method succeeded. |
E_FAIL | An unspecified error occurred. |
Remarks
This method extends IWMDMDevice::GetFormatSupport to handle video formats. Memory for the ppFormat, ppwszMimeType, and ppFileType parameters ** is allocated by this method and must be freed by the caller using CoTaskMemFree, a standard Win32 function.
Requirements
Header: Defined in wmdm.idl.
Library: mssachlp.lib
See Also