IMFAttributes interface

Provides a generic way to store key/value pairs on an object. The keys are GUIDs, and the values can be any of the following data types: UINT32, UINT64, double, GUID, wide-character string, byte array, or IUnknown pointer. The standard implementation of this interface holds a thread lock while values are added, deleted, or retrieved.

For a list of predefined attribute GUIDs, see Media Foundation Attributes. Each attribute GUID has an expected data type. The various "set" methods in IMFAttributes do not validate the type against the attribute GUID. It is the application's responsibility to set the correct type for the attribute.

To create an empty attribute store, call MFCreateAttributes.

Methods

The IMFAttributes interface has these methods.

Method Description
IMFAttributes::Compare Compares the attributes on this object with the attributes on another object.
IMFAttributes::CompareItem Queries whether a stored attribute value equals to a specified PROPVARIANT.
IMFAttributes::CopyAllItems Copies all of the attributes from this object into another attribute store.
IMFAttributes::DeleteAllItems Removes all key/value pairs from the object's attribute list.
IMFAttributes::DeleteItem Removes a key/value pair from the object's attribute list.
IMFAttributes::GetAllocatedBlob Retrieves a byte array associated with a key. This method allocates the memory for the array.
IMFAttributes::GetAllocatedString Gets a wide-character string associated with a key. This method allocates the memory for the string.
IMFAttributes::GetBlob Retrieves a byte array associated with a key. This method copies the array into a caller-allocated buffer.
IMFAttributes::GetBlobSize Retrieves the length of a byte array associated with a key.
IMFAttributes::GetCount Retrieves the number of attributes that are set on this object.
IMFAttributes::GetDouble Retrieves a double value associated with a key.
IMFAttributes::GetGUID Retrieves a GUID value associated with a key.
IMFAttributes::GetItem Retrieves the value associated with a key.
IMFAttributes::GetItemByIndex Retrieves an attribute at the specified index.
IMFAttributes::GetItemType Retrieves the data type of the value associated with a key.
IMFAttributes::GetString Retrieves a wide-character string associated with a key.
IMFAttributes::GetStringLength Retrieves the length of a string value associated with a key.
IMFAttributes::GetUINT32 Retrieves a UINT32 value associated with a key.
IMFAttributes::GetUINT64 Retrieves a UINT64 value associated with a key.
IMFAttributes::GetUnknown Retrieves an interface pointer associated with a key.
IMFAttributes::LockStore Locks the attribute store so that no other thread can access it.
IMFAttributes::SetBlob Associates a byte array with a key.
IMFAttributes::SetDouble Associates a double value with a key.
IMFAttributes::SetGUID Associates a GUID value with a key.
IMFAttributes::SetItem Adds an attribute value with a specified key.
IMFAttributes::SetString Associates a wide-character string with a key.
IMFAttributes::SetUINT32 Associates a UINT32 value with a key.
IMFAttributes::SetUINT64 Associates a UINT64 value with a key.
IMFAttributes::SetUnknown Associates an IUnknown pointer with a key.
IMFAttributes::UnlockStore Unlocks the attribute store after a call to the IMFAttributes::LockStore method. While the object is unlocked, multiple threads can access the object's attributes.

Remarks

This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:

  • Windows XP with Service Pack 2 (SP2) and later.
  • Windows XP Media Center Edition 2005 with KB900325 (Windows XP Media Center Edition 2005) and KB925766 (October 2006 Update Rollup for Windows XP Media Center Edition) installed.

Requirements

   
Windows version Windows Vista [desktop apps | UWP apps] Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header mfobjects.h (include Mfidl.h)

See Also

Attributes and Properties

Media Foundation Interfaces