IWMSyncReader::GetOutputSetting 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 GetOutputSetting method retrieves a setting for a particular output by name.

Syntax

HRESULT GetOutputSetting(
  [in]      DWORD             dwOutputNum,
  [in]      LPCWSTR           pszName,
  [out]     WMT_ATTR_DATATYPE *pType,
  [out]     BYTE              *pValue,
  [in, out] WORD              *pcbLength
);

Parameters

[in] dwOutputNum

DWORD containing the output number.

[in] pszName

Pointer to a wide-character null-terminated string containing the name of the setting for which you want the value. For a list of global constants representing setting names, see Output Settings.

[out] pType

Pointer to a variable that receives one value from the WMT_ATTR_DATATYPE enumeration type. The value received specifies the type of data in pValue.

[out] pValue

Pointer to a byte buffer containing the value. Pass NULL to retrieve the length of the buffer required.

[in, out] pcbLength

On input, pointer to a variable containing the length of pValue. On output, the variable contains the number of bytes in pValue used.

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
dwOutputNum specifies an invalid output number.

OR

pszName or pType or pcbLength is NULL.

OR

pszName specifies an invalid setting name.

E_UNEXPECTED
No file is open in the synchronous reader.
ASF_E_BUFFERTOOSMALL
The buffer size passed as pcbLength is not large enough to contain the setting value.
NS_E_INVALID_REQUEST
pszName specifies an unsupported setting.

Remarks

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

If you pass a buffer as pValue that is not large enough to contain the data, an error code of ASF_E_BUFFERTOOSMALL is returned. When returning this error code, the method still sets the value of pcbLength to the correct size of the value.

Requirements

   
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

IWMSyncReader Interface

IWMSyncReader::SetOutputSetting