IWMDMDevice2::GetFormatSupport2 method (mswmdm.h)
The GetFormatSupport2 method retrieves the formats supported by the device, including audio and video codecs, and MIME file formats.
Syntax
HRESULT GetFormatSupport2(
[in] DWORD dwFlags,
[out] _WAVEFORMATEX **ppAudioFormatEx,
[out] UINT *pnAudioFormatCount,
[out] _VIDEOINFOHEADER **ppVideoFormatEx,
[out] UINT *pnVideoFormatCount,
[out] WMFILECAPABILITIES **ppFileType,
[out] UINT *pnFileTypeCount
);
Parameters
[in] dwFlags
DWORD specifying 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. |
[out] ppAudioFormatEx
Pointer to an array of _WAVEFORMATEX structures specifying information about audio codecs and bit rates supported by the device. The memory for this parameter is allocated by Windows Media Device Manager, and must be released by the caller with the Win32 function CoTaskMemFree.
[out] pnAudioFormatCount
Pointer to an integer specifying the audio format count.
[out] ppVideoFormatEx
Pointer to an array of _VIDEOFORMATEX structures specifying information about video codes and formats supported by the device. The memory for this parameter is allocated by Windows Media Device Manager, and must be released by the caller with the Win32 function CoTaskMemFree.
[out] pnVideoFormatCount
Pointer to an integer specifying the video format count.
[out] ppFileType
Pointer to an array of WMFILECAPABILITIES file-type objects. The memory for this parameter is allocated by Windows Media Device Manager, and must be released by the caller with the Win32 function CoTaskMemFree.
[out] pnFileTypeCount
Pointer to an integer specifying the file-type count.
Return value
The method returns an HRESULT. All the interface methods in Windows Media Device Manager 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
Remarks
This method extends IWMDMDevice::GetFormatSupport to handle video formats. The recommended method for getting format support, however, is IWMDMDevice3::GetFormatCapability. If GetFormatCapability isn't supported, the device will probably not support video, and GetFormatSupport is probably sufficient.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | mswmdm.h |
Library | Mssachlp.lib |