MFGetAttributesAsBlob

Converts the contents of an attribute store to a byte array.

Syntax

HRESULT MFGetAttributesAsBlob(
         IMFAttributes *pAttributes,
         UINT8 *pBuf,
         UINT cbBufSize
)  

Parameters

pAttributes
Type: IMFAttributes *

[in]

Pointer to the IMFAttributes interface of the attribute store.

pBuf
Type: UINT8 *

[out]

Pointer to an array that receives the attribute data.

cbBufSize
Type: UINT 

[in]

Size of the pBuf array, in bytes. To get the required size of the buffer, call MFGetAttributesAsBlobSize.

Return value

Type: HRESULT 

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

Return codes
Return code Description
S_OK The function succeeded.
MF_E_BUFFERTOOSMALL The buffer given in pBuf is too small.

Refer to Media Foundation return codes.

Remarks

The function skips any attributes with IUnknown pointer values (MF_ATTRIBUTE_IUNKNOWN); they are not stored in the array.

To convert the byte array back into an attribute store, call MFInitAttributesFromBlob.

To write an attribute store to a stream, call the MFSerializeAttributesToStream function.

Requirements

Header: Declared in mfapi.h.

Library: Use mfplat.lib.